Debian: Persistent Network Routes

Debian: Persistent Network Routes

Okay so you have been able to enter you network routes using the “route add -net” command but then you reboot the server and DAM you have to put the routes back in. Well here is the solution.

Go to you network configuration file and open it up with your text editor

nano /etc/network/interfaces

Once your config file is open in nano or vim add the following to the bottom of the config file so when the network interface comes up your routes will automatically be added

up route add -net 10.0.0.0/8 gw 192.168.2.1 dev eth0
up route add -net 172.16.0.0/12 gw 192.168.1.1 dev eth1
up route add -net 192.168.0.0/16 gw 192.168.1.1 dev eth1

 

Advertisements