From owner-freebsd-questions Wed Jan 29 14:55:56 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA27688 for questions-outgoing; Wed, 29 Jan 1997 14:55:56 -0800 (PST) Received: from xmission.xmission.com (softweyr@xmission.xmission.com [198.60.22.2]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA27683 for ; Wed, 29 Jan 1997 14:55:53 -0800 (PST) Received: (from softweyr@localhost) by xmission.xmission.com (8.8.4/8.7.5) id PAA25019; Wed, 29 Jan 1997 15:55:31 -0700 (MST) From: Softweyr LLC Message-Id: <199701292255.PAA25019@xmission.xmission.com> Subject: Re: PPP dynamic IP routing To: dwhite@resnet.uoregon.edu Date: Wed, 29 Jan 1997 15:55:31 -0700 (MST) Cc: questions@freebsd.org In-Reply-To: from "Doug White" at Jan 28, 97 10:21:15 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Recently zerodist asked: % I use a dial up phone to dial up to my ISP. Both my ISP and I got ip % addresses randomly. To do automatic routing, I use Ip style as follows % in ppp.conf and ppp.linkup. % % ifconfig 203.70.2.66/24 203.70.2.4/24 in ppp.conf ^^^^^^^^ I hope you meant 'set ifaddr' there. Doug White replied: > Are you sure you want to hardwire this? Yes, often you do. The reason is that you want the tunnel device to have a recognizable address before the link is ever brought up so you can make it demand dial. In the above scenario, the tun device gets assigned address 203.70.2.66 -> 203.70.2.4, but will accept 203.x.x.x upon connect. This allows you to enter a default address via 203.70.2.66 allowing PPP to autodial as soon as any packet attempts to go offsite. In order to enable this, immediately after the you also want to add the default route *in ppp.conf*. I.e.: set ifaddr 203.70.2.66/24 203.70.2.4/24 in ppp.conf add 0 0 203.70.2.4 % add 0 0 203.70.2.4/24 in ppp.linkup > Change this to 'add 0 0 HISADDR' and it should work better. > (HISADDR==other side's IP address, MYADDR=IP address assigned to > your/local side) Exactly. You want to add the default route via whatever the newly assigned address is *when the link comes up.* PPP conveniently assigns this to the variable HISADDR for you. You probably want to delete the route first, i.e. ppp.linkup contains: delete 0 0 add 0 0 HISADDR to avoid getting errors about the route already existing. I've answered this same question several times recently. I just searched the archives for 'softweyr AND HISADDR' and got seven hits in the last two months. Can't we get this on the FAQ and stop repeating myself so often? ;^) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.xmission.com/~softweyr softweyr@xmission.com