habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Easy Show Routes (routing table) in Linux

57 sec read

Easy-Show-Routes-routing-table-in-Linux

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:

  1. Accurate path of outgoing traffic after passing through the gateway.
  2. 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

Commandnestat -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.

Commandip 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.

See also  Wget Recursively Download All Files and Folder

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.

habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Centos Failed Update Kernel

Today I did a kernel update on my server with Centos 7 OS. At the end of the update process, I found a kernel...
habibzain
1 min read

Easy Fix Missing mirrorlist http://mirrorlist.centos.org on CentOS 7

When running yum update or command that utilize the yum system, errors similar to the following are produced: If you’re encountering issues with the...
habibzain
1 min read

Easy Create Laravel Project with Composer

Requirement Laravel, a popular PHP framework, is renowned for its elegant syntax and robust features, making it a top choice for web developers. One...
habibzain
1 min read

Leave a Reply

Your email address will not be published. Required fields are marked *

Never miss good article from us, get weekly updates in your inbox