Ubuntu 12.04 LTS 查看网关地址方法汇总

1. ip route show

  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

  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

  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  * * *  
第一跳的地址就是网关地址



参考资料

Centos/Linux下如何查看网关地址/Gateway地址?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值