我有3个网卡,1个Lan(有线),1个无线网卡和1个是无线USB
如何从特定的网卡ping?
以及如何将特定的网卡用于特定的应用
例
i want to ping google from wlan1
具体应用示例
i want to use firefox or transmission from wan1
Lan ip 192.168.0.2>可以正常使用 -I wlan1 google.com
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
172.16.221.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
192.168.0.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan1
192.168.48.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
one @ onezero:〜$ ip路由
default via 192.168.0.1 dev eth0 proto static
169.254.0.0/16 dev eth0 scope link metric 1000
172.16.221.0/24 dev vmnet8 proto kernel scope link src 172.16.221.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.2 metric 1
192.168.0.0/24 dev wlan1 proto kernel scope link src 192.168.0.3 metric 2
192.168.48.0/24 dev vmnet1 proto kernel scope link src 192.168.48.1
@哈立德
one@onezero:~$ ping -S 192.168.0.2 hotmail.com
PING hotmail.com (65.55.72.135) 56(84) bytes of data.
64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=1 ttl=236 time=391 ms
64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=2 ttl=236 time=296 ms
64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=3 ttl=236 time=393 ms
64 bytes from origin.sn131w.snt131.mail.live.com (65.55.72.135): icmp_req=4 ttl=236 time=352 ms
ping -S 192.168.0.3 hotmail.com
PING hotmail.com (65.55.72.183) 56(84) bytes of data.
64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=1 ttl=236 time=312 ms
64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=2 ttl=236 time=457 ms
64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=3 ttl=236 time=298 ms
64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=5 ttl=236 time=330 ms
64 bytes from origin.sn134w.snt134.mail.live.com (65.55.72.183): icmp_req=6 ttl=236 time=300 ms
现在最后是应用程序问题
1
您只想设置源地址,还是期望以某种方式选择其他网络路径?设置源地址不会自动改变选择的路由,并使任何特定接口退出。
—
Zoredache