LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ppp0 ip rule add script (http://www.linuxquestions.org/questions/linux-networking-3/ppp0-ip-rule-add-script-4175417687/)

andrew44 07-19-2012 08:39 PM

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,
~
~

andrew44 07-22-2012 12:28 AM

The problem was that the mtu was not set. I set it to 1400 and the connection stays up.


All times are GMT -5. The time now is 09:36 AM.