View the current state of the routing table
Option 1
ip route
Option 2
- minimal version need to install “net-tools” package
dnf -y install net-tools
- type the following command and hit Enter:
netstat -rn
Option 3
- minimal version need to install “net-tools” package
- type the following command and hit Enter:
route
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