56. 查看本机路由的三种方式?

  1. [root@centos6 ~]# route -n
  2. Kernel IP routing table
  3. Destination Gateway Genmask Flags Metric Ref Use Iface
  4. 192.168.220.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
  5. 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
  6. 172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
  7. 0.0.0.0 172.16.0.1 0.0.0.0 UG 0 0 0 eth0
  8. [root@centos6 ~]# netstat -nr
  9. Kernel IP routing table
  10. Destination Gateway Genmask Flags MSS Window irtt Iface
  11. 192.168.220.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
  12. 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
  13. 172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
  14. 0.0.0.0 172.16.0.1 0.0.0.0 UG 0 0 0 eth0
  15. [root@centos6 ~]# ip route
  16. 192.168.220.0/24 dev eth1 proto kernel scope link src 192.168.220.157 metric 1
  17. 169.254.0.0/16 dev eth0 scope link metric 1002
  18. 172.16.0.0/16 dev eth0 proto kernel scope link src 172.16.251.6
  19. default via 172.16.0.1 dev eth0 proto static