Table Of Contents
Configuring Modems and Chat Scripts
Configuring the Modems and Lines
Verifying the Modem Configuration
Testing the Dial-In Connection
Setting Up Advanced Modem Features
Signal and Flow Control Overview
Signal and Line State Diagrams
Automatically Answering a Modem
Supporting Dial-In and Dial-Out Connections
Configuring a Line Timeout Interval
Configuring a Line to Automatically Disconnect
Supporting Old-Style Dial-In Modems
Supporting Reverse Modem Connections and Preventing Incoming Calls
Configuring Support for Async BOOTP Requests
Configuring Dual-Purpose Ports
Using Advanced Addressing Methods for Remote Devices
Assigning a Default Asynchronous Address
Allowing an Asynchronous Address to Be Assigned Dynamically
Configuring Dedicated or Interactive PPP and SLIP Sessions
Enabling Routing on Asynchronous Interfaces
Establishing and Controlling the EXEC Process
Configuring the Auxiliary (AUX) Port
Defining a Command String for Automatic Execution
Specifying Decimal TCP Port Numbers When Connecting to Lines
Optimizing Available Bandwidth
Configuring Header Compression
Forcing Header Compression at the EXEC Level
Monitoring and Maintaining Connections
AT Mode Example for Integrated Modems
Establishing a Direct Telnet Session to an External Modem
Suspending and Terminating Telnet Sessions
Automatically Configuring an External Modem
Manually Configuring an External Modem
Chat Script Configuration Task List
Understanding Chat Script Naming Conventions
Configuring the Line to Activate Chat Scripts
Starting a Chat Script Manually on an Asynchronous Line
Writing and Implementing Chat Scripts
Chat Scripts and Dialer Mapping
System Login Scripts and Modem Scripts Example
Configuring Modems and Chat Scripts
This chapter describes how to configure a modem and set up advanced asynchronous features, such as asynchronous dynamic routing and chat scripts. These tasks are presented in the following main sections:
•
Modem Configuration Task List
•
Setting Up Advanced Modem Features
•
Monitoring and Maintaining Connections
•
Checking Other Modem Settings
•
AT Mode Example for Integrated Modems
•
Chat Script Configuration Task List
For a complete description of the modem support commands in this chapter, see the Cisco IOS Dial Services Command Reference publication. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online.
Modem Configuration Task List
Perform the following tasks to configure modem support for high-end access servers, such as the Cisco AS5800, AS5300, and AS5200. The first task is required; the second task is optional but recommended.
•
Configuring the Modems and Lines (Required)
•
Verifying the Modem Configuration (Optional but Recommended)
Configuring the Modems and Lines
You must configure the modem lines and set the country code to enable asynchronous connections into your access server.
To configure the modems and line, use the following commands beginning in global configuration mode:
Command PurposeStep 1
modem country mica country
or
modem country microcom_hdms country
Depending on the type of modems loaded in your access server, specifies the modem vendor and country code.1 This step is only for high-end access servers, such as the Cisco AS5300.
Step 2
line line-number ending-line-number
Enters the number of modem lines to configure. Usually this range is equal to the number of modems in the access server.2
Step 3
transport {input | output} all
Allows all protocols to be used when connecting to the line. For outgoing calls, choose the output option. For incoming calls, use input.
Step 4
autoselect {arap | ppp | slip}
Configures the line to automatically startup an AppleTalk Remote Access (ARA), Point-to-Point Protocol (PPP), or Serial Line Internet Protocol (SLIP) session.
Step 5
autoselect during login
Configures the lines to autodetect the connection-oriented protocol and display the username:password prompt upon login.
Step 6
login authentication dialin
Enables authentication across all asynchronous modem logins.
Step 7
modem dialin
Enables incoming calls.3
Step 8
exit
Returns to global configuration mode.
.1 For a comprehensive list of modem country codes, see the modem country mica command and the modem country microcom_hdms command in the Cisco IOS Dial Services Command Reference publication. For lower-end access servers, use the modem autoconfigure discovery command.
.2 If you create more than one group of asynchronous interfaces, then assign different ranges of modems to each group interface. One modem cannot be used in more than one group asynchronous statement.
.3 To enable incoming and outgoing calls, enter the modem inout command instead.
Verifying the Modem Configuration
To verify your modem configuration, enter the show line command to display a summary for all the lines:
NAS# show lineTty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns* 0 CTY - - - - - 0 0 0/0I 1 TTY 115200/115200 - inout - - - 0 0 0/0I 2 TTY 115200/115200 - inout - - - 0 0 0/03 TTY 115200/115200 - inout - - - 0 0 0/04 TTY 115200/115200 - inout - - - 0 0 0/05 TTY 115200/115200 - inout - - - 0 0 0/06 TTY 115200/115200 - inout - - - 0 0 0/07 TTY 115200/115200 - inout - - - 0 0 0/08 TTY 115200/115200 - inout - - - 0 0 0/09 TTY 115200/115200 - inout - - - 0 0 0/010 TTY 115200/115200 - inout - - - 0 0 0/0...90 VTY - - - - - 0 0 0/0NAS# show line 1Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise OverrunsI 1 TTY 115200/115200 - inout - - - 0 0 0/0Line 1, Location: "", Type: ""Length: 24 lines, Width: 80 columnsBaud rate (TX/RX) is 115200/115200, no parity, 1 stopbits, 8 databitsStatus: noneCapabilities: Hardware Flowcontrol In, Hardware Flowcontrol OutModem Callout, Modem RI is CD, Line usable as async interfaceModem state: IdleSpecial Chars: Escape Hold Stop Start Disconnect Activation^^x none - - noneTimeouts: Idle EXEC Idle Session Modem Answer Session Dispatch00:10:00 never none not setIdle Session Disconnect WarningneverModem type is unknown.Session limit is not set.Time since activation: neverEditing is enabled.History is enabled, history size is 10.DNS resolution in show commands is enabledFull user help is disabledAllowed transports are pad telnet rlogin. Preferred is telnet.No output characters are paddedNo special data dispatching charactersmodem(slot/port)=1/0, csm_state(0x00000100)=CSM_IDLE_STATE, bchan_num=-1modem_status(0x0000): VDEV_STATUS_UNLOCKEDModem hardware state: CTS noDSR DTR RTSDepending upon the problems you experience, take the appropriate action:
•
If you are having problems with making or receiving calls, make sure you turned on the protocols for connecting to the lines and configured for incoming and outgoing calls.
•
If the calls are not coming up at all, turn on the debug modem, debug modem csm, and debug isdn q931 commands to check for problems. When you finish viewing the messages, turn off the messages by entering the no debug modem command.
NAS# debug modemNAS# debug modem csmNAS# debug isdn q931NAS# no debug modemNAS# no debug modem csmNAS# no debug isdn q931•
Enter the debug modem ? command for a list of additional modem debugging commands:
NAS# debug modem ?b2b Modem Special B2Bcsm CSM activitymaintenance Modem maintenance activitymica MICA Async driver debuggingoob Modem out of band activitytdm B2B Modem/PRI TDMtrace Call Trace UploadTesting the Dial-In Connection
You need to test the dial-in connection when the access server and modem are configured correctly for dial-in access, before configuring any additional protocols for the line such as SLIP, PPP, or ARA.
Note
The same configuration issues exist between the client DTE and client modem. Make sure you have the correct EIA/TIA-232 cabling and modem initialization string for your client modem.
The following is an example of a successful connection from a PC using a US Robotics Courier modem to dial in to a Cisco 2500 series access server:
at&f&c1&d3&h1&r2&b1&m4&k1&wOKatdt9,5551234CONNECT 14400/ARQ/V32/LAPM/V42BISUser Access VerificationUsername: janedoePassword:router>Setting Up Advanced Modem Features
The following sections describe configuring modem line characteristics and modem features and tasks. Perform the configuration tasks, as required, for your particular modem and network.
•
Signal and Flow Control Overview
•
Signal and Line State Diagrams
•
Configuring Automatic Dialing (As Required)
•
Automatically Answering a Modem (As Required)
•
Supporting Dial-In and Dial-Out Connections (As Required)
•
Configuring a Line Timeout Interval (As Required)
•
Closing Modem Connections (As Required)
•
Configuring a Line to Automatically Disconnect (As Required)
•
Supporting Old-Style Dial-In Modems (As Required)
•
Supporting Reverse Modem Connections and Preventing Incoming Calls (As Required)
•
Configuring Support for Async BOOTP Requests (As Required)
•
Configuring Dual-Purpose Ports (As Required)
•
Conserving Network Addresses (As Required)
•
Using Advanced Addressing Methods for Remote Devices (As Required)
•
Configuring Dedicated or Interactive PPP and SLIP Sessions (As Required)
•
Enabling Routing on Asynchronous Interfaces (As Required)
•
Establishing and Controlling the EXEC Process (As Required)
•
Configuring the Auxiliary (AUX) Port (As Required)
•
Configuring Autoselect (As Required)
•
Defining a Command String for Automatic Execution (As Required)
•
Configuring Rotary Groups (As Required)
•
Specifying Decimal TCP Port Numbers When Connecting to Lines (As Required)
•
Optimizing Available Bandwidth (As Required)
Signal and Flow Control Overview
The EIA/TIA-232 output signals are Transmit Data (TXDATA), Data Terminal Ready (DTR), and Ready To Send (RTS—Cisco 2500 routers only). The input signals are Receive Data (RXDATA), Clear to Send (CTS), and RING. The sixth signal is ground. Depending on the type of modem control your modem uses, these names may or may not correspond to the standard EIA/TIA-232 signals.
Dialup modems that operate over normal telephone lines at speeds of 28800 bps use hardware flow control to stop the data from reaching the host by toggling an EIA/TIA-232 signal when their limit is reached.
In addition to hardware flow control, modems require special software configuring. For example, they must be configured to create an EXEC session when a user dials in and to hang up when the user exits the EXEC. These modems also must be configured to close any existing network connections if the telephone line hangs up in the middle of a session.
The Cisco IOS software supports hardware flow control on its CTS input signal, which is also used by the normal modem handshake.
Signal and Line State Diagrams
Signal and line state diagrams accompany some of the tasks in the following sections to illustrate how the modem control works. The diagrams show two processes:
•
The "create daemon" process creates a TTY daemon that handles the incoming network connection.
•
The "create EXEC" process creates the process that interprets user commands. (Refer to Figure 17 through Figure 22.)
In the diagrams, the current signal state and the signal the line is watching are listed inside each box. The state of the line (as displayed by the show line EXEC command) is listed next to the box. Events that change that state appear in italics along the event path, and actions that the software performs are described within ovals.
Figure 17 illustrates line states when no modem control is set. The DTR output is always high, and CTS and RING are completely ignored. The Cisco IOS software starts an EXEC session when the user types the activation character. Incoming TCP connections occur instantly if the line is not in use and can be closed only by the remote host.
Figure 17 EXEC and Daemon Creation on a Line with No Modem Control
Configuring Automatic Dialing
With the dialup capability, you can set a modem to dial the phone number of a remote router automatically. This feature offers cost savings because phone line connections are made only when they are needed—you only pay for using the phone line when there is data to be received or sent. To configure a line for automatic dialing, use the following command in line configuration mode:
Using the modem dtr-active command causes a line to raise DTR signal only when there is an outgoing connection (such as reverse Telnet, NetWare Asynchronous Support Interface (NASI), or DDR), rather than leave DTR raised all the time. When raised, DTR potentially tells the modem that the router is ready to accept a call.
Automatically Answering a Modem
You can configure a line to answer a modem automatically. You also can configure the modem to answer the telephone on its own (as long as DTR is high), drop connections when DTR is low, and use its Carrier Detect (CD) signal to accurately reflect the presence of carrier. (Configuring the modem is a modem-dependent process.) First, wire the modem CD signal (generally pin-8) to the router RING input (pin-22), then use the following command in line configuration mode:
You can turn on modem hardware flow control independently to respond to the status of router CTS input. Wire CTS to whatever signal the modem uses for hardware flow control. If the modem expects to control hardware flow in both directions, you might also need to wire modem flow control input to some other signal that the router always has high, such as the DTR signal.
Figure 18 illustrates the modem dialin process with a high-speed dialup modem. When the Cisco IOS software detects a signal on the RING input of an idle line, it starts an EXEC or autobaud process on that line. If the RING signal disappears on an active line, the Cisco IOS software closes any open network connections and terminates the EXEC facility. If the user exits the EXEC or the software terminates because of no user input, the line makes the modem hang up by lowering the DTR signal for 5 seconds. After 5 seconds, the modem is ready to accept another call.
Figure 18 EXEC Creation on a Line Configured for a High-Speed Modem
Supporting Dial-In and Dial-Out Connections
To configure a line for both incoming and outgoing calls, use the following command in line configuration mode:
Figure 19 illustrates the modem inout command. If the line is activated by raising the data set ready (DSR) signal, it functions exactly as a line configured with the modem dialin line configuration command described in the section "Automatically Answering a Modem" earlier in this chapter. If the line is activated by an incoming TCP connection, the line functions similarly to lines not used with modems.
Figure 19 EXEC and Daemon Creation for Incoming and Outgoing Calls
Note
If your system incorporates dial-out modems, consider using access lists to prevent unauthorized use.
Configuring a Line Timeout Interval
To change the interval that the Cisco IOS software waits for the CTS signal after raising the DTR signal in response to the DSR (the default is 15 seconds), use the following command in line configuration mode. The timeout applies to the modem callin command only.
Note
The DSR signal is called RING on older ASM-style chassis.
Closing Modem Connections
To configure a line to close connections from a user's terminal when the terminal is turned off and prevent inbound connections to devices that are out of service, use the following command in line configuration mode:
Figure 20 illustrates the modem cts-required command operating in the context of a continuous CTS signal. This form of modem control requires that the CTS signal be high for the entire session. If CTS is not high, the user input is ignored and incoming connections are refused (or sent to the next line in a rotary group).
Note
For the Cisco IOS software to reliably detect a CTS signal change, the CTS signal must remain in the new state for at least one full second.
Figure 20 EXEC and Daemon Creation on a Line Configured for Continuous CTS
Configuring a Line to Automatically Disconnect
To configure automatic line disconnect, use the following command in line configuration mode:
The autohangup command causes the EXEC facility to issue the exit command when the last connection closes. This feature is useful for UNIX-to-UNIX copy program (UUCP) applications because UUCP scripts cannot issue a command to hang up the telephone. This feature is not often used.
Supporting Old-Style Dial-In Modems
The Cisco IOS software supports dial-in modems that use DTR to control the off-hook status of the telephone line. This feature is supported primarily on old-style modems, especially those in Europe. To configure the line to support this feature, use the following command in line configuration mode:
Figure 21 illustrates the modem callin command. When a modem dialing line is idle, it has its DTR signal at a low state and waits for a transition to occur on the DSR (RING) input. This transition causes the line to raise the DTR signal and start watching the CTS signal from the modem. After the modem raises CTS, the Cisco IOS software creates an EXEC session on the line. If the timeout interval (set with the modem answer-timeout command) passes before the modem raises the CTS signal, the line lowers the DTR signal and returns to the idle state.
Figure 21 EXEC Creation on a Line Configured for Modem Dial-In
Note
The modem callin and modem cts-required line configuration commands are useful for SLIP operation. These commands ensure that when the line is hung up or the CTS signal drops, the line reverts from SLIP mode to normal interactive mode. These commands do not work if you put the line in network mode permanently.
Although you can use the modem callin line configuration command with newer modems, the modem dialin line configuration command described in this section is more appropriate. The modem dialin command frees up CTS input for hardware flow control. Modern modems do not require the assertion of DTR to answer a phone line (that is, to take the line off-hook).
Supporting Reverse Modem Connections and Preventing Incoming Calls
In addition to initiating connections, the Cisco IOS software can receive incoming connections. This capability allows you to attach serial and parallel printers, modems, and other shared peripherals to the router or access server and drive them remotely from other modem-connected systems. The Cisco IOS software supports reverse TCP, XRemote, and local-area transport (LAT) connections.
The specific TCP port or socket to which you attach the device determines the type of service that the Cisco IOS software provides on a line. When you attach the serial lines of a computer system or a data terminal switch to the serial lines of the access server, the access server can act as a network front-end device for a host that does not support the TCP/IP protocols. This arrangement is sometimes called front-ending, or reverse connection mode.
The Cisco IOS software supports ports connected to computers that are connected to modems. To configure the Cisco IOS software to function somewhat like a modem, use the following command in line configuration mode. This command also prevents incoming calls.
Command Purposemodem callout
Configures a line for reverse connections and prevents incoming calls.
Figure 22 illustrates the modem callout process. When the Cisco IOS software receives an incoming connection, it raises the DTR signal and waits to see if the CTS signal is raised to indicate that the host has noticed the router DTR signal. If the host does not respond within the interval set by the modem answer-timeout line configuration command, the software lowers the DTR signal and drops the connection.
Figure 22 Daemon Creation on a Line Configured for Modem Dial-Out
Configuring Support for Async BOOTP Requests
To configure Cisco IOS software to respond to BOOTP requests from client machines, use the following command in global configuration mode:
Command Purposeasync-bootp tag [:hostname] data
Specifies the router network information that is sent in response to BOOTP requests.
Configuring Dual-Purpose Ports
To specify the mode of a low-speed serial interface as either synchronous or asynchronous, use the following command in interface configuration mode:
Command Purposephysical-layer {sync | async}
Specifies the mode of a low-speed interface as either synchronous or asynchronous.
This command applies only to low-speed serial interfaces available on Cisco 2520 through Cisco 2523 routers.
In synchronous mode, low-speed serial interfaces support all interface configuration commands available for high-speed serial interfaces, except the following two commands:
•
sdlc cts-delay
•
sdlc rts-timeout
When placed in asynchronous mode, low-speed serial interfaces support all commands available for standard asynchronous interfaces. The default is synchronous mode.
Note that when you enter this command, it does not appear in the output of the more system:running-config and more nvram:startup-config commands, because the command is a physical-layer command.
Conserving Network Addresses
When asynchronous routing is enabled, you might need to conserve network addresses by configuring the asynchronous interfaces as unnumbered. An unnumbered interface does not have an address. Network resources are therefore conserved because fewer network numbers are used and routing tables are smaller.
To configure an unnumbered interface, use the following command in interface configuration mode:
Command Purposeip unnumbered type number
Conserves IP addresses by configuring the asynchronous interfaces as unnumbered, and assigns the IP address of the interface type that you want to leverage.
Whenever the unnumbered interface generates a packet (for example, a routing update), it uses the address of the specified interface as the source address of the IP packet. It also uses the address of the specified interface to determine which routing processes are sending updates over the unnumbered interface.
You can use the IP unnumbered feature even if the system on the other end of the asynchronous link does not support it. The IP unnumbered feature is transparent to the other end of the link because each system bases its routing activities on information in the routing updates it receives and on its own interface address.
Using Advanced Addressing Methods for Remote Devices
You can control whether addressing is dynamic (the user specifies the address at the EXEC level when making the connection) or whether default addressing is used (the address is forced by the system). If you specify dynamic addressing, the router must be in interactive mode and the user will enter the address at the EXEC level.
It is common to configure an asynchronous interface to have a default address and to allow dynamic addressing. With this configuration, the choice between the default address or a dynamic addressing is made by the users when they enter the slip or ppp EXEC command. If the user enters an address, it is used, and if the user enters the default keyword, the default address is used.
This section describes the following optional tasks:
•
Assigning a Default Asynchronous Address
•
Allowing an Asynchronous Address to Be Assigned Dynamically
Assigning a Default Asynchronous Address
To assign a permanent default asynchronous address, use the following command in interface configuration mode:
Command Purposepeer default ip address ip-address
Assigns a default IP address to an asynchronous interface.
Use the no form of this command to disable the default address. If the server has been configured to authenticate asynchronous connections, you are prompted for a password after you enter the slip default or ppp default EXEC command before the line is placed into asynchronous mode.
The assigned default address is implemented when the user enters the slip default or ppp default EXEC command. The transaction is validated by the TACACS server, when enabled, and the line is put into network mode using the address that is in the configuration file.
Configuring a default address is useful when the user is not required to know the IP address to gain access to a system (for example, users of a server that is available to many students on a campus). Instead of each user being required to know an IP address, they only need to enter the slip default or ppp default EXEC command and let the server select the address to use. See the section "Making Additional Remote Node Connections" in the chapter "Configuring Asynchronous SLIP and PPP" in this publication for more information about the slip and ppp EXEC commands.
Allowing an Asynchronous Address to Be Assigned Dynamically
When a line is configured for dynamic assignment of asynchronous addresses, the user enters the slip or ppp EXEC command and is prompted for an address or logical host name. The address is validated by TACACS, when enabled, and the line is assigned the given address and put into asynchronous mode. Assigning asynchronous addresses dynamically is also useful when you want to assign set addresses to users. For example, an application on a personal computer that automatically dials in using SLIP and polls for electronic mail messages can be set up to dial in periodically and enter the required IP address and password.
To assign asynchronous addresses dynamically, use the following command in interface configuration mode:
Command Purposeasync dynamic address
Allows the IP address to be assigned when the protocol is initiated.
The dynamic addressing features of the internetwork allow packets to get to their destination and back regardless of the access server, router, or network they are sent from. For example, if a host such as a laptop computer moves from place to place, it can keep the same address no matter where it is dialing in from.
Logical host names are first converted to uppercase and then sent to the TACACS server for authentication.
Configuring Dedicated or Interactive PPP and SLIP Sessions
You can configure one or more asynchronous interfaces on your access server (and one on a router) to be in dedicated network interface mode. In dedicated mode, an interface is automatically configured for SLIP or PPP connections. There is no user prompt or EXEC level, and no end-user commands are required to initiate remote-node connections. If you want a line to be used only for SLIP or PPP connections, configure the line for dedicated mode.
In interactive mode, a line can be used to make any type of connection, depending on the EXEC command entered by the user. For example, depending on its configuration, the line could be used for Telnet or XRemote connections, or SLIP or PPP encapsulation. The user is prompted for an EXEC command before a connection is initiated.
You can configure an asynchronous interface to be in dedicated network mode. When the interface is configured for dedicated mode, the end user cannot change the encapsulation method, address, or other parameters.
To configure an interface for dedicated network mode or return it to interactive mode, use one of the following commands in interface configuration mode:
Command Purposeasync mode dedicated
Places the line into dedicated asynchronous network mode.
async mode interactive
Returns the line to interactive mode.
By default, no asynchronous mode is configured. In this state, the line is not available for inbound networking because the SLIP and PPP connections are disabled.
Enabling Routing on Asynchronous Interfaces
To route IP packets on an asynchronous interface, use one of the following commands in interface configuration mode:
This async dynamic routing command routes IP packets on an asynchronous interface, which permits you to enable the Interior Gateway Routing Protocol (IGRP), Routing Information Protocol (RIP), and Open Shortest Path First (OSPF) routing protocols for use when the user makes a connection using the ppp or slip EXEC commands. The user must, however, specify the /routing keyword at the SLIP or PPP command line.
For asynchronous interfaces in interactive mode, the async default routing command causes the ppp and slip EXEC commands to be interpreted as though the /route switch had been included in the command. For asynchronous interfaces in dedicated mode, the async dynamic routing command enables routing protocols to be used on the line. Without the async default routing command, there is no way to enable the use of routing protocols automatically on a dedicated asynchronous interface.
Establishing and Controlling the EXEC Process
By default, the Cisco IOS software starts an EXEC process on all lines. However, you can control EXEC processes, as follows:
•
Turn the EXEC process on or off.
A serial printer, for example, should not have an EXEC session started.
•
Set the idle terminal timeout interval.
The EXEC command interpreter waits for a specified amount of time to receive user input. If no input is detected, the EXEC facility resumes the current connection. If no connections exist, it returns the terminal to the idle state and disconnects the incoming connection. To control the EXEC process, use the following commands in line configuration mode:
Command PurposeStep 1
exec
Turns on EXEC processes.
Step 2
exec-timeout minutes [seconds]
Sets the idle terminal timeout interval.
Configuring the Auxiliary (AUX) Port
The AUX port is typically configured as an asynchronous serial interface on routers without built-in asynchronous interfaces. To configure the AUX port as an asynchronous interface, configure it first as an auxiliary line with the line aux 1 global configuration command.
The AUX port sends a DTR signal only when a Telnet connection is established. The auxiliary port does not use RTS/CTS handshaking for flow control. To understand the differences between standard asynchronous interfaces and AUX ports configured as an asynchronous interface, refer to Table 5. To enable the auxiliary port, use the following command in global configuration mode:
You cannot use the auxiliary (AUX) port as a second console port. To use the AUX port as a console port, you must order a special cable from your technical support personnel.
On an access server, you can configure any of the available asynchronous interfaces (1 through 8, 16, or 48). The auxiliary port (labeled AUX on the back of the product) can also be configured as an asynchronous serial interface, although performance on the AUX port is much slower than on standard asynchronous interfaces and the port does not support some features. Table 5 illustrates why asynchronous interfaces permit substantially better performance than AUX ports configured as asynchronous interfaces.
Table 5 Differences Between the Auxiliary (AUX) Port and the Asynchronous Port
Feature Asynchronous Interface Auxiliary PortMaximum speed
115200 bps
38400 bps
Supports DMA buffering1
Yes
No
PPP framing on chip2
Yes
No
IP fast switching3
Yes
No
1 Direct Memory Access (DMA) buffering moves data packets directly to and from system memory without interrupting the main CPU. This process removes overhead from the CPU and increases overall system performance.
2 PPP framing on a hardware chip removes overhead from the CPU on the router, which enables the router to sustain 115200 bps throughput on all asynchronous ports simultaneously.
3 After the destination of the first IP packet is added to the fast switching cache, it is fast switched to and from other interfaces with minimal involvement from the main processor.
On routers without built-in asynchronous interfaces, only the AUX port can be configured as an asynchronous serial interface. To configure the AUX port as an asynchronous interface, you must also configure it as an auxiliary line with the line aux 1 command. Access servers do not have this restriction. Use the line command with the appropriate line configuration commands for modem control, such as speed.
Only IP packets can be sent across lines configured for SLIP. PPP supports transmission of IP, Internet Protocol Routing Exchange (IPX), and AppleTalk packets on an asynchronous serial interface.
Configuring Autoselect
Autoselect is used by the access server to sense the protocol being received on an incoming line and launch the appropriate protocol. Autoselect can be used for ARA, PPP, or SLIP.
When using Autoselect, "login" authentication is by-passed, so if security is required it must be performed at the protocol level, that is, ARAP or PPP authentication. SLIP does not offer protocol layer authentication.
To configure the Cisco IOS software to allow an ARA, PPP, or SLIP session to start automatically, use the following command in line configuration mode:
Command Purposeautoselect {arap | ppp | slip | during login}
Configures a line to automatically start an ARA, PPP, or SLIP session.
The autoselect command enables the Cisco IOS software to start a process automatically when a start character is received.
The autoselect command bypasses the login prompt and enables the specified session to begin automatically. However, when the autoselect command is entered with the during login keyword, the username or password prompt appears without the need to press the Return key, thus "login" users will get a prompt right away instead without needing to press the Return key. While the username or password prompt is displayed, you can choose either to answer these prompts or to send packets from an autoselected protocol.
Normally a router avoids line and modem noise by clearing the initial data received within the first one or two seconds. However, when the autoselect PPP feature is configured, the router flushes characters initially received and then waits for more traffic. This flush causes timeout problems with applications that send only one carriage return. To ensure that the input data sent by a modem or other asynchronous device is not lost after line activation, enter the flush-at-activation line configuration command.
Note
When the autoselect command is used, the activation character should be set to the default Return, and exec-character-bits to 7. If you change these defaults, the application cannot recognize the activation request.
Verifying Autoselect PPP
The following trace appears when the debug modem command and debug ppp negotiation command are enabled. As PPP calls pass through the access server, you should see this output.
When autoselect is used, "login" authentication is bypassed. If security is required it must be performed at the protocol level (that is, ARAP or PPP authentication). SLIP does not offer protocol layer authentication.
22:21:02: TTY1: DSR came up22:21:02: tty1: Modem: IDLE->READY22:21:02: TTY1: Autoselect started22:21:05: TTY1: Autoselect sample 7E22:21:05: TTY1: Autoselect sample 7EFF22:21:05: TTY1: Autoselect sample 7EFF7D22:21:05: TTY1 Autoselect cmd: ppp default22:21:05: TTY1: EXEC creation%LINK-3-UPDOWN: Interface Async1, changed state to up22:21:07: ppp: sending CONFREQ, type = 2 (CI_ASYNCMAP), value = A000022:21:07: ppp: sending CONFREQ, type = 5 (CI_MAGICNUMBER), value = 23BE13AA22:21:08: PPP Async1: state = REQSENT fsm_rconfack(0xC021): rcvd id 0x1122:21:08: ppp: config ACK received, type = 2 (CI_ASYNCMAP), value = A000022:21:08: ppp: config ACK received, type = 5 (CI_MAGICNUMBER), value = 23BE13AA22:21:08: ppp: config ACK received, type = 7 (CI_PCOMPRESSION)22:21:08: ppp: config ACK received, type = 8 (CI_ACCOMPRESSION)22:21:08: PPP Async1: received config for type = 0x2 (ASYNCMAP) value = 0x0 acked22:21:08: PPP Async1: received config for type = 0x5 (MAGICNUMBER) value = 0x2A acked22:21:08: PPP Async1: received config for type = 0x7 (PCOMPRESSION) acked22:21:08: PPP Async1: received config for type = 0x8 (ACCOMPRESSION) acked22:21:08: ipcp: sending CONFREQ, type = 3 (CI_ADDRESS), Address = 172.16.1.122:21:08: ppp Async1: ipcp_reqci: rcvd COMPRESSTYPE (rejected) (REJ)22:21:08: ppp Async1: Negotiate IP address: her address 0.0.0.0 (NAK with address 172.16.1.100) (NAK)22:21:08: ppp: ipcp_reqci: returning CONFREJ.22:21:08: PPP Async1: state = REQSENT fsm_rconfack(0x8021): rcvd id 0x922:21:08: ipcp: config ACK received, type = 3 (CI_ADDRESS), Address = 172.16.1.122:21:08: ppp Async1: Negotiate IP address: her address 0.0.0.0 (NAK with address 172.16.1.100) (NAK)22:21:08: ppp: ipcp_reqci: returning CONFNAK.22:21:09: ppp Async1: Negotiate IP address: her address 172.16.1.100 (ACK)22:21:09: ppp: ipcp_reqci: returning CONFACK.%LINEPROTO-5-UPDOWN: Line protocol on Interface Async1, changed state to upVerifying Autoselect ARA
The following trace appears when the debug modem command and debug arap internal command are enabled. As ARA version 2.0 calls pass through the access server, this output is displayed.
20:45:11: TTY3: DSR came up20:45:11: tty3: Modem: IDLE->READY20:45:11: TTY3: EXEC creation20:45:11: TTY3: Autoselect(2) sample 120:45:11: TTY3: Autoselect(2) sample 11B20:45:12: TTY3: Autoselect(2) sample 11B0220:45:18: ARAP: ---------- SRVRVERSION ----------20:45:19: ARAP: ---------- ACKing 0 ----------20:45:19: ARAP: ---------- AUTH_CHALLENGE ----------20:45:21: ARAP: ---------- ACKing 1 ----------20:45:21: ARAP: ---------- AUTH_RESPONSE ----------20:45:21: ARAP: ---------- STARTINFOFROMSERVER ----------20:45:22: ARAP: ---------- ACKing 2 ----------22:45:22: ARAP: ---------- ZONELISTINFO ----------22:45:22: ARAP: ---------- ZONELISTINFO ----------22:45:22: ARAP: ---------- ZONELISTINFO ----------The following trace is for ARA version 1.0 calls:
22:31:45: TTY1: DSR came up22:31:45: tty1: Modem: IDLE->READY22:31:45: TTY1: Autoselect started22:31:46: TTY1: Autoselect sample 1622:31:46: TTY1: Autoselect sample 161022:31:46: TTY1: Autoselect sample 16100222:31:47: ARAP: ---------- SRVRVERSION ----------22:31:47: ARAP: ---------- ACKing 0 ----------22:31:47: ARAP: ---------- AUTH_CHALLENGE ----------22:31:47: ARAP: ---------- ACKing 1 ----------22:31:47: ARAP: ---------- AUTH_RESPONSE ----------22:31:47: ARAP: ---------- STARTINFOFROMSERVER ----------22:31:48: ARAP: ---------- ACKing 2 ----------22:31:48: ARAP: ---------- ZONELISTINFO ----------22:31:48: ARAP: ---------- ZONELISTINFO ----------22:31:49: ARAP: ---------- ZONELISTINFO ----------Defining a Command String for Automatic Execution
You can set up a command to execute automatically when the router connects to another host. The Cisco IOS software can execute any appropriate EXEC command and any switch or host name that occurs with the EXEC command. To define a command, use the following command in line configuration mode:
Configuring Rotary Groups
Connections can be made to the next free line in a group of lines, also called a rotary group or hunt group. A line can be in only one rotary group; a rotary group can consist of a single line or several contiguous lines. The console line (line 0) cannot be in a rotary group.
To configure a rotary group, use the following command in line configuration mode:
Specifying Decimal TCP Port Numbers When Connecting to Lines
Connections to an individual line are most useful when a dial-out modem, parallel printer, or serial printer is attached to that line. To connect to an individual line, the remote host or terminal must specify a particular TCP port on the router.
If reverse XRemote is required, that port is 9000 (decimal) plus the decimal value of the line number.
If a raw TCP stream is required, the port is 4000 (decimal) plus the decimal line number. The raw TCP stream is usually the required mode for sending data to a printer.
If Telnet protocols are required, that port is 2000 (decimal) plus the decimal value of the line number. The Telnet protocol might require that Return characters be translated into Return and line-feed character pairs. You can turn off this translation by specifying the Telnet binary mode option. To specify this option, connect to port 6000 (decimal) plus the decimal line number.
For example, a laser printer is attached to line 10 of a Cisco 2511 router. Such a printer usually uses XON/XOFF software flow control. Because the Cisco IOS software cannot receive an incoming connection if the line already has a process, you must ensure that an EXEC session is not accidentally started. You must, therefore, configure it as follows:
line 10flowcontrol softwareno execA host that wants to send data to the printer would connect to the router on TCP port 4008, send the data, and then close the connection. (Remember that line number 10 octal equals 8 decimal.)
Optimizing Available Bandwidth
Asynchronous lines have relatively low bandwidth and can easily be overloaded, resulting in slow traffic across these lines.
To optimize available bandwidth, perform either of the following optional tasks:
•
Configuring Header Compression
•
Forcing Header Compression at the EXEC Level
Configuring Header Compression
One way to optimize available bandwidth is by using TCP header compression. Van Jacobson TCP header compression (defined by RFC 1144) can increase bandwidth availability two- to five-fold when compared to lines not using header compression. Theoretically, it can improve bandwidth availability by a ratio of seven to one.
To configure header compression, use the following command in interface configuration mode:
Command Purposeip tcp header-compression [on | off | passive]
Configures Van Jacobson TCP header compression on the asynchronous link.
Forcing Header Compression at the EXEC Level
On SLIP interfaces, you can force header compression at the EXEC prompt on a line on which header compression has been set to passive. This option allows more efficient use of the available bandwidth and does not require entering privileged configuration mode.
To implement header compression, use the following command in interface configuration mode:
Command Purposeip tcp header-compression passive
Allows status of header compression to be assigned at the user level.
For PPP interfaces, the passive option functions the same as the on option.
Monitoring and Maintaining Connections
This section describes the following monitoring and maintenance tasks that you can perform on asynchronous interfaces:
•
Monitoring and maintaining asynchronous activity
•
Debugging asynchronous interfaces
•
Debugging PPP
To monitor and maintain asynchronous activity, use the following commands in privileged EXEC mode:
To debug asynchronous interfaces, use the following debug command in privileged EXEC mode:
Command Purposedebug async {framing | state | packets}
Displays errors, changes in interface state, and log input and output.
To debug PPP links, use any of the following debug commands in privileged EXEC mode:
Checking Other Modem Settings
This section defines other settings that might be needed or desirable, depending on your modem.
Error correction can be negotiated between two modems to ensure a reliable data link. Error correction standards include Link Access Procedure for Modems (LAPM) and MNP4. V.42 error correction allows either LAPM or MNP4 error correction to be negotiated. Modems differ in the way they enable error correction. Refer to your modem documentation for the error correction methods used with your modem.
Data compression can be negotiated between two modems to allow for greater data throughput. Data compression standards include V.42 bis and MNP5. Modems differ in the way they enable data compression. Refer to your modem documentation for the data compression settings used with your modem.
See the next chapter in this publication, "Managing Modems," for more helpful information about managing modems.
AT Mode Example for Integrated Modems
To establish a direct connect session to an internal or integrated modem (existing inside the router), such as required for Microcom modems in the Cisco AS5200 access server, first open a directly connected session with the modem at-mode command and then send an AT command to the specified modem. For example, the following example sends the AT command at%v to modem 1/1:
AS5200# modem at-mode 1/1You are now entering AT command mode on modem (slot 1 / port 1).Please type CTRL-C to exit AT command mode.at%vMNP Class 10 V.34/V.FC Modem Rev 1.0/85OKat\sIDLE 000:00:00LAST DIALNET ADDR: FFFFFFFFFFFFMODEM HW: SA 2W United States4 RTS 5 CTS 6 DSR - CD 20 DTR - RIMODULATION IDLEMODEM BPS 28800 AT%G0MODEM FLOW OFF AT\G0MODEM MODE AUT AT\N3V.23 OPR. OFF AT%F0AUTO ANS. ON ATS0=1SERIAL BPS 115200 AT%U0BPS ADJUST OFF AT\J0SPT BPS ADJ. 0 AT\W0ANSWER MESSGS ON ATQ0SERIAL FLOW BHW AT\Q3PASS XON/XOFF OFF AT\X0PARITY 8N ATThe modem responds with "OK" when the AT command you send is successfully received.
Attaching External Modems
Some of the Cisco lower-end access servers such as the Cisco AS2511-RJ shown in Figure 23, have cable connections to external modems. Notice that the modems and modem cables are outside the chassis. The asynchronous interfaces and lines are inside the access server.
Figure 23 Cisco AS2511-RJ Access Server
When you configure modems to function with your access server, you must provide initialization strings and other settings on the modem to tell it how to function with the access server. Manually configuring a modem consists of the following tasks:
•
Establishing a Direct Telnet Session to an External Modem
•
Suspending and Terminating Telnet Sessions
This section assumes you have already physically attached the modem to the access server. If not, refer to the user guide or installation and configuration guide for your access server for information about attaching modems.
Establishing a Direct Telnet Session to an External Modem
You communicate with an external modem by establishing a direct Telnet session from the asynchronous line on the access server, which is connected to the modem.
Note
This process is also referred to as reverse Telnet. Performing a reverse Telnet means that you are initiating a Telnet session out the asynchronous line, instead of accepting a connection into the line (called a forward connection).
To establish a direct Telnet session to an external modem, determine the IP address of your LAN (Ethernet) interface, then enter a Telnet command to port 2000 + n on the access server, where n is the line number to which the modem is connected. For example, to connect to the modem attached to line 1, enter the following command from an EXEC session on the access server:
router# telnet 172.16.1.10 2001Trying 172.16.1.10, 2001 ... OpenThis example enables you to communicate with the modem on line 1 using the AT (attention) command set defined by the modem vendor.
Timesaver
Use the ip host configuration command to simplify direct Telnet sessions with modems. The ip host command maps an IP address of a port to a device name. For example, the modem1 2001 172.16.1.10 command enables you to enter modem1 to initiate a connection with the modem, instead of repeatedly entering telnet 172.16.1.10 2001 each time you want to communicate with the modem.
Testing the Modem Connection
After you make a direct Telnet connection to the modem, you need to test the connection. Send the modem the AT command to request its attention. It should respond with "OK." For example:
atOKIf the modem does not reply to the at command, perform the following tasks:
Step 1
Enter the show users EXEC command and scan the display output. It should not indicate that the line is in use. Also verify that the line is configured for modem inout.
Step 2
Enter the show line EXEC command. The output should contain the following two lines:
Modem state: IdleModem hardware state: CTS noDSR DTR RTSIf the output displays "no CTS" for the modem hardware state, the modem is not connected, or is not powered up, or is waiting for data, or the modem might not be configured for hardware flow control.
Step 3
Check whether the virtual terminal connections to lines in the access server require passwords.
Step 4
Verify the line speed and modem transmission rate. Make sure that the line speed on the access server matches the matches transmission rate, as shown in Table 6.
Table 6 Matching Line Speed with Transmission Rate
Modem Transmission Rate
(in bits per second) Line Speed on the Access Server (in bits per second)9600
38400
14400
57600
28800
115200
To verify the line speed, use the show run EXEC command. The line configuration fragment appears at the tail end of the output.
The following example shows that lines 7 through 9 are transmitting at 115200 bits per second (bps). Sixteen 28800-kbps modems are connected to a Cisco AS2511-RJ access server via a modem cable. (Refer to Figure 23.)
as2511# show runBuilding configuration...Current configuration:...!line 1 16login localmodem InOutspeed 115200transport input allflowcontrol hardwarescript callback callbackautoselect pppautoselect during-login!Step 5
The speeds of the modem and the access server are likely to be different. If so, switch off the modem, then switch it back on. This action should change the speed of the modem to match the speed of the access server
Step 6
Check your cabling and the modem configuration (echo or result codes might be off). Enter the appropriate at modem command to view the modem configuration, or use the at&f command to return to factory defaults. Refer to your modem documentation to learn the appropriate at command to view your modem configuration.
Suspending and Terminating Telnet Sessions
When you are connected to an external modem, the direct Telnet session must be terminated before the line can accept incoming calls. If you do not terminate the session, it will be indicated in the output of the show users command when it returns a modem state of ready if the line is still in use. If the line is no longer in use, the output of the show line value command will return a state of idle. Terminating the Telnet session requires first suspending it, then disconnecting it.
To suspend and then disconnect a Telnet session, perform the following tasks:
Step 1
Enter Ctrl-Shift-6 x to suspend the Telnet session:
- suspend keystroke -router#
Note
Ensure that you can reliably issue the escape sequence to suspend a Telnet session. Some terminal emulation packages have difficulty sending the Ctrl-Shift-6 x sequence. Refer to your terminal emulation documentation for more information about escape sequences.
Step 2
Enter the where EXEC command to check for open sessions:
router# whereConn Host Address Byte Idle Conn Name* 1 172.16.1.10 172.16.1.10 0 0 172.16.1.102 172.16.1.11 172.16.1.11 0 12 modem2Step 3
When you have suspended a session with one modem, you can connect to another modem and suspend it:
router# telnet modem2Trying modem2 (172.16.1.11, 2002) ... Open- suspend keystroke -router#Step 4
To disconnect (completely close) a session, issue the disconnect EXEC command:
router# disconnect line 1Closing connection to 172.16.1.10 [confirm] yrouter# disconnect line 2Closing connection to 172.16.1.11 [confirm] yrouter#
Note
Before attempting to allow inbound connections, make sure you close all open connections to the modems attached to the access server. If you have a modem port in use, the modem will not accept a call properly.
Automatically Configuring an External Modem
The Cisco IOS software can issue initialization strings automatically for most types of modems externally attached to the access server. A modem initialization string is a series of parameter settings that are sent to your modem to configure it to interact with the access server in a specified way. The Cisco IOS software defines seven initialization strings that have been found to properly initialize most modems so that the modems function properly with Cisco access servers. These initialization strings have the following names:
•
Codex_3260
•
Usr_courier
•
Usr_sportster
•
Hayes_optima
•
Global_village
•
Viva
•
Telebit_t3000
Note
Internal or integrated modems, such as used by the Cisco AS5300 access server, are preconfigured by Cisco and need not be initialized.
If you do not know which of these modem strings is appropriate for your modems, enter the modem autoconfigure discovery line configuration command, as shown in the following example:
router# configure terminalrouter(config)# line 1 16router(config-line)# modem autoconfigure discoveryrouter(config-line)# Ctrl-Zrouter# copy system:running-config nvram:startup-configThe Cisco IOS software first tries the first of these strings to learn if the modem initializes properly. If not, the Cisco IOS software cycles to the next string and repeats the process until the appropriate string is found. If none of the strings properly initializes the modem, you must manually configure the modem (see the section "Manually Configuring an External Modem" later in this chapter).
If you know that your modem can be configured using an initialization string from one of these scripts, you can enter the modem autoconfigure type modem-name command, where modem-name is one of the strings in the preceding list. If you list a specific modem type, initialization proceeds more quickly.
Follow these steps to configure an external modem:
Step 1
To display the list of modems for which the router has modem string entries, enter the show modemcap command.
You can change a modem value that was returned from the show modemcap EXEC command. For example, you might want to add the factory default, &F, entry to the configuration file. To make a change, enter the modemcap edit modem-name attribute value line configuration command. Configure one attribute of one modem at a time.
The following example shows how to enter line configuration mode and enter the modem autoconfigure type modem-name command for a US Robotics Sportster modem:
router(config-line)# modem autoconfigure type usr_sportsterAfter the modem initialization string has been determined, perform the following tasks to configure the modem. The following tasks configure a US Robotics Courier modem on line 1 (decimal number 2000 + line number 1 = 2001).
Step 2
Map a host name to a decimal port. The port number is 200x, plus the number of the TTY line. The following example maps port 2001 to the IP address of the Ethernet0 interface on the access server (172.16.1.10):
router(config)# ip host modem1 2001 172.16.1.10router(config)# exitrouter#Step 3
Establish a direct Telnet session to the modem:
router# telnet modem1Trying modem1 (172.16.1.10, 2001)... OpenStep 4
Return the modem to its factory defaults (this step is optional):
at&fOKStep 5
Configure the modem with an initialization string. The following example string is for a US Robotics Courier modem:
at&b1&h1&r2&c1&d3&m4&k1s0=1OKStep 6
Store the modem settings in NVRAM on the modem:
at&wOK
Note
Some modems need to be "strapped" so that they start up with saved settings when powered up, rather than using defaults. You should make sure your modem is strapped accordingly.
Step 7
Suspend and disconnect your Telnet session:
- suspend keystroke -router# disconnectClosing connection to modem1 [confirm] yrouter#
Timesaver
The script-reset line configuration command can automate the configuration of your modems. See the "Technical Tips" section on CCO for more information.
Manually Configuring an External Modem
If you cannot configure your modem automatically, you must configure it manually. This section describes how to determine and issue the correct initialization string for your modem and configure your modem with it.
Modem command sets vary widely. Although most modems use the Hayes command set (prefixing commands with at), Hayes-compatible modems do not use identical at command sets.
Refer to the documentation that came with your modem to learn how to examine the current and stored configuration of the modem you are using. Generally, you enter at commands such as &v, i4, or *o to view, inspect, or observe the settings.
Note
You must first create a direct Telnet or connection session to the modem before you can send an initialization string. You can use AT&F as a basic modem initialization string in most cases.
A sample modem initialization string for a US Robotics Courier modem is as follows:
&b1&h1&r2&c1&d3&m4&k1s0=1Modem initialization strings enable the following functions:
•
Locks the speed of the modem to the speed of the serial port on the access server
•
Sets hardware flow control (RTS/CTS)
•
Ensures correct DCD operation
•
Ensures proper DTR interpretation
•
Answers calls on the first ring
Timesaver
Initialization strings for other modems are listed in the appendix "Configuring and Troubleshooting Modems" in the Cisco IOS Dial Services Command Reference publication.
Note
Make sure to turn off automatic baud rate detection because the modem speeds must be set to a fixed value.
The port speed must not change when a session is negotiated with a remote modem. If the speed of the port on the access server is changed, you must establish a direct Telnet session to the modem and send an at command so that the modem can learn the new speed.
Modems differ in the method they use to lock the EIA/TIA-232 (serial) port speed. In the modem documentation, vendors use terms such as port-rate adjust, speed conversion, or buffered mode. Enabling error correction often puts the modem in the buffered mode. Refer to your modem documentation to learn how your modem locks speed (check the settings &b, \j, &q, \n, or s-register settings).
RTS and CTS signals must be used between the modem and the access server to control the flow of data. Incorrectly configuring flow control for software or setting no flow control can result in hung sessions and loss of data. Modems differ in the method they use to enable hardware flow control. Refer to your modem documentation to learn how to enable hardware flow control (check the settings &e, &k, &h, &r, or s-register).
The modem must use the data carrier detect (DCD) wire to indicate to the access server when a session has been negotiated and is established with a remote modem. Most modems use the setting &c1. Refer to your modem documentation for the DCD settings used with your modem.
The modem must interpret a toggle of the Data Terminal Ready (DTR) signal as a command to drop any active call and return to the stored settings. Most modems use the settings &d2 or &d3. Refer to your modem documentation for the DTR settings used with your modem.
If a modem is used to service incoming calls, it must be configured to answer a call after a specific number of rings. Most modems use the setting s0=1 to answer the call after one ring. Refer to your modem documentation for the settings used with your modem.
Chat Script Overview
Chat scripts are strings of text used to send commands for modem dialing, logging in to remote systems, and initializing asynchronous devices connected to an asynchronous line. On a router, chat scripts can be configured on the auxiliary port only.
A chat script must be configured to dial out on asynchronous lines. You also can configure chat scripts so that they can be executed automatically for other specific events on a line, or so that they are executed manually.
Each chat script is defined for a different event. These events can include the following:
•
Line activation
•
Incoming connection initiation
•
Asynchronous dial-on-demand routing
•
Line resets
•
Startup
Note
Outbound chat scripts are not supported on lines where modem control is set for inbound activity only (using the modem dialin command).
Chat Script Configuration Task List
The following tasks must be performed before a chat script can be used:
•
Define the chat script in global configuration mode using the chat-script command.
•
Configure the line so that a chat script is activated when a specific event occurs (using the script line configuration command), or start a chat script manually (using the start-chat privileged EXEC command).
To configure a chat script, perform the tasks in the following sections:
•
Understanding Chat Script Naming Conventions (Required)
•
Creating a Chat Script (Required)
•
Configuring the Line to Activate Chat Scripts (Required)
•
Starting a Chat Script Manually on an Asynchronous Line (Optional)
See the section "Using Chat Scripts" later in this chapter for examples of how to use chat scripts.
Understanding Chat Script Naming Conventions
When you create a script name, include the modem vendor, type, and modulation, separated by hyphens, as follows:
vendor-type-modulation
For example, if you have a Telebit t3000 modem that uses V.32bis modulation, your script name would be:
telebit-t3000-v32bis
Note
Adhering to the recommended naming convention allows you to specify a range of chat scripts by using partial names in UNIX-style regular expressions. The regular expressions are used to match patterns and select chat scripts to use. This method is particularly useful for dialer rotary groups on an interface that dials multiple destinations. Regular expressions are described in the "Regular Expressions" appendix in the Cisco IOS Dial Services Command Reference publication.
Creating a Chat Script
We recommend that one chat script (a "modem" chat script) be written for placing a call and another chat script (a "system" or "login" chat script) be written to log in to remote systems, where required.
To define a chat script, use the following command in global configuration mode:
Command Purposechat-script script-name expect send...
Creates a script that will place a call on a modem, log in to a remote system, or initialize an asynchronous device on a line.
The Cisco IOS waits for the string from the modem (defined by the expect portion of the script), and uses it to determine what to send back to the modem (defined by the send portion of the script).
Chat script send strings can include the special escape sequences listed in Table 7.
Special case script modifiers are also supported; refer to Table 8 for examples.
For example, if a modem reports BUSY when the number dialed is busy, you can indicate that you want the attempt stopped at this point by including ABORT BUSY in your chat script.
Note
If you use the expect-send pair ABORT SINK instead of ABORT ERROR, the system terminates abnormally when it encounters SINK instead of ERROR.
Missed Characters
After the connection is established and you press the Return key, you must often press Return a second time before the prompt appears. To create a chat script that enters this additional Return key for you, include the following as part of your chat script:
ssword:-/r-sswordThis part of the script specifies that, after the connection is established, you want ssword to be displayed. If it is not displayed, you must press Return again after the timeout passes. (See the appendix "Regular Expressions" in the Cisco IOS Terminal Services Command Reference publication for more information about expressing characters in chat scripts.)
Configuring the Line to Activate Chat Scripts
Chat scripts can be activated by any of five events, each corresponding to a different version of the script line configuration command. To start a chat script manually at any point, see the following section, "Starting a Chat Script Manually on an Asynchronous Line."
To define a chat script to start automatically when a specific event occurs, use one of the following commands in line configuration mode:
Command Purposescript activation regexp1
Starts a chat script on a line when the line is activated (every time a command EXEC is started on the line).
script connection regexp
Starts a chat script on a line when a network connection is made to the line.
script dialer regexp
Specifies a modem script for DDR on a line.
script reset regexp
Starts a chat script on a line whenever the line is reset.
script startup regexp
Starts a chat script on a line whenever the system is started up.
1 The regexp argument is a regular expression that is matched to a script name that has already been defined using the chat-script command.
Note
Outbound chat scripts are not supported on lines where modem control is set for inbound activity only (using the modem dialin command).
Starting a Chat Script Manually on an Asynchronous Line
To start a chat script manually on any line that is currently not active, use the following command in privileged EXEC mode:
Command Purposestart-chat regexp [line-number [dialer-string]]Starts a chat script manually on any asynchronous line.
If you do not specify the line number, the script runs on the current line. If the line specified is already in use, you cannot start the chat script. A message appears indicating that the line is already in use.
Using Chat Scripts
The following sections provide examples of how to write and use chat scripts:
•
Writing and Implementing Chat Scripts
•
Chat Scripts and Dialer Mapping
•
System Login Scripts and Modem Scripts Example
Writing and Implementing Chat Scripts
The following example chat script includes a pair of empty quotation marks (" "), which means "expect anything," and \r, which means "send a return":
" " \r "name:" "myname" "ord":" "mypassword" ">" "slip default"The following example shows a configuration in which, when there is traffic, a random line will be used. The dialer code will try to find a script that matches either the modem script .*-v32 or the system script cisco. If there is no match for either the modem script or the system script, you will see a "no matching chat script found" message.
interface dialer 1! v.32 rotaries are in rotary 1.dialer rotary-group 1! Use v.32 generic script.dialer map ip 1.0.0.1 modem-script .*-v32 system-script cisco 1234The following example shows line chat scripts being specified for lines connected to Telebit and
US Robotics modems:! Some lines have telebit modems.line 1 6script dialer telebit.*! Some lines have US robotics modems.line 7 12script dialer usr.*Chat Scripts and Dialer Mapping
The following example shows a modem chat script called dial and a system login chat script called login:
chat-script dial ABORT ERROR "" "AT Z" OK "ATDT \T" TIMEOUT 30 CONNECT \cchat-script login ABORT invalid TIMEOUT 15 name: myname word: mypassword ">""slip default"interface async 10dialer in-banddialer map ip 10.55.0.1 modem-script dial system-script login 96837890Figure 24 illustrates the configuration.
Figure 24 Chat Script Configuration and Function
•
The configuration is on Router A.
•
The modem chat script dial is used to dial out to the modem at Router B.
•
The system login chat script login is used to log in to Router B.
•
The phone number is the number of the modem attached to Router B.
•
The IP address in the dialer map command is the address of Router B.
In the sample script shown, the dialer in-band command enables DDR on asynchronous interface 10, and the dialer map command dials 96837890 after finding the specified dialing and the system login scripts. When a packet is received for 10.55.0.1, the first thing to happen is that the modem script is implemented. Table 9 lists the functions that are implemented with each expect-send pair in the modem script called dial.
After the modem script is successfully executed, the system login script is executed. Table 10 lists the functions that are executed with each expect-send pair in the system script called login.
System Login Scripts and Modem Scripts Example
The following example shows the use of chat scripts implemented with the system-script and modem-script options of the dialer map command.
If there is traffic for IP address 1.2.3.4, the router will dial the 91800 number using the usrobotics-v32 script, matching the regular expression in the modem chat script. Then the router will run the unix-slip chat script as the system script to log in.
If there is traffic for 4.3.2.1, the router will dial 8899 using usrobotics-v32, matching both the modem script and modem chat script regular expressions. The router will then log in using the cisco-compressed script.
! Script for dialing a usr v.32 modem:chat-script usrobotics-v32 ABORT ERROR "" "AT Z" OK "ATDT \T" TIMEOUT 30 CONNECT \c!! Script for logging into a unix system and starting up slip:chat-script unix-slip ABORT invalid TIMEOUT 15 name: billw word: wewpass ">""slip default"!! Script for logging into a cisco comm server and starting up TCP header ! compression:chat-script cisco-compressed...!line 15script dialer usrobotics-*!interface async 15dialer map ip 1.2.3.4 system-script *-v32 system-script cisco-compressed 8899dialer map ip 4.3.2.1 modem-script *-v32 modem-script cisco-compressed 8899










