Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Aug 1997 15:42:08 +0930 (CST)
From:      Greg Lehey <grog@lemis.com>
To:        fpm@n2.net (Frank MacLachlan)
Cc:        grog@lemis.com, freebsd-questions@FreeBSD.ORG
Subject:   Re: Question: ppp -auto
Message-ID:  <199708070612.PAA02036@freebie.lemis.com>
In-Reply-To: <19970806182901.00396@jsbach.n2.net> from Frank MacLachlan at "Aug 6, 97 06:29:01 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Frank MacLachlan writes:
> On Thu, Aug 07, 1997 at 09:19:05AM +0930, Greg Lehey wrote:
>>> snip]
>>
>> In order for ppp -auto to detect outgoing packets, it first has to
>> receive them.  For this to happen, there must be a route which points
>> to the ppp interface.  This means that you need to know at least the
>> IP address which will be assigned to the interface (in other words,
>> this won't work with a dynamically allocated address).  When you start
>> the system, you need to issue at least the following commands:
>>
>>   ifconfig tun0 my-ip-address his-ip-address
>>   route add default his-ip-address
>>
>> Normally, you'd do this in sysconfig:
>>
>>   network_interfaces="....  tun0"	# include tun0 in the list of
>>                                         # network interfaces
>>   ifconfig_tun0="my-ip-address his-ip-address"  # see above
>>   static_routes="route_tun0"	# add route_tun0 to anything else you
>> 				# might have here
>>   route_tun0="default his-ip-address"  # see above
>
> I do autodial ppp w/o any modifications to /etc/sysconfig.  I fire off
> ppp in /etc/rc.local and it dials out when I go outside of my local
> network.  Here's my /etc/ppp.conf file:
>
> ------------------------------------
> default:
>  set device /dev/cuaa1
>  set speed 115200
>  disable lqr
>  deny lqr
>  disable vjcomp
>  deny vjcomp
>  set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATE1Q0 OK-ATS27=32-OK \\dATDT\\T TIMEOUT 40 CONNECT"
>
> # USR server w/ static IP addr on my end, dynamic IP addr on far end of link.
> n2f_new:
>  set phone 1234567
>  set login "TIMEOUT 10 gin:-BREAK-gin: fixed-ip-login-name word: my-password"
>  set timeout 900
>  set ifaddr 207.111.222.333 207.111.222.1/0 255.255.255.0
>  add 0 0 207.111.222.1
>
> # USR server w/ dynamic IP addr on both ends of link.
> n2d_new:
>  set phone 1234567
>  set login "TIMEOUT 10 gin:-BREAK-gin: dynamic-ip-login-name word: my-password"
>  set timeout 900
>  set ifaddr 207.111.222.333/0 207.111.222.1/0 255.255.255.0
>  add 0 0 207.111.222.1
> ------------------------------------
>
> The trick is to establish a route that goes to the ppp device.
> I don't care if the IP addresses are correct, therefore I use
> 207.111.222.1/0 which indicates that 0 bits of the IP address
> are assumed correct.  The 207.111.222 value is the address of
> the ISP's class C network; the 1 at the end is arbitrary and the
> correct value will be filled in the linkup phase.

Nice!  In addition, as you show, this works with dynamic addresses,
though you're going to lose any outstanding connections any time the
address changes.  This works, of course, because the addresses of the
end points of the PPP link don't really mean anything; the important
thing is to be able to route.

> Here's my ppp.linkup:
>
> ------------------------------------
> MYADDR:
> 	delete ALL
> 	add 0 0 HISADDR

Have you tried running without this?  I suspect it would still work.

Greg



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