From owner-freebsd-questions Sun Jan 21 6:20:41 2001 Delivered-To: freebsd-questions@freebsd.org Received: from bastix.tunix.nl (unknown [193.79.201.39]) by hub.freebsd.org (Postfix) with ESMTP id 86CFD37B698 for ; Sun, 21 Jan 2001 06:20:22 -0800 (PST) Received: (from fwmaster@localhost) by bastix.tunix.nl (8.9.1a/8.6.12) id PAA12406 for ; Sun, 21 Jan 2001 15:20:21 +0100 (MET) Received: by bastix.tunix.nl via smap (V1.3) id sma011971; Sun, 21 Jan 01 15:19:20 +0100 Received: from tunix.kun.nl by fix.tunix.kun.nl (8.8.8+Sun/SMI-SVR4) id PAA06934; Sun, 21 Jan 2001 15:18:56 +0100 (MET) Message-ID: <3A6AEFAB.DFA9B380@tunix.kun.nl> Date: Sun, 21 Jan 2001 15:18:19 +0100 From: Maurice klein Gebbinck X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Cc: maurice@tunix.nl Subject: ppp simultaneous dialin and dialout Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 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