Post

Linux - Display Routing Table

Display Routing Table

  • route
  • netstat
  • ip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# route
$ sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0


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



# netstat
$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 eth0

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



# ip
$ ip route list
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.103
default via 192.168.0.1 dev eth0
This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.