[465] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: Thanks! IP forwarding between PPP links... Works now.

daemon@ATHENA.MIT.EDU (Kayvan Sylvan)
Tue Jun 13 03:51:26 1995

Date: Mon, 12 Jun 95 22:51 PDT
To: remisosk@forklift.mi04.zds.com (Tom Remisoski)
Cc: linux-ppp@vger.rutgers.edu, linux-net@vger.rutgers.edu
In-Reply-To: <m0sL9TU-000ACTC@forklift.mi04.zds.com>
From: Kayvan Sylvan <kayvan@Sylvan.COM>

>>>>> "Tom" == Tom Remisoski <remisosk@forklift.mi04.zds.com> writes:

Tom> Kayvan,

Tom> Could you describe the commands you used to set up the dummy routes?
Tom> I may have a similar configuration soon.

Here's what I do:

In /etc/rc.d/rc.inet1:

========================== excerpt of rc.inet1 ==========================
/sbin/modprobe dummy > /dev/null 2>&1 # load the dummy device driver
/sbin/ifconfig dummy0 up	# Bring dummy interface up.
for i in 2 3 4 5 6
do
	/sbin/route add 204.153.195.$i dev dummy0
done
========================== excerpt of rc.inet1 ==========================

These commands bring up a non-functioning dummy interface (which,
oddly enough, is exactly what I want in this case). Without the above
routes, any traffic for the addresses goes back out to the remote side
of my main PPP link to my Internet provider. Their router says "Oh!
This should go to 204.153.195.1" and sends it back. A loop. Not good.

The machines are networked to satyr.sylvan.com through direct serial
connections. When they log in, pppd puts them on the right interface
and sets up a working route. The kernel then does the IP forwarding.

The only remaining problem is resetting the dummy routes when the
machines log out. I tried doing this in /etc/ppp/ip-down, but it looks
like ip-down is executed before the routes are deleted. I finally had
to resort to this hack. The login shell for the ppp accounts executes
the following script:

============================== dopassive ==============================
#!/bin/sh
#
# Passive PPP for Mac and PC
#
# Author: Kayvan Sylvan
#
. /etc/ppp/config

export PPPCLEANUP=/var/tmp/.ppp$$
pppd passive
/bin/sh $PPPCLEANUP
rm -f $PPPCLEANUP
exit 0
============================== dopassive ==============================

The file pointed to by $PPPCLEANUP is created by the ip-down script
reproduced below.

============================== /etc/ppp/ip-down ==============================
#!/bin/sh
#
# script run by pppd when the IP link goes down.
#
# Author: Kayvan Sylvan
#

IFNAME=$1
TTY=$2
SPEED=$3
LOCALIP=$4
REMOTEIP=$5

case "$LOCALIP" in
# This is our address on the ISP network
204.153.195.1)
	case "$REMOTEIP" in
	204.139.9.*) # This is our dedicated PPP link. Should not be down.
[... deleted ...]
		;;
	204.153.195.[2-6]) # passive PPP clients.
		# Set up the clean up script.
		echo route add $REMOTEIP dev dummy0 > $PPPCLEANUP
		;;
	*)
		true;	# Do nothing
		;;
	esac
	;;

129.212.*) # Our dynamically assigned PPP address on the Amdahl net.

[... deleted ...]

esac
============================== /etc/ppp/ip-down ==============================

So now, whenever the link goes down, the dummy route is set up again.

			---Kayvan

"The trust and respect of a child is an honor to be earned, not demanded."
Kayvan Sylvan         | Sylvan Associates           | Proud Dad of:
kayvan@Sylvan.COM     | http://www.isp.net/~kayvan  | Katherine Yelena (8/8/89)
(408) 978-1407 PGP OK | Ask me about Avatar.        | Robin Gregory (2/28/92)

home help back first fref pref prev next nref lref last post