How to view the default gateway and router table

neo created at1 month ago view count: 9
 route -n 
netstat -nr 


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 with the ifconfig(8) program.

When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables.



Netstat prints information about the Linux networking subsystem. The type of information printed is controlled by the first argument, as follows:  


By default, netstat displays a list of open sockets. If you don't specify any address families, then the active sockets of all configured address families will be printed.  

--route, -r

Display the kernel routing tables. See the description in route(8) for details. netstat -r and route -e produce the same output.  

--groups, -g

Display multicast group membership information for IPv4 and IPv6.  

--interfaces, -i

Display a table of all network interfaces.  

--masquerade, -M

Display a list of masqueraded connections.  

--statistics, -s

Display summary statistics for each protocol.  


search keywords