OpenWrt Forum Archive

Topic: Patch for /etc/ppp/ip-up for use with openswan/ipsec

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

There is a problem when your pptp connection goes down and up. Openswan needs to re-bind the ipsec0 interfaces to the new ppp0 interrface.
This is best done by adding the fiollowintg 4 lines to /etc/ppp/ip-up:

if [ -f /var/run/pluto/pluto.pid ]                                             
then                                                                           
        ipsec tncfg --detach --virtual ipsec0 > /dev/null 2> /dev/null         
        ipsec tncfg --attach --virtual ipsec0 --physical ppp0                   
fi       

without openswan running the pid file would not exist, so this should not affect anyone else.

Paul

You shouldn't change /etc/ppp/ip-up for that. That's what we use hotplug for.
With hotplug scripts you also don't have to care about whether the interface you're attaching to is ppp, vlan or whatever...

The discussion might have continued from here.