Date: Sun, 19 Jan 1997 12:25:26 -0700 (MST) From: Wes Peters <softweyr@xmission.com> To: Pete McNab <stillers@slip.net> Cc: questions@freebsd.org Subject: PPP autodial (was: PPP/Routing problems) Message-ID: <199701191925.MAA04304@obie.softweyr.ml.org> In-Reply-To: <E0vllRp-0005Lo-00@slip-3.slip.net> References: <E0vllRp-0005Lo-00@slip-3.slip.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Pete McNab writes: > I am running FreeBSD 2.1. I have followed the ppp user setup > instructions in the handbook, and I can connect to my ISP > by either manually dialing, or just issuing dial at the ppp prompt. > > I can not make any network connection to the internet, however. > > If I have ppp -auto running, when I attempt to use the network, > there is no attempt by ppp to dial out. My ISP gives me a dynamic > IP address, so I have used 0 whereve the IP address is needed. This is a little esoteric, so I'll try to explain carefully. I think I've answered this before, but it was probably buried in the middle of a large message. To complete your PPP autodial setup: First, when PPP first comes up, you will need to give the PPP link default addresses on both ends, and to add a default route via this link. Don't worry if the addresses are 100% correct, we will fix them automagically when the link comes up. These addresses and route just allow us to create a default route when the computer is first booted. OK, here's how you do this. Let's assume that your ISP gives you a dynamic IP address each you dial up, and further assume that the address you receive always starts with 206.100. The address on the other end, the router you are talking to, is also dynamic and in the 206.100.22 network. In /etc/ppp.conf, in the setup for your ISP, configure: ISP: ... set ifaddr 206.100.1.1/16 206.100.22.1/8 ^ ^ ^ ^ | | | + His address is 206.100.22.x | | + His address defaults to this | + My address is 206.100.x.x + My address defaults to 206.100.1.1 Now we want to add the default route via this interface. We need to do this in order for auto-dial to work; if we don't have a route through the interface packets bound off-site have nowhere to go. With the default route, packtes bound off-site get routed to the PPP link, signalling ppp to bring up the interface. In ppp.conf, immediately after the 'set ifaddr' line above: add 0 0 206.100.22.1 Now, whenever a packet gets routed to the internet via the tun device, the link will be auto-dialed if it is down. In order to keep this working, we need to patch up this route when the link comes up. In /etc/ppp/ppp.linkup: MYADDR: delete 0 0 add 0 0 HISADDR The first command will delete the current default route; this keeps the next command from complaining about the default route already existing. The second adds a new default route via the remote end of the PPP link just brought up. Once the link goes down, this route will remain, giving us the required default route for the next auto-dial. Our resulting config files look like: /etc/ppp/ppp.conf: # # Default setup. Executed always when PPP is invoked. # default: set device /dev/cuaa1 set speed 115200 set debug phase chat lqm lcp set timeout 3600 set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 10 \"\" ATZ OK-AT-OK ATE1Q0 OK-AT-OK \\dATDT\\T TIMEOUT 40 CONNECT" # # My ISP, with active pap authentication: # isp: disable chap deny chap enable pap accept pap set authname myname set authkey mypass set openmode active set phone 5551212 set ifaddr 206.100.1.1/16 206.100.22.1/8 add 0 0 206.100.22.1 /etc/ppp/ppp.linkup: # # In all cases (since we've only got one) add his address as default # gateway. This has the added benefit of making *any* packet routed # off our network redial the link. Of course, this makes casual # name lookups expensive. # MYADDR: delete 0 0 add 0 0 HISADDR -- "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?199701191925.MAA04304>