Skip to content
Advertisement

Making changes with ifconfig persistent [closed]

can anyone tell me on how to make the following commandline changes persistent? (Like via /etc/network/interfaces or /etc/dhcpcd.conf)

JavaScript

I need to make these changes to make this RPI use a Router as a default gateway a room next to ours. For more info: We don’t have direct access to this Router, as in we can’t make any changes to it by ourselves.

Am thankful for any insightful responses.

Advertisement

Answer

To make the route permanent, you need to create a static route configuration file. Create a file with the name route-interface in /etc/sysconfig/network-scripts directory, such as /etc/sysconfig/network-scripts/route-eth0

Then, add the same line you would with ip route add:

JavaScript

Make sure to restart your network settings so they take effect:

JavaScript
Advertisement