nanzh

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

来源:http://blog.csdn.net/duyiwuer2009/article/details/26263855

1. ip route show

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. $ ip route show  
  2. default via 192.168.217.2 dev eth0  metric 100   
  3. 192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1   
  4. 192.168.217.0/24 dev eth0  proto kernel  scope link  src 192.168.217.129  

eth0 网关地址为 192.168.217.2

 

 

2. route -n or netstat -rn

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. $ route -n  
  2. Kernel IP routing table  
  3. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
  4. 0.0.0.0         192.168.217.2   0.0.0.0         UG    100    0        0 eth0  
  5. 192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0  
  6. 192.168.217.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0  

eth0 网关地址为 192.168.217.2

 

 

3. traceroute www.baidu.com

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. $ traceroute www.baidu.com  
  2. traceroute to www.baidu.com (119.75.218.77), 30 hops max, 60 byte packets  
  3.  1  localhost (192.168.217.2)  0.607 ms  0.546 ms  1.379 ms  
  4.  2  * * *  
  5.  3  * * *  
  6.  4  * * *  
  7.  5  * * *  
  8.  6  * * *  
  9.  7  * * *  
  10.  8  * * *  
  11.  9  * * *  
  12. 10  * * *  

第一跳的地址就是网关地址

posted on 2017-04-13 10:41  深海里的星星nanzh  阅读(2251)  评论(0编辑  收藏  举报