Question: How Do I Permanently Add a Route in Linux?
Contents How Do I Add a Permanent Route in Linux? Adding Permanent Static Routes on Rhel or Centos, You Need to Modify the Interface File in...
Contents
How do I add a permanent route in Linux?
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’.
How do I permanently add a route in Ubuntu?
On Ubuntu, there are three ways of adding a permanent route to your Linux machine :
- You can add it to your Network Manager configuration file;
- You can edit your Netplan YAML configuration file;
- You can add your route to the “/etc/network/interfaces” file if you are using an old Ubuntu distribution.