Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


Search this Thread
Old 07-19-2012, 08:39 PM   #1
LQ Newbie
Registered: Apr 2011
Posts: 29

Rep: Reputation: 0
ppp0 ip rule add script


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, written by pptpconfig $Revision: 1.16 $

# name of tunnel, used to select lines in secrets files

# name of tunnel, used to name /var/run pid file

# name of tunnel, passed to ip-up scripts

# data stream for pppd to use
pty "pptp --nolaunchpppd "

# domain and username, used to select lines in secrets files
name myusername


# do not require the server to authenticate to our client

#suggested by priavte

# 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.

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 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,
Old 07-22-2012, 12:28 AM   #2
LQ Newbie
Registered: Apr 2011
Posts: 29

Original Poster
Rep: Reputation: 0
The problem was that the mtu was not set. I set it to 1400 and the connection stays up.


centos, ppp0, vpnclient

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add rule to iptables on login. paranoid times Linux - Software 3 02-23-2010 08:04 PM
How to add a rule to firewall surya_prakash Linux - Newbie 3 04-07-2009 07:53 AM
Add temporary rule to Iptables rickh Linux - Security 3 03-04-2008 11:10 AM
Question about route add default ppp0??? marsh58 Linux - Networking 3 06-26-2006 09:59 AM
ppp0 and startup script friskydrifter Linux - Networking 2 05-23-2004 11:35 AM

All times are GMT -5. The time now is 02:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration