Debian linux static routes addition


Posted by shroman

To add static routes on system start-up one can use directory:

/etc/network/if-up.d/

create executable file and add required actions there, file is run right after the network interfaces are up.

e.g.
vi /etc/network/if-up.d/static-routes

#!/bin/sh
#  Add static routes
#
/sbin/route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254
 

Tags: