Home Diary Blog Photo Community Open Source
route for mac
1.默认有线路由metric会优先,所以同时接有线和无线时候,系统会自动把默认路由指到有线上去; 
2.手工配置可终端下man route; 
3.看不懂英文的看下面: 
4.su 换成root用户,不知道默认root口令自己百度 
5.#后route get 0.0.0.0 查看默认路由接口 
6.#后route add -net 0.0.0.0 x.x.x.x 这里x.x.x.x 为你想要走的默认网关


sudo route -n delete default 10.206.80.3
sudo route -n add 10.206.0.0/16 10.206.80.3
sudo route -n add 10.204.0.0/16 10.206.80.3
sudo route add -net 0.0.0.0 10.0.0.1
traceroute www.baidu.com




sudo route -n add default 10.0.0.1

sudo route -n add -net 10.206.0.0/16 10.206.80.3
sudo route -n add -net 10.204.0.0/16 10.206.80.3

or

sudo route -n add 10.206.0.0/16 10.206.80.3
sudo route -n add 10.204.0.0/16 10.206.80.3

------------------------------------------------

sudo route -n add -net 10.0.0.0/8 10.206.80.3
sudo route -n flush
netstat -rn

sudo route -n get default
sudo route get 0.0.0.0
route add -net 0.0.0.0 10.0.0.1
sudo route -n delete 10.206.0.0/16 10.206.80.3

sudo route -n delete default -link 8
sudo route -n delete 10/24 -link 5
sudo route -n delete 10.0.0.1


sudo route -n delete default 10.206.80.3
sudo route -n add 10.206.0.0/16 10.206.80.3
sudo route -n add 10.204.0.0/16 10.206.80.3
sudo route add -net 0.0.0.0 10.0.0.1

sudo route -n delete 169.254 -link 4
sudo route -n delete 224.0.0/4 -link 4
sudo route -n delete 255.255.255.255/32 -link 4


Only Wifi

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            10.0.0.1           UGSc           20        0     en1
10/24              link#5             UCS             1        0     en1
10.0.0.1/32        link#5             UCS             2        0     en1
10.0.0.1           10:da:43:8c:bd:bf  UHLWIir        18       20     en1   1188
10.0.0.17/32       link#5             UCS             1        0     en1
10.0.0.255         ff:ff:ff:ff:ff:ff  UHLWbI          0       17     en1
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              9   150062     lo0
169.254            link#5             UCS             0        0     en1
192.168.56         link#13            UC              6        0 vboxnet
192.168.56.101     8:0:27:9:b1:6b     UHLWIi          2       22 vboxnet   1187
192.168.56.255     ff:ff:ff:ff:ff:ff  UHLWbI          0       17 vboxnet
224.0.0/4          link#5             UmCS            2        0     en1
224.0.0.251        1:0:5e:0:0:fb      UHmLWI          0        0     en1
239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI          0        4     en1
255.255.255.255/32 link#5             UCS             0        0     en1

Both

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            10.206.80.3        UGSc           27        0     en0
default            10.0.0.1           UGScI          13        0     en1
10/24              link#5             UCS             1        0     en1
10.0.0.1/32        link#5             UCS             1        0     en1
10.0.0.1           10:da:43:8c:bd:bf  UHLWIir        15       11     en1   1180
10.0.0.17/32       link#5             UCS             1        0     en1
10.0.0.255         ff:ff:ff:ff:ff:ff  UHLWbI          0        9     en1
10.206.80/23       link#4             UCS             2        0     en0
10.206.80.3/32     link#4             UCS             1        0     en0
10.206.80.3        0:17:df:cb:c:0     UHLWIir        28        0     en0   1194
10.206.80.129/32   link#4             UCS             0        0     en0
10.206.80.202      44:87:fc:d7:9a:20  UHLWIi          1        2     en0   1193
10.206.81.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        9     en0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              9   150238     lo0
169.254            link#4             UCS             0        0     en0
169.254            link#5             UCSI            0        0     en1
192.168.56         link#13            UC              6        0 vboxnet
192.168.56.101     8:0:27:9:b1:6b     UHLWIi          2       28 vboxnet   1180
192.168.56.255     ff:ff:ff:ff:ff:ff  UHLWbI          0        9 vboxnet
224.0.0/4          link#4             UmCS            2        0     en0
224.0.0/4          link#5             UmCSI           1        0     en1
224.0.0.251        1:0:5e:0:0:fb      UHmLWI          0        0     en0
239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI          0        4     en0
239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI          0        4     en1
255.255.255.255/32 link#4             UCS             0        0     en0
255.255.255.255/32 link#5             UCSI            0        0     en1