GNU/Linux Command – IP (Part-4)

ip — Manipulate network device, routing and tunnels

The ip is a swiss army knife command. It does many functions like assigning IP addresses to interfaces, for setting up routes and display configurations etc. In this part, we will see some of the Routing table management using the IP command. Read the man page to know more about other routing table options.


$ ip route -- Show the routing table 
$ ip route show -- Same as above. 
$ ip route show to -- Show routes matching the TO 
$ ip ro show src -- Show routes matching the SRC 
$ ip ro show cloned -- Show all cloned routes. 
$ ip ro show cached -- Show all cached routes. 
$ ip ro show dev eth0 -- Show routes related to device eth0. 
$ ip r get -- Get the route to 
# ip ro add default via -- Add default route. 
# ip ro add via -- Add route to thru 
# ip ro change dev eth1 -- Redirect the route thru
  device eth1. 
# ip ro add via mtu 1400 -- Set the MTU 
  of this path is 1400. 
# ip ro del default -- Delete the default route. 
# ip ro del -- Delete a route entry. 
# ip ro del to -- Delete the matching entries. 
# ip ro flush all -- Flush all the entries. 
# ip ro flush cache -- Flush all the cached entries. 

Read: man ip

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: