In Linux operating system, routing table is used by the computer networks or servers to stores the routes of the destinations that responsible for forwarding. Routing tables contain a list of IP addresses and each of IP addresses identifies a network gateway. In this post, i will show you three ways to check and display the linux Routing Table on Fedora 16 server.
By using Route Command :
Route manipulates the kernel’s IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured.
By using netstat command :
Netstat prints information about the Linux networking subsystem such as network connections, routing tables and interface statistics.
1. Display routing table using “route -n” :
[root@fedora16 ~]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 p3p1 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 p3p1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 p3p1
2. Display routing table using “netstat -rn” :
[root@fedora16 ~]# netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 p3p1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 p3p1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 p3p1
3. Display routing table using “ip route show” :
[root@fedora16 ~]# ip route show default via 192.168.1.1 dev p3p1 169.254.0.0/16 dev p3p1 scope link metric 1002 192.168.1.0/24 dev p3p1 proto kernel scope link src 192.168.1.47