Go to main content

Managing Serial Networks Using UUCP and PPP in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

Chat Script Examples

This section contains chat scripts that you can use as a reference for creating your own chat scripts. The modem manufacturer's guide and information from your ISP and other target hosts contain chat requirements for the modem and your target peers. In addition, numerous PPP web sites have sample chat scripts.

Basic Modem Chat Script

The following is a basic chat script that you can use as a template for creating your own chat scripts.

ABORT   BUSY
ABORT   'NO CARRIER'
REPORT  CONNECT
TIMEOUT 10
"" AT&F1M0&M5S2=255
SAY     "Calling myserver\n"
TIMEOUT 60
OK      "ATDT1-123-555-1212"
login: pppuser
password: \q\U
% pppd

    Where:

  • ABORT BUSY terminates transmission if the modem receives this message from the opposite peer.

  • ABORT 'NO CARRIER terminates transmission if the modem receives this message from the opposite peer. The cause for this message is usually a dialing or modem negotiation failure.

  • REPORT CONNECT gathers the CONNECT string from the modem. Print the string.

  • TIMEOUT 10 sets initial timeout to 10 seconds. The modem's response should be immediate.

  • "" AT&F1M0&M5S2=255 sends the following commands:

    M0 turns off the speaker during connect.

    &M5 makes the modem require error control.

    S2=255 disables the TIES "+++" break sequence.

  • SAY "Calling myserver\n" displays the message Calling myserver on the local system.

  • TIMEOUT 60 resets the timeout to 60 seconds to allow more time for link negotiation.

  • OK "ATDT1-123-555-1212" calls the remote peer by using the phone number 123-555-1212.

  • login: pppuser logs in to the peer by using a style of login used in UNIX systems. Supplies the user name pppuser.

  • password: \q\U indicates:

    \q – Do not log if debugging with the –v option.

    \U – Insert in this location the contents of the string that follows –U, which is specified on the command line. Usually, the string contains the password.

  • % pppd – Waits for the % shell prompt to run the pppd command.

/etc/ppp/myisp-chat.tmpl Chat Script Template

This release includes the /etc/ppp/myisp-chat.tmpl, which you can modify for use at your site. /etc/ppp/myisp-chat.tmpl is similar to the basic modem chat script except that the template does not include a login sequence.

ABORT   BUSY
ABORT   'NO CARRIER'
REPORT  CONNECT
TIMEOUT 10
""      "AT&F1"
OK      "AT&C1&D2"
SAY     "Calling myisp\n"
TIMEOUT 60
OK      "ATDT1-123-555-1212"
CONNECT \c

    Where:

  • ABORT BUSY terminates transmission if the modem receives this message from the opposite peer.

  • ABORT 'NO CARRIER terminates transmission if the modem receives this message from the opposite peer. The cause for this message is usually a dialing or modem negotiation failure.

  • REPORT CONNECT gathers the CONNECT string from the modem. Prints the string.

  • TIMEOUT 10 sets initial timeout to 10 seconds. The modem's response should be immediate.

  • "" "AT&F1" resets the modem to factory defaults.

  • OK "AT&C1&D2" resets the modem so that, for &C1, DCD from the modem follows carrier. If the remote side hangs up the phone for some reason, then the DCD drops.

    For &D2, DTR high-to-low transition causes the modem to go "on-hook" or hang up.

  • SAY "Calling myisp\n" displays the message "Calling myisp" on the local system.

  • TIMEOUT 60 resets the timeout to 60 seconds to allow more time for link negotiation.

  • OK "ATDT1-123-555-1212" calls the remote peer by using the phone number 123-555-1212.

  • CONNECT \c waits for the CONNECT message from the opposite peer's modem.

Modem Chat Script for Calling an ISP

Use the following chat script as a template for calling an ISP from a dial-out system with a U.S. Robotics Courier modem.

ABORT   BUSY
ABORT   'NO CARRIER'
REPORT  CONNECT
TIMEOUT 10
"" AT&F1M0&M5S2=255
SAY     "Calling myisp\n"
TIMEOUT 60
OK      "ATDT1-123-555-1212"
CONNECT \c
\r \d\c
SAY "Connected; running PPP\n"

    Where:

  • ABORT BUSY terminates transmission if the modem receives this message from the opposite peer.

  • ABORT 'NO CARRIER terminates transmission if the modem receives this message from the opposite peer. The cause for this message is usually a dialing or modem negotiation failure.

  • REPORT CONNECT gathers the CONNECT string from the modem. Prints the string.

  • TIMEOUT 10 sets initial timeout to 10 seconds. The modem's response should be immediate.

  • "" AT&F1M0M0M0M0&M5S2=255 indicates:

    M0 – Turn off the speaker during connect.

    &M5 – Make the modem require error control.

    S2=255 – Disable the TIES "+++" break sequence.

  • SAY "Calling myisp\n" displays the message "Calling myisp" on the local system.

  • TIMEOUT 60 resets the timeout to 60 seconds to allow more time for link negotiation.

  • OK "ATDT1-123-555-1212" calls the remote peer by using the phone number 123-555-1212.

  • CONNECT \c waits for the CONNECT message from the opposite peer's modem.

  • \r \d\c waits until the end of the CONNECT message.

  • SAY "Connected; running PPP\n" displays the informative message Connected; running PPP on the local system.

Basic Chat Script Enhanced for a UNIX Login Style

The following chat script is a basic script that is enhanced for calling a remote Oracle Solaris peer or other UNIX peer. This chat script is used in How to Create the Instructions for Calling a Peer.

        SAY "Calling the peer\n"
        TIMEOUT 10
        ABORT BUSY
        ABORT 'NO CARRIER'
        ABORT ERROR
        REPORT CONNECT
        "" AT&F1&M5S2=255
        TIMEOUT 60
        OK ATDT1-123-555-1234
        CONNECT \c
        SAY "Connected; logging in.\n"
        TIMEOUT 5
        login:--ogin: pppuser
        TIMEOUT 20
        ABORT 'login incorrect'
        password: \qmypassword
        "% " \c
        SAY "Logged in.  Starting PPP on peer system.\n" 
        ABORT 'not found'
        "" "exec pppd"
        ~ \c

    Where:

  • TIMEOUT 10 sets initial timeout to 10 seconds. The modem's response should be immediate.

  • ABORT BUSY terminates transmission if the modem receives this message from the opposite peer.

  • ABORT 'NO CARRIER terminates transmission if the modem receives this message from the opposite peer. The cause for this message is usually a dialing or modem negotiation failure.

  • ABORT ERROR terminates transmission if the modem receives this message from the opposite peer.

  • REPORT CONNECT gathers the CONNECT string from the modem. Prints the string.

  • "" AT&F1&M5S2=255 indicates:

    &M5 – Make the modem require error control.

    S2=255 – Disable the TIES "+++" break sequence.

  • TIMEOUT 60 resets the timeout to 60 seconds to allow more time for link negotiation.

  • OK "ATDT1-123-555-1212" calls the remote peer by using the phone number 123-555-1212.

  • CONNECT \c waits for the CONNECT message from the opposite peer's modem.

  • SAY "Connected; logging in.\n" displays the informative message Connected; logging in to give the user status.

  • TIMEOUT 5 changes the timeout to enable quick display of the login prompt.

  • login:--login: pppuser waits for the login prompt. If the prompt is not received, sends a RETURN and waits. Then, sends the user name pppuser to the peer. The sequence that follows is referred to by most ISPs as the PAP login. However, the PAP login is not related in any way to PAP authentication.

  • TIMEOUT 20 changes the timeout to 20 seconds to allow for slow password verification.

  • password: \qmysecrethere waits for the password prompt from the peer. When the prompt is received, sends the password \qmysecrethere. The \q prevents the password from being written to the system log files.

  • "% " \c waits for a shell prompt from the peer. The chat script uses the C shell. Change this value if the user prefers to log in with a different shell.

  • SAY "Logged in. Starting PPP on peer system.\n" displays the informative message Logged in. Starting PPP on peer system to give the user status.

  • ABORT 'not found' terminates the transmission if the shell encounters errors.

  • "" "exec pppd" starts pppd on the peer.

  • ~ \c waits for PPP to start on the peer.

The phrase login:--login: pppuser instructs the modem to send the user name pppuser in response to the login prompt from the dial-in server. pppuser is a special PPP user account name that was created for remote user1 on the dial-in server. For instructions about creating PPP user accounts on a dial-in server, refer to How to Configure Users of the Dial-In Server.

Chat Script for External ISDN TA

The following chat script is for calling from a dial-out system with a ZyXEL omni.net. ISDN TA.

        SAY "Calling the peer\n"
        TIMEOUT 10
        ABORT BUSY
        ABORT 'NO CARRIER'
        ABORT ERROR
        REPORT CONNECT
        "" AT&FB40S83.7=1&K44&J3X7S61.3=1S0=0S2=255
        OK ATDI18882638234
        CONNECT \c
        \r \d\c
        SAY "Connected; running PPP\n"

    Where:

  • SAY "Calling the peer" displays this message on the screen of the dial-out system.

  • TIMEOUT 10 sets initial timeout to 10 seconds. The modem's response should be immediate.

  • ABORT BUSY terminates transmission if the modem receives this message from the opposite peer.

  • ABORT 'NO CARRIER terminates transmission if the modem receives this message from the opposite peer. The cause for this message is usually a dialing or modem negotiation failure.

  • ABORT ERROR terminates transmission if the modem receives this message from the opposite peer.

  • REPORT CONNECT gathers the CONNECT string from the modem. Prints the string.

  • "" AT&FB40S83.7=1&K44&J3X7S61.3=1S0=0S2=255 indicates:

    • &F – Use factory default

    • B40 – Do asynchronous PPP conversion

    • S83.7=1 – Use data over speech bearer

    • &K44 – Enable CCP compression

    • &J3 – Enable MP

    • X7 – Report DCE side rates

    • S61.3=1 – Use packet fragmentation

    • S0=0 – No auto answer

    • S2=255 – Disable TIES escape

  • OK ATDI18882638234 makes an ISDN call. For multilink, the second call is placed to the same telephone number, which is normally what is required by most ISPs. If the remote peer requires a different second phone number, append "+nnnn". nnnn represents the second phone number.

  • CONNECT \c waits for the CONNECT message from the opposite peer's modem.

  • \r \d\c waits until the end of the CONNECT message.

  • SAY "Connected; running PPP\n" displays this message on the screen of the dial-out system.

Refer to the chat(8) man page for descriptions of options and other detailed information about the chat script. For an explanation of expect-send strings, refer to Chat-Script Field in /etc/uucp/Systems File.