Jump to content

show route


rev.dennis
 Share

Recommended Posts

A very helpful command that is good to know

$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.6.0.129      0.0.0.0         UG    0      0        0 eth0
10.6.0.128      0.0.0.0         255.255.255.224 U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

-n option means that you want numerical IP addresses displayed, instead of the corresponding host names.

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.6.0.129      0.0.0.0         UG        0 0          0 eth0
10.6.0.128      0.0.0.0         255.255.255.224 U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
192.168.122.0   0.0.0.0         255.255.255.0   U         0 0          0 virbr0

-r option specifies that you want the routing table
-n option is similar to that of the route command

$ ip route list
default via 10.6.0.129 dev eth0
10.6.0.128/27 dev eth0  proto kernel  scope link  src 10.6.0.136
169.254.0.0/16 dev eth0  scope link  metric 1000
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1

 


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...