How Do I Permanently Add Static Route in Linux Debian?
Contents

How do I make a static route permanent 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 add a persistent route in Debian?

For example under Red Hat/Fedora Linux you can add a static route for eth0 network interface by editing /etc/sysconfig/network-scripts/route-eth0 file. Under Debian Linux add static route by editing /etc/network/interface file.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest