LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to make persistent iproutes using iproute2 (https://www.linuxquestions.org/questions/linux-networking-3/how-to-make-persistent-iproutes-using-iproute2-813649/)

digger86 06-11-2010 08:23 PM

How to make persistent iproutes using iproute2
 
I would like to have the below lines loaded at bootup and anytime the network is restarted (if possible).

Code:

ip rule add from 10.8.64.137 table T1
ip route add default 10.8.64.129 dev eth0 table T1
ip route add 10.8.64.128/27 dev eth0  src 10.8.64.137 table T1
ip route flush cache

I am using SuSE 11

Thanks

digger86 06-11-2010 10:31 PM

Solved
 
Never mind I figured it out.

man ifcfg explains that there is an option POST_UP_SCRIPT. So in /etc/sysconfig/network/ifcfg-eth3 I added:

Code:

POST_UP_SCRIPT='/etc/sysconfig/network/scripts/ifup-route.eth3'
I also added:

Code:

POST_DOWN_SCRIPT='/etc/sysconfig/network/scripts/ifdown-route.eth3'
There is still some cleanup I need to do thought it looks like the " ip rule add from" is running 2x's.


All times are GMT -5. The time now is 12:15 PM.