Date: Wed, 7 Jun 1995 13:14:39 -0400 (EDT) From: "Michael C. Newell" <mnewell@lupine.nsi.nasa.gov> To: M C Wong <mcw@hpato.aus.hp.com> Cc: freebsd-questions@freefall.cdrom.com Subject: Re: [1.1.5.1] PPP failure Message-ID: <Pine.SUN.3.91.950607125602.17810K-100000@lupine.nsi.nasa.gov> In-Reply-To: <199506070005.AA242433506@hp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I have a similar setup although it's a tad more complicated (we have subnets all over the place - I have a description on my home home page "http://www.newell.arlington.va.us" if you're interested.) The only problem I'm having is that the when the modems lose carrier the PPP daemon doesn't go away. I didn't have this problem with our Linux testbed nor do we have the problem on our Suns. If you have a way around that, I'd really like to know what it is... Anyway, I use the following script to start PPP: ---------- /etc/ppp/restartppp -------------- #!/bin/csh -v # # Runs the PPP daemon. In theory the PPP daemon should restart itself, # but it doesn't when using kermit as the dialer. I've yet to be able to get # chat to work reliably, so my dialscripts all use kermit. Unfortunately # pppd doesn't release the controlling terminal and sio won't allow kermit # to talk to the terminal unless it is released even though I did install # the patch to allow it. Anyway, this forces me to invoke this silly # script. # alias kermit /usr/local/bin/kermit alias pppd /usr/libexec/pppd setenv SCRLIB /etc/ppp setenv PPPDEV /dev/ttyd1 setenv PPPIDEV /dev/ttyid1 setenv SPEED 57600 # # If pppd is still running when this script is invoked, kill it off. # kill -9 `ps -ax | grep pppd | grep -v grep | awk '{ printf "%s",$1}'` sleep 5 route -n flush # # Dial using the kermit dialup script. clocal is used to keep the modem from # hanging up after Kermit exits. # stty -f ${PPPIDEV} clocal crtscts kermit -l ${PPPDEV} -b ${SPEED} -C "take ${SCRLIB}/mcpppdial" # # Run the ppp daemon # pppd debug ${PPPDEV} ${SPEED} ----------------------------------------------------------- (I know this is more complicated than it needs to be, but I wanted to make it easy to make changes... :-) Kermit is invoked using the following script: ------------------- /etc/ppp/mcpppdial -------------------- set flow rts set input timeout-action proceed set input case ignore set input echo on :reset echo "Resetting the modem..." hangup output +++ pause 2 output ATZ\13 input 10 OK if success goto restart-done echo "Cannot reset the modem" stop :restart-done echo "Modem has been reset." :setup output at&d0\13 input 45 OK :setup_done :dial set count 15 :dial-loop output atdtYOUR_PHONE_NUMBER_HERE\13 input 45 CONNECT if success goto dial-done if count goto dial-loop echo "Dialing failed; aborting." stop :dial-done echo "Dialing done; proceeding to login..." pause 1 set count 10 :get-username output \13 input 3 login: if success goto get-username-done if count goto get-username echo "?Can't seem to get a username prompt; restaring" goto reset :get-username-done pause 1 output YOUR_USERNAME_HERE\13 input 3 Password: if success goto got-password echo "?Can't seem to get password; restarting" goto reset :got-password output YOUR_PASSWORD_HERE\13 quit ------------------------------------------------------------- 'course it's been edited to hide specific information... :-) Note the "at&d0\13" which turns off DTR hangup on the modem - that way the modem won't hang up the line when Kermit exits. Finally the ppprc looks like: ------------- /etc/ppp/options ------------------------------ netmask 255.255.255.240 crtscts defaultroute ------------------------------------------------------------ The first line is needed to set the proper mask; the second sets up hardware flow control. The last forces install of a default route. Note that I don't specify any addressing - I let the server supply the link information. That way all I have to do to switch from my office server to my local Annex server is change phone number, username, and password. FYI, on my office server I have ------------ /etc/ppp/options --------------------------- crtscts # enable hardware flow control passive # establish passive link (wait for LCP) proxyarp # insert an ARP entry for the host ---------------------------------------------------------- and the .ppprc in the ppp dialup username is: ------------ ~YOUR_PPP_USERNAME/.ppprc ----------------- 198.116.75.17:198.116.75.65 -------------------------------------------------------- In your case you're dialing up to an Annex terminal server, so this file won't exist. Our Annex is configured to respond to PPP LCP requests so it will provide the IP addressing for you; yours probably is too? In that case you won't addressing in the options or .ppprc file either - the Annex will provide it for you. I also have information about the modem configurations on my work Web page; "http://www-dc.nsi.nasa.gov/~mnewell/mcnet.html". My home home page version will replace this version one of these days Real Soon Now. BTW, if I ever find out why the PPP daemon doesn't die I also created the following cron script that I run every 15 minutes to check and make sure the link is running: ------------- /etc/ppp/checkppp ------------------------- #!/bin/csh if ( "x`ps -ax | grep -v grep | grep -s pppd`" == "x" ) then echo "Restarting PPPD..." /etc/ppp/restartppp endif --------------------------------------------------------- This'll restart the PPP daemon if it dies off. Hopefully. :-) Thanks, Mike On Wed, 7 Jun 1995, M C Wong wrote: > Date: Wed, 7 Jun 95 10:05:05 EST > From: M C Wong <mcw@hpato.aus.hp.com> > To: freebsd-questions@freefall.cdrom.com > Subject: [1.1.5.1] PPP failure > > Hi, > I will appreciate if anyone who has succes with pppd on 1.1.5.1 > can give me some helps : > > I am (still) running 1.1.5.1 to dial-out to my ISP Annex-3, the > port has been set to ppp mode and the IP address for me is static, > since it is a permanent connection kind of thing. > > The following are the options (/etc/ppp/options) used for pppd : > > # /etc/ppp/options > crtscts # enable hardware flow control > modem # modem control line > passive # wait for LCP packets > domain mydomain # put your domain name here > > 204.14.44.34:204.14.44.14 # put the IP of remote PPP host here > # it will be used to route packets via PPP link > # if you didn't specified the noipdefault option > # change this line to <local_ip>:<remote_ip> > > defaultroute # put this if you want that PPP server will be your > # default router > debug > > The following are the steps I used to dial-up : > > 1) use kermit to dial-up ISP, and suspend it back to shell > 2) pppd /dev/cua00 57600 -detach . At this time I can see that the SD & RD > leds are flashing over every 5 seconds or more, and this went > on for quite a while before it stopped. > 3) I checked netstat -r, ifconfig ppp0, but default route has not > been set, neither is any parameter for ppp0 set. > 4) I check out /var/log/message, and saw the following : > > Jun 7 10:23:45 lespoir pppd[589]: pppd 2.0.4 started by root, uid 0 > Jun 7 10:23:45 lespoir pppd[589]: Connect: ppp0 <--> /dev/cua00 > Jun 7 10:23:45 lespoir pppd[589]: LCP: timeout sending Config-Requests > > I then send a few ^C to pppd, but that didn't kill it, I then tried > kill -INT 589, and neither did that, then tried kill -9 589, and that > did it. > 5) Then restarted pppd : pppd /dev/cua00 57600 -detach again, and got : > > Jun 7 10:25:45 lespoir pppd[589]: received bad Reject! > Jun 7 10:25:45 lespoir pppd[589]: plen 6 len 0 off 6 > . > . (basically, repeated logs of above 2 lines) > . > Jun 7 10:25:45 lespoir pppd[589]: pppd 2.0.4 started by root, uid 0 > Jun 7 10:25:45 lespoir pppd[589]: Connect: ppp0 <--> /dev/cua00 > Jun 7 10:25:45 lespoir pppd[589]: LCP: timeout sending Config-Requests > > I am very suspicious with my ISP Annex setup since I got similar LCP > time-out error when trying on another Linux box later, and especially he > mentioned something that they had never made ppp to work, 8-((. > Therefore, I will like to know if anyone has success with FreeBSD-1.1.5.1 > ppp and Annex please tell me : > > If the problem is with the Annex, what parameters must be set on it > to get it working properly with pppd. > > Thanks in advance. > Thanks, Mike +--------------------------------------+------------------------------------+ |Mike Newell | The opinions expressed herein are | |NASA Science Internet Network Systems | my own, and do not necessarily | |Sterling Software, Inc. | reflect those of the NSI program, | |MNewell@nsipo.nasa.gov | Sterling Software, NASA, or anyone | |+1-202-434-8954 | else. | +--------------------------------------+------------------------------------+ | work: http://www-dc.nsi.nasa.gov/~mnewell | | home: http://www.newell.arlington.va.us | +---------------------------------------------------------------------------+
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SUN.3.91.950607125602.17810K-100000>