Greg Scott | 15 Jul 2012 13:48

How to add PPTP routes to alternate routing tables?

Hello - 

I have a Linux pptp server system running pptpd 1.3.4.  The pptpd server
has two Internet feeds and I have some ip rules and scripting to decide
which feed to use, depending on the application and internal host.  This
all works as expected.

I have one internal host at 192.168.15.30 giving me trouble.  I am
unable to access this host at all from any PPTP client.  I can access
any other host in the LAN behind the PPTP server, but not this specific
host.  

And now I know why.  Because I have this ip rule:

ip rule add from 192.168.15.30 lookup att

And routing table att looks like this:

1.2.98.112/29 dev eth2  scope link  src 1.2.98.113
default via 1.2.98.118 dev eth2

That's the difference - none of the other hosts have an ip rule.
Anything from this host uses my alternate routing table named att.
That's the difference.  

And sure enough - if I get rid of my ip rule, now my host at .30
responds to my PPTP client.  

OK - so what does the main routing table show?  Here is the relevant
PPTP route that my problem host never sees:
(Continue reading)

James Cameron | 16 Jul 2012 04:05
Favicon

Re: How to add PPTP routes to alternate routing tables?

I can't say if you are on the right track with your routing, because I
don't understand the basis for it, but I can answer your question on
how to dynamically add routes when a client connects.

pptpd uses pppd for setting up the network interface and routes.

pppd can call out to scripts at the time the connection is made.

/etc/ppp usually contains these scripts.  You might write one that
recognises the client and makes routing changes accordingly.

The details are Linux distribution specific, and you didn't mention
which one you are using.  Look for ip-up.d in that directory.  Look
for references to ip-up, ip-pre-up and ip-down in man pppd.

--

-- 
James Cameron
http://quozl.linux.org.au/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Gmane