mac 获取路由表命令
linjianingdeMBP:ssh linjianying$ netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
0/1 10.8.3.181 UGSc 71 0 utun2
default 192.168.50.1 UGSc 0 0 en0
10.8/16 10.8.3.181 UGSc 0 0 utun2
10.8.3.181 10.8.3.182 UHr 26 0 utun2
36.111.140.26/32 192.168.50.1 UGSc 1 0 en0
127 127.0.0.1 UCS 0 7 lo0
127.0.0.1 127.0.0.1 UH 58 51253549 lo0
128.0/1 10.8.3.181 UGSc 8 0 utun2
169.254 link#5 UCS 1 0 en0
192.168.50 link#5 UCS 12 0 en0
192.168.50.1/32 link#5 UCS 1 0 en0
192.168.50.1 c:4b:54:e2:b5:d3 UHLWIir 4 66 en0 1193
192.168.50.46 e0:b5:5f:f3:d2:54 UHLWI 0 11 en0 713
192.168.50.104/32 link#5 UCS 1 0 en0
192.168.50.104 6c:40:8:9d:5f:30 UHLWI 0 1 lo0
192.168.50.109 28:c2:dd:85:44:35 UHLWI 0 0 en0 378
192.168.50.110 c:54:15:3e:94:32 UHLWI 0 0 en0 618
192.168.50.116 28:c2:dd:85:44:35 UHLWI 0 0 en0 1137
192.168.50.132 10:63:c8:50:9f:81 UHLWI 0 0 en0 503
192.168.50.141 c8:9:a8:31:39:18 UHLWI 0 0 en0 1137
192.168.50.155 c:54:15:3e:94:32 UHLWI 0 0 en0 1139
192.168.50.167 e0:94:67:f3:a4:1c UHLWI 0 0 en0 1195
192.168.50.168 e0:b5:5f:f3:d2:54 UHLWI 0 2 en0 128
192.168.50.169 cc:66:a:1d:18:c1 UHLWI 0 12 en0 1091
192.168.50.180 4:b1:67:5b:b9:44 UHLWI 0 0 en0
192.168.50.189 30:57:14:c5:b:99 UHLWI 0 12 en0
224.0.0/4 link#5 UmCS 2 0 en0
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 55 en0
255.255.255.255/32 link#5 UCS 0 0 en0
获取Mac路由走哪张网卡
linjianingdeMBP:ssh linjianying$ route -n get 192.168.50.1
route to: 192.168.50.1
destination: 192.168.50.1
interface: en0
flags: <UP,HOST,DONE,LLINFO,WASCLONED,IFSCOPE,IFREF,ROUTER>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 1172
linjianingdeMBP:ssh linjianying$
linjianingdeMBP:ssh linjianying$ route -n get www.baidu.com
route to: 103.235.46.39
destination: default
mask: 128.0.0.0
gateway: 10.8.3.181
interface: utun2
flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0