The routing table of Linux is described in detail

  • 2020-06-19 12:21:07
  • OfStack

The ROUTING table of Linux is described in detail

1 Execute the route command under Linux


[root@localhost backup]# 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  100  0    0 enp0s3
192.168.0.0   0.0.0.0     255.255.255.0  U   100  0    0 enp0s3
192.168.122.0  0.0.0.0     255.255.255.0  U   0   0    0 virbr0
 
[root@localhost backup]# route
Kernel IP routing table
Destination   Gateway     Genmask     Flags Metric Ref  Use Iface
default     gateway     0.0.0.0     UG  100  0    0 enp0s3
192.168.0.0   0.0.0.0     255.255.255.0  U   100  0    0 enp0s3
192.168.122.0  0.0.0.0     255.255.255.0  U   0   0    0 virbr0
 

Details of route command

1. Command syntax


route [-n]
 Options and Parameters: 
-n : Gives the host name as IP display 

2. Analysis of query results


Destination  : In fact Network The meaning of. 
Gateway    : That's the interface Gateway the IP If, for 0.0.0.0 , means no extra is needed IP . 
Genmask   Is: Netmask , and Destination Combined into 1 A host or network. 
Flags       : A number of flags can be used to indicate what the network or host represents. 
            U : represents the route available. 
            G : the representative needs to go through Gateway To help pass it around. 
            H : represents the route for this line 1 The console, not the console 1 A network. 
Iface       Is: interface The meaning of (interface). 

The above is the detailed explanation of Linux routing table, if you have any questions, please leave a message or go to this site community exchange discussion, thank you for reading, hope to help you, thank you for your support to this site!


Related articles: