zoukankan      html  css  js  c++  java
  • 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  * * *  

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

  • 相关阅读:
    git常用命令
    IDEA设置
    redis基础
    SQL 基础
    springboot 配置日志 打印不出来sql
    阿里巴巴开发规范最新版
    rabbitmq用户权限
    rabbitMQ配置文件
    RabbitMQ配置文件(rabbitmq.conf)
    C++模板编程:如何使非通用的模板函数实现声明和定义分离
  • 原文地址:https://www.cnblogs.com/nanzh/p/6702806.html
Copyright © 2011-2022 走看看