Ubuntu 12.04 LTS View Gateway address method Summary

Source: Internet
Author: User

Source: http://blog.csdn.net/duyiwuer2009/article/details/26263855

1. IP Route Show

[HTML]View PlainCopy 
    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 Gateway address is 192.168.217.2

2. Route-n or Netstat-rn

[HTML]View PlainCopy  
  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 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 Gateway address is 192.168.217.2

3. Traceroute www.baidu.com

[HTML]View PlainCopy  
    1. $ traceroute www.baidu.com
    2. Traceroute to Www.baidu.com (119.75.218.77), hops max, 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 * * *

The first hop address is the gateway address

Ubuntu 12.04 LTS View Gateway address method Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.