From owner-freebsd-questions Wed Jul 15 21:41:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA11804 for freebsd-questions-outgoing; Wed, 15 Jul 1998 21:41:23 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from healy.dpac.tas.gov.au ([147.109.254.18]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA11565 for ; Wed, 15 Jul 1998 21:39:12 -0700 (PDT) (envelope-from C.Nairn@dpac.tas.gov.au) Received: from pc0123 (pc0123.dpac.tas.gov.au [147.109.150.123]) by healy.dpac.tas.gov.au (8.8.7/DPACV8) with SMTP id OAA11031; Thu, 16 Jul 1998 14:37:15 +1000 (EST) Message-Id: <199807160437.OAA11031@healy.dpac.tas.gov.au> X-Sender: cpn@mailroom.dpac.tas.gov.au X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0 Date: Thu, 16 Jul 1998 14:38:31 +1000 To: Archie Cobbs , cpn@dpac.tas.gov.au (Carey Nairn) From: Carey Nairn Subject: Re: multilink ppp Cc: questions@FreeBSD.ORG In-Reply-To: <199807151922.MAA23642@bubba.whistle.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thanks, I'll give it a go tonight. At 12:22 15/07/98 -0700, Archie Cobbs wrote: >Carey Nairn writes: >> I am having some headaches trying to set up mpd-1.0b4 from the ports. The >> software install went fine but I am now trying to get the configs right >> to enable dialup to the ISP. >> >> The dialup is as follows: >> >> - dynamic IP addresses (I can't find the mpd equivalent of ppp.linkup >> where I would normally have something like >> >> delete ALL >> add 0 0 HISADDR > >With mpd, you would do this like so: > > set iface addrs 1.2.3.4 5.6.7.8 > set ipcp ranges 0.0.0.0/0 5.6.7.8/0 > >That is, you have to set initial values, even if they are made up >(which is OK). Once connected, the server will assign the correct >addresses and mpd will renumber the interface. > >> - standard username/password login so I need a standard expect/send chat >> script. > >You can do this pretty easily using the mpd chat language.. >here is an example of an "auto login" algorithm that Whistle uses: > >## >## AutoLogin >## >## Here we attempt to figure out what the remote server wants >## from us. We do this by checking for bytes that correspond >## to PPP packets (in which case we are done) as well as common >## login type stuff like "name:", "ogin:", etc. >## >## This always returns. The hope is that when it returns, the >## remote side has reached PPP mode. >## >## This has been crafted from empirical evidence. Lots of terminal >## servers have various intelligent/stupid features which we >## take advantage of/have to work around. >## >## Variables (set automatically by mpd): >## >## $Login Authorization login >## $Password Authorization password >## > >AutoLogin: > log "Auto-login..." > ># Spend at most this long doing auto-login before giving up > > timer autoLogin 5 AutoLoginTimeout > ># At any time if we an LCP frame (not our own echo) then we're done > > match autoLogin "\x7e\xff\x03\xc0\x21" AutoLoginFrame > match autoLogin "\x7e\xff\x7d\x23\xc0\x21\x7d\x21" AutoLoginFrame > match autoLogin "\x7e\xc0\x21" AutoLoginFrame > ># Now send a "fake" PPP frame (this is an empty config-reject with id# 172). ># This should trigger any auto-detecting servers to jump into PPP mode, ># which is good because it's faster (by avoiding human readable messages) ># and more reliable (PPP framing). > > print "\x7e\xff\x7d\x23\xc0\x21\x7d\x24\xac\x7d\x20\x7d\x24\x2e\x2b\x7e" > ># Wait one second for server to auto-detect PPP or send a login prompt. ># After one second of neither, try sending a carriage return (some servers ># require this). After that, we have to see something recognizable from ># the peer, otherwise we'll just timeout. > > match "ogin" AutoLoginPrompt > match "name" AutoLoginPrompt > wait 1 > print "\r" > match "ogin" AutoLoginPrompt > match "name" AutoLoginPrompt > wait > ># At this point we've seen a login prompt; do the manual login > >AutoLoginPrompt: > log "Sending login..." > print "${Login}\r" > match "word" > wait > log "Sending password..." > print "${Password}\r" > match "\r" > wait > if $didLogin != "yes" match "ogin:" LoginAgain > match ">" > match "%" > match ":" > wait > log "Sending ppp comand..." > print "ppp\r" > cancel all > return > >LoginAgain: > set $didLogin "yes" > goto AutoLoginPrompt > ># We saw a PPP frame > >AutoLoginFrame: > log "Detected PPP frame." > cancel all > return > ># We timed out before seeing a PPP frame > >AutoLoginTimeout: > log "Auto-login timed out." > cancel all > return > >-Archie > >___________________________________________________________________________ >Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message > Carey Nairn Mailto:C.Nairn@dpac.tas.gov.au Information Systems Branch Phone: (03) 6233 3077 Dept of Premier & Cabinet Fax: (03) 6224 3174 GPO Box 123b Hobart, Tasmania 7001 AUSTRALIA _________________________________________________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message