How Do I Permanently Add a Static Route in Linux Rhel 7?
Contents How Do I Permanently Add a Static Route in Linux 7? Adding Permanent Static Routes on Rhel or Centos, You Need to Modify the Interface File in...
Contents
How do I permanently add a static route in Linux 7?
Adding permanent static routes
On RHEL or CentOS, you need to modify the interface file in ‘/etc/sysconfig/network-scripts’. For example, here, we have to add routes on network interface ens192. Hence, the file we need to modify will be ‘/etc/sysconfig/network-scripts/route-ens192’.
Must Read
How do I add a static route in Linux?
To do this, you need to add a static route.
- Add a temporary static route. If you wish to add one temporarily, simply run the ip route add command with the right network information: ip route add 172.16.5.0/24 via 10.0.0.101 dev eth0. …
- Add a permanent static route. …
- If you lose your internet connection.