1.

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
172.20.0.0      0.0.0.0         255.255.0.0     U     0      0        0 tap0
192.168.1.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0
2.

$ ip route show
default via 192.168.1.1 dev wlan0  proto static 
172.20.0.0/16 dev tap0  proto kernel  scope link  src 172.20.0.1 
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.105  metric 9 

3.

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
172.20.0.0      0.0.0.0         255.255.0.0     U         0 0          0 tap0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐