Previous Contents

A Chat Script that gets you onto the wrong subnet.

As mentioned in the introduction, ANU users connecting via OzEmail can get onto either of two subnets. The script below is useful as a longer example of how chat works, but note that it will not get you onto the CARNO subnet. You have been warned!

The chat script used here is based on the method you will see described if you log into OzEmail using Minicom and select help. It is not suitable for ANU users.
The TIMEOUT lines in the following script are not in the expect - send format used in chat scripts. These tell chat to give up if the expected string is not received in the specified number of seconds. (This is an oversimplification. See subexpect-subsend strings in the chat man page).
The ABORT lines are not in the expect - send format either. ABORT is a chat keyword that aborts the script if the message on the right hand side is received.

Here is the ozemail-chat-wrong-subnet script:

TIMEOUT 5
'' ATZ
OK ATDT62578155
ABORT BUSY
ABORT ERROR
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT 'Invalid Login'
ABORT 'Login incorrect'
ABORT WAITING
TIMEOUT 45
CONNECT ''
vice? ppp
name: amcbeal
ord:  ca1op3x
~--   ''

The second line of the chat script has the empty expect string (two single quotes with nothing between them) followed by a space, followed by a command to reset your modem ...   '' ATZ. The modem should respond with OK whereupon you tell it to dial the number. If all goes well you receive a CONNECT string back from the modem. You respond with an empty string which causes the OzEmail server to ask you what service you require. Notice that the "expect" strings are vice?   name: and ord: rather than Service,   Username and password:. This allows for the possibility of the first couple of characters of the prompt from the remote system being missing or corrupted.
Note: the prompts from a service provider other than OzEmail may not be Service, Username and password.
If your ISP doesn't provide a suitable chat script you could try logging into their site using Minicom and looking at the prompts you receive.
The last expect string is ~-- a tilde since all PPP initialisations start with a tilde.


Here is the debugging log output for this script:
pppd[381]: pppd 2.3.5 started by root, uid 0
chat[383]: timeout set to 5 seconds
chat[383]: send (ATZ^M)
chat[383]: expect (OK)
chat[383]: ATZ^M^M
chat[383]: OK
chat[383]:  -- got it 
chat[383]: send (ATDT62578155^M)
chat[383]: abort on (BUSY)
chat[383]: abort on (ERROR)
chat[383]: abort on (NO CARRIER)
chat[383]: abort on (NO DIALTONE)
chat[383]: abort on (Invalid Login)
chat[383]: abort on (Login incorrect)
chat[383]: abort on (WAITING)
chat[383]: timeout set to 45 seconds
chat[383]: expect (CONNECT)
chat[383]: ^M
chat[383]: ATDT62578155^M^M
chat[383]: CONNECT
chat[383]:  -- got it 
chat[383]: send (^M)
chat[383]: expect (vice?)
chat[383]:  28800^M
chat[383]: ^M
chat[383]: Welcome to OzEmail (Type Help for more info).^M
chat[383]: Service?
chat[383]:  -- got it 
chat[383]: send (ppp^M)
chat[383]: expect (name:)
chat[383]:  ppp^M
chat[383]: ^[[2J^M
chat[383]: ^M
chat[383]: Establishing a PPP connection...^M
chat[383]: ^M
chat[383]: Please enter your OzEmail user information.^M
chat[383]: ^M
chat[383]: ^M
chat[383]: Username:
chat[383]:  -- got it 
chat[383]: send (amcbeal^M)
chat[383]: expect (ord:)
chat[383]:  amcbeal^M
chat[383]: Password:
chat[383]:  -- got it 
chat[383]: send (ca1op3x^M)
chat[383]: expect (~)
chat[383]:  ^M
chat[383]: Switching to PPP.^M
pppd[381]: Serial connection established.
chat[383]: ~
chat[383]:  -- got it 
chat[383]: send (^M)
pppd[381]: Using interface ppp0
pppd[381]: Connect: ppp0 <--> /dev/modem
pppd[381]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x5cc02684> <pcomp> <accomp>]
pppd[381]: rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x5cc02684> <pcomp> <accomp>]
pppd[381]: rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <magic 0x3919a337> <pcomp> <accomp>]
pppd[381]: sent [LCP ConfAck id=0x2 <asyncmap 0x0> <magic 0x3919a337> <pcomp> <accomp>]
pppd[381]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <compress VJ 0f 01>]
pppd[381]: rcvd [IPCP ConfReq id=0x3 <compress VJ 0f 01> <addr 203.108.192.14>]
pppd[381]: sent [IPCP ConfAck id=0x3 <compress VJ 0f 01> <addr 203.108.192.14>]
pppd[381]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <compress VJ 0f 01>]
pppd[381]: rcvd [IPCP ConfNak id=0x1 <addr 203.108.192.94>]
pppd[381]: sent [IPCP ConfReq id=0x2 <addr 203.108.192.94> <compress VJ 0f 01>]
pppd[381]: rcvd [IPCP ConfAck id=0x2 <addr 203.108.192.94> <compress VJ 0f 01>]
pppd[381]: local  IP address 203.108.192.94
pppd[381]: remote IP address 203.108.192.14

The interesting things to note here are that:
  1. Chat takes care of logging in with a username and password, and explicitly asks for the ppp service.
  2. There is no attempt to establish PAP - there are no PAP AuthReq or PAP AuthAck lines.

Previous Contents