linux查询网络路由表

netstat

[root@10-21-0-1 ~]# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.21.15.254    0.0.0.0         UG        0 0          0 eth0
10.21.0.0       0.0.0.0         255.255.240.0   U         0 0          0 eth0
169.254.169.254 10.21.15.253    255.255.255.255 UGH       0 0          0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U         0 0          0 docker0
172.28.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-f6f09effe987
172.29.0.0      0.0.0.0         255.255.0.0     U         0 0          0 br-028224f9219f

route

[root@10-21-0-1 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.21.15.254    0.0.0.0         UG    100    0        0 eth0
10.21.0.0       0.0.0.0         255.255.240.0   U     100    0        0 eth0
169.254.169.254 10.21.15.253    255.255.255.255 UGH   100    0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
172.28.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-f6f09effe987
172.29.0.0      0.0.0.0         255.255.0.0     U     0      0        0 br-028224f9219f
posted @ 2022-10-17 13:47  爱折腾的大臭臭  阅读(199)  评论(0编辑  收藏  举报