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  Linux Show Folder Size and File in Directory

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.

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

Virtualbox Change Storage Size

Changing the storage size of a virtual machine in VirtualBox involves a few steps. Here’s a general guide. Backup your Virtual Machine (VM) Before...
habibzain
35 sec read

Easy Setup Logrotate Nginx Ubuntu

Log rotation is an important aspect of managing log files on a Linux system, including those generated by Nginx. Logrotate is a utility that...
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