Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jan 2001 15:18:19 +0100
From:      Maurice klein Gebbinck <maurice@tunix.nl>
To:        freebsd-questions@freebsd.org
Cc:        maurice@tunix.nl
Subject:   ppp simultaneous dialin and dialout
Message-ID:  <3A6AEFAB.DFA9B380@tunix.kun.nl>

next in thread | raw e-mail | index | archive | help
Hi,

After many evenings and a whole weekend of experimenting, I am stuck at
the following problem. To connect my computer at home to the intranet at
work I start up "ppp -auto ppp-dialout" at boot. This works flawlessly.
To build up connections from the intranet to my computer at home in case
the dialout link is not present, I have installed mgetty in AutoPPP
mode, resulting in "ppp -direct ppp-dialin". Also this works flawlessly.
The problem is that I cannot get them both to work at the same time.

The ppp-dialout stuff results in a tun0 being set up from 192.168.16.1
(home) to 172.16.2.12 (work), and a default route to 172.16.2.12 via
tun0. When there is an incoming connection, a tun1 is set up from
192.168.16.1 (home) to 172.16.2.12 (work), with a default route to
172.16.2.12 via tun1. To avoid conflicts, I made the ppp-dialin in
section ppp.conf to reconfigure the tun0 interface and delete the
default route via tun0. This is ugly and I hope there is a more elegant
way, but it works. However, when the dialin connection via tun1 is
finished, I want to restore the configuration of tun0 as well as the
default route, but so far I have been unsuccessful. These are my
configuration files:

ppp.conf
========
default:
 set log Phase Chat LCP IPCP CCP tun command
 set device /dev/cuaa0
 set speed 115200
 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT \
           OK-AT-OK ATZ OK \\dATDT\\T TIMEOUT 40 CONNECT"

ppp-dialout:
 set phone ********
 set authname ********
 set authkey ********
 set ifaddr 192.168.16.1 172.16.2.12 255.255.255.0 0.0.0.0
 add default HISADDR

ppp-dialin:
 enable chap
 shell /sbin/ifconfig tun0 10.1.1.1 10.1.1.2
 shell /sbin/route delete default
 set ifaddr 192.168.16.1 172.16.2.12 255.255.255.0 0.0.0.0
 add default HISADDR

ppp.linkdown
============
ppp-dialin:
 shell /sbin/ifconfig tun0 192.168.16.1 172.16.2.12
 shell /sbin/route add default 172.16.2.12

When the dialin connection is finished, tun0 is setup again from
192.168.16.1 (home) to 172.16.2.12 (work), but with "netstat -rn" I can
see that the following routes are missing:

default            172.16.2.12        UGSc        6        0     tun0
172.16.2.12        192.168.16.1       UH          7        0     tun0

I tried already a million things, but nothing seems to be able to
restore the original routing table. Can anyone point me in the right
direction?

Thanks,
Maurice

ps Please drop a CC to <maurice@tunix.nl> as I am not subscribed to this
mailing list.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A6AEFAB.DFA9B380>