automatic static routes?
Is there a way I can automatically add static routes once a network interface goes up?
|
This will vary from distribution to distribution. Worst case, you can always find the init script that starts your network and hardcode your static routes (route add .. etc.) onto it.
What distribution are you using? |
Oh... I know where to write stuff for the boot process..... but I mean if during normal operation, one link is brought down and back up.
(It's Ubuntu). |
I've never actually used ubuntu but since it's debian based I'm gonna assume it's the same as in debian proper. Put a line for each static route in /etc/network/interfaces. Eg let's say eth1 is connected through gateway 192.168.1.254 to the 10.0.0.1/24 network:
Code:
iface eth1 inet static |
But that will work if I use the /etc/init.d/networking script, right?
How about if I use ifconfig eth0 down; ifconfig eth0 up? will it work anyway? |
It works with /etc/init.d/networking and ifup/ifdown since these scripts read the interfaces file. It will not work when you use ifconfig.
|
All times are GMT -5. The time now is 04:56 AM. |