Hi Dude, today i will write about how to show or print routing table in generally linux operating system. Show routes are very useful for system administrators or network engineers to troubleshoot networks.
Show route or routing table will give us the following information:
- Accurate path of outgoing traffic after passing through the gateway.
- Selection of the default gateway if it has more than 1 interface.
To display the kernel routing table, you can use any of the following methods:
Command route
This simple command using route
. The command route is used to modify and check the existing routes. This will display the list of routes currently configured.
Command: route -n
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
Command netstat
Generally, this command gives the statistics about the network. To check the routing table. If netstat
not installed. Install it first base on your operating system.
For Debian/Ubuntu Base: apt install net-tools
For Red Hat/Centos/Alma: yum install net-tools
Command: nestat -rn
$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
Command IP Route
To check routing table using command ip.
Command: ip route list
$ ip route list
default via 192.168.0.1 dev wlan0 proto static
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.5 metric 9
That is simple article about Show routing table in linux operating system.
Then, what if we use windows? Good question. If we use windows base, can follow this link article.
Hope it’s helpful, please leave a comment and I’ll appreciate it.