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


    来源: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  * * *  

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

  • 相关阅读:
    页面实现文件的下载
    微信小程序拉起登录的操作
    css3之border-radius理解
    web前端常用网站--更新中
    小程序中遇见文件过大的话就需要分包
    JS中的“&&”与“&”和“||”“|”有什么区别?
    ts中有时莫名报错
    浏览器解析JavaScript的原理
    在vue中axios的问题
    eslint的规则
  • 原文地址:https://www.cnblogs.com/nanzh/p/6702806.html
Copyright © 2020-2023  润新知