LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 07-19-2012, 08:39 PM   #1
andrew44
Member
 
Registered: Apr 2011
Posts: 31

Rep: Reputation: 0
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,
~
~
 
Old 07-22-2012, 12:28 AM   #2
andrew44
Member
 
Registered: Apr 2011
Posts: 31

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


Reply

Tags
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 07:34 AM.

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