Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jan 1997 15:55:31 -0700 (MST)
From:      Softweyr LLC <softweyr@xmission.com>
To:        dwhite@resnet.uoregon.edu
Cc:        questions@freebsd.org
Subject:   Re: PPP dynamic IP routing
Message-ID:  <199701292255.PAA25019@xmission.xmission.com>
In-Reply-To: <Pine.BSI.3.94.970128221941.24983f-100000@localhost> from "Doug White" at Jan 28, 97 10:21:15 pm

next in thread | previous in thread | raw e-mail | index | archive | help
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



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