[pptp-server] pptp and routing multiple connections

Larry Rivera larrydog at coqui.net
Mon Aug 14 09:12:51 CDT 2000


Hello:

I have been working on routing multiple pptp connections and would like
to share my solution and see if anyone has a better option:
Problem: When implementing multiple pptp tunnels we all know that the
pptpd daemon dynamically assigns ip addresses according to what is
established in /etc/pptpd.conf, i.e.

/etc/pptpd.conf

speed 115200
option /etc/ppp/options.pptpd
localip X.X.10.201-210  (needed for multiple connections)
remoteip X.X.10.211-220

Other parameters are established in the options.pptpd file:
/etc/ppp/options.pptpd

lock
#debug
name federal2
auth
require-chap
-proxyarp (needed for full routing)

I have two subnets X.X.5.0 and X.X.6.0 which must establish their routes
when connecting.  The only problem is that since these are virtual
connections there is no parameter in /etc/ppp/ip-up & ip-down that will
properly route the connections so that each subnet is routed correctly.
(Example: the ppp* interface ($5 variable) will raise according to what
pptpd determines) therefore there is no way I can say ppp1 will be for
X.X.5.0 and ppp2 will be for X.X.6.0. Since these are not serial
connections I cannot use ttyS* ($2 variable) to set these routes.
Similarly, the variables that set the remote address cannot be used
because pptpd will change this according to need.

The following code will at least set the routes according to the name
sent to the system when chap authentication occurs.
###/etc/ppp/ip-up

###Caguas
tail -n 10 /usr/local/log/pptpd.log > /tmp/vpn
result=`grep fed5 /tmp/vpn`
if [ "$result" ]
then
  /sbin/route add -net X.X.6.0 netmask 255.255.255.0 gw $5
fi

#####Ponce
tail -n 10 /usr/local/log/pptpd.log > /tmp/vpn
result=`grep fed4 /tmp/vpn`
if [ "$result" ]
then
  /sbin/route add -net X.X.5.0 netmask 255.255.255.0 gw $5
fi

On multiple pptp connections this will ensure that anytime "fed4" or
"fed5" connect, the system will set the proper route to that subnet.

Any comments?
LR








More information about the pptp-server mailing list