You are not logged in.
I've set up a ppp connection so that I can connect to my university's vpn and it works nicely
So I want to run a script when the connection is up and another when the connection is down, for setting the routes (for tunneling). I found a script for this on the webpage of pppclient, and I tried putting it in the /etc/ppp/ip-up.d/ folder, where there already was a script for setting the dns ("00-dns.sh"), which seems to work because when I set up the connection ($ pon myCon) resolv.conf gets the vpn's dns. But the script I found does not seem to run, I named it "01-tunnel.sh". Both script has 755 mode.
Anyone have some tips?
edit:
btw, here is the up script...
#!/bin/sh
# pppd ip-up script for all-to-tunnel routing
# name of primary network interface (before tunnel)
PRIMARY=wlan0
# address of tunnel server
SERVER=vpn-server
# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi
# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi
# if we are being called as part of the tunnel startup
if [ "${CONNECTION}" = "tunnel" ] ; then
# direct tunnelled packets to the tunnel server
route add -host ${SERVER} dev ${PRIMARY}
# direct all other packets into the tunnel
route del default ${PRIMARY}
route add default dev ${TUNNEL}
fi
Last edited by mapster (2010-05-02 19:48:31)
Offline
try checking the /etc/ppp/ip-up script, although your script should work because by default all scripts *.sh in ip-up.d files are run after a successful connection. try adding the script to the ip-up script itself if it doesnt work.
Offline
checked that the scipts run by making them output what they do to a file. And they execute what they should, but somehow all the route executions gets ignored or overrun lateron :S when the scripts run they have the necessary rights to execute route too....
Offline
yes, the route problem that you have is because ppp needs the full path to execute those commands, try replacing route with /sbin/route, it should work fine then.
Offline
Ahhh... Thanks
That did the trick
Offline