[CentOS] making a route sticky

Aleksandar Milivojevic alex at milivojevic.org
Fri Aug 5 15:56:28 UTC 2005


Quoting Feizhou <feizhou at graffiti.net>:

> create /etc/ppp/ip-up.local and /etc/ppp/ip-down.local to handle these.
>
> When ADSL goes up, the pppd daemon can run ip-up.local to setup the 
> routes needed and when it goes down, the pppd daemon can run 
> ip-down.local to fix things or remove those routes.
>
> However, ADSL and VPN may imply move than one ppp interface (pptp 
> based vpns) and if that is the case you want to add logic to 
> differentiate whether you are handling the ADSL ppp interface or the 
> VPN interface.

Thanks, using ip-up.local solved my problem.  I've placed follwing script into
it:

#! /bin/sh

cd /etc/sysconfig/network-scripts
for ifconfig in `ls ifcfg-*`; do
   unset TYPE
   . $ifconfig
   if [ "$TYPE" = "IPSEC" ]; then
      vpn=`echo $ifconfig | cut -f2 -d'-'`
      ifdown $vpn
      ifup $vpn
   fi
done

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





More information about the CentOS mailing list