我在OSX优胜美地,我有两个不同的有效连接...... - WIFI(en0) - 连接USB(en7)
SnakeBook:~ root# netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGSc 14 4 en0
default 192.168.42.129 UGScI 0 0 en7
现在......我需要添加一条路线来通过网络连接浏览一些网站。例如,我想使用en7在speedtest.net上运行speedtest。我的DNS(使用OpenDNS的192.168.1.1)以这种方式解决了Speedtest ...
SnakeBook:~ root# nslookup speedtest.net
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: speedtest.net
Address: 216.146.46.10
Name: speedtest.net
Address: 216.146.46.11
现在......我添加了两条路线:
SnakeBook:~ root# route add -host 216.146.46.10 192.168.42.129
add host 216.146.46.10: gateway 192.168.42.129
SnakeBook:~ root# route add -host 216.146.46.11 192.168.42.129
add host 216.146.46.11: gateway 192.168.42.129
SnakeBook:~ root# netstat -nr
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.1.1 UGSc 14 4 en0
default 192.168.42.129 UGScI 0 0 en7
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 3 13259 lo0
169.254 link#4 UCS 0 0 en0
169.254 link#12 UCSI 0 0 en7
192.168.1 link#4 UCS 3 0 en0
192.168.1.1/32 link#4 UCS 1 0 en0
192.168.1.1 0:1c:f0:38:4e:49 UHLWIir 17 509 en0 1199
192.168.1.4/32 link#4 UCS 0 0 en0
192.168.1.7 30:59:b7:a6:3b:cf UHLWI 0 0 en0 1155
192.168.1.8 64:9a:be:ee:43:93 UHLWI 0 0 en0 1105
192.168.1.255 ff:ff:ff:ff:ff:ff UHLWbI 0 3 en0
192.168.42 link#12 UCS 1 0 en7
192.168.42.114/32 link#12 UCS 1 0 en7
192.168.42.129/32 link#12 UCS 1 0 en7
192.168.42.129 76:0:b4:4:cc:38 UHLWIir 3 2 en7 713
192.168.42.255 ff:ff:ff:ff:ff:ff UHLWbI 0 3 en7
216.146.46.10 192.168.42.129 UGHS 0 0 en7
216.146.46.11 192.168.42.129 UGHS 0 0 en7
并在speedtest.net上尝试traceroute似乎工作正常。
SnakeBook:~ root# traceroute speedtest.net
traceroute: Warning: speedtest.net has multiple addresses; using 216.146.46.11
traceroute to speedtest.net (216.146.46.11), 64 hops max, 52 byte packets
1 192.168.42.129 (192.168.42.129) 0.760 ms 0.192 ms 0.366 ms
...
...
12 * *^C
问题是我使用浏览器时。使用浏览器,流量总是通过en0 gw而不是en7 gw。这个问题是由“两个”默认网关引起的吗?
我试图删除en7 gw,但它总是删除我的en0 gw:
SnakeBook:tmp root# netstat -nr | grep default
default 192.168.1.1 UGSc 30 4 en0
default 192.168.42.129 UGScI 0 0 en7
SnakeBook:tmp root#
SnakeBook:tmp root#
SnakeBook:tmp root# route delete default 192.168.42.129
delete net default: gateway 192.168.42.129
SnakeBook:tmp root#
SnakeBook:tmp root#
SnakeBook:tmp root# netstat -nr | grep default
default 192.168.42.129 UGScI 0 0 en7
有什么建议吗?
谢谢!