From owner-freebsd-questions Wed Jul 15 12:24:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA05752 for freebsd-questions-outgoing; Wed, 15 Jul 1998 12:24:01 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA05729 for ; Wed, 15 Jul 1998 12:23:59 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id MAA15388; Wed, 15 Jul 1998 12:23:22 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma015386; Wed Jul 15 12:22:59 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id MAA23642; Wed, 15 Jul 1998 12:22:58 -0700 (PDT) From: Archie Cobbs Message-Id: <199807151922.MAA23642@bubba.whistle.com> Subject: Re: multilink ppp In-Reply-To: from Carey Nairn at "Jul 16, 98 00:23:03 am" To: cpn@dpac.tas.gov.au (Carey Nairn) Date: Wed, 15 Jul 1998 12:22:58 -0700 (PDT) Cc: questions@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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