ppp0 ip rule add script
Hi,
I have a linux router dialing as a client to a VPN service provider. The connection seems pretty stable
This is my pptpconfig script
# tunnel andrew-someplace.access.com, written by pptpconfig $Revision: 1.16 $
# name of tunnel, used to select lines in secrets files
remotename andrew-someplace.access.com
# name of tunnel, used to name /var/run pid file
linkname andrew-someplace.access.com
# name of tunnel, passed to ip-up scripts
ipparam andrew-someplace.access.com
# data stream for pppd to use
pty "pptp andrew-someplace.access.com --nolaunchpppd "
# domain and username, used to select lines in secrets files
name myusername
usepeerdns
require-mppe
refuse-eap
persist
# do not require the server to authenticate to our client
noauth
#suggested by priavte
require-mschap-v2
require-mppe-128
novj
novjccomp
# adopt defaults from the pptp-linux package
file /etc/ppp/options.pptp
# end of tunnel file
The connection redials automatically but when it drops it also takes with it any ip rules I've added.
So I created this script. ip-up.local and put it into /etc/ppp. My understanding is that if the connection is dropped this script will be run.
#!/bin/sh
export PPP0=`ifconfig ppp0 | grep "inet addr" | awk '{ print $2 }' | awk 'BEGIN { FS=":" } { print $2 }'`
echo "1 andrew">> /etc/iproute2/rt_tables
ip rule add from 192.168.2.76 table andrew
ip route add default via $PPP0 dev ppp0 table andrew
ip route flush cache
~
It seems to add the rules each time it needs to but when this script runs the connection seems to drop every minute or so. Is the problem this script?
Thanks in advance,
~
~
|