Linux edit Route Table

View the current state of the routing table

Option 1

ip route 3baf970dfe2c81d10613c4c08ec4e684.png

Option 2

  1. minimal version need to install “net-tools” package dnf -y install net-tools
  2. type the following command and hit Enter: netstat -rn 60b81f6bc6533eac152c56982f54a741.png

Option 3

  1. minimal version need to install “net-tools” package 
  2. type the following command and hit Enter: route 3c3de4a28a99508993d2814e0bf6d347.png

Add a Static Route to the Linux Routing Table

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.

Option 1

The target is a network route -p add -net network-address -gateway gateway-address Creates a route that must persist across system reboots. If you want the route to prevail only for the current session, do not use the -p option.

Option 2

The target is a host route -p add -host network-address -gateway gateway-address

Remove a Static Route from the Linux Routing Table

Option 1

The target is a network route -p del -net network-address -gateway gateway-address Creates a route that must persist across system reboots. If you want the route to prevail only for the current session, do not use the -p option.

Option 2

The target is a host route -p del -host network-address -gateway gateway-address