System Administration Guide: Resource Management and Network Services

Chapter 31 Setting Up a Dial-up PPP Link (Tasks)

This chapter explains the tasks for configuring the most common PPP link, the dial-up link. Major topics include the following:

Major Tasks for Setting Up the Dial-up PPP Link (Task Map)

You set up the dial-up PPP link by configuring modems, modifying network database files, and modifying the PPP configuration files that are described in Table 36-1.

The next table lists the major tasks to configure both sides of a dial-up PPP link. Typically, you configure only one end of the link, either the dial-out machine or dial-in server.

Table 31-1 Task Map for Setting Up the Dial-up PPP Link

Task 

Description 

For Instructions 

1. Gather preconfiguration information 

Gather data that is needed prior to setting up the link, such as peer host names, target phone numbers, and modem speed. 

"Planning a Dial-up PPP Link"

2. Configure the dial-out machine 

Set up PPP on the machine that makes the call over the link. 

Table 31-2

3. Configure the dial-in server 

Set up PPP on the machine that receives incoming calls. 

Table 31-4

4. Call the dial-in server 

Type the pppd command to initiate communications.

"How to Call the Dial-in Server"

Configuring the Dial-out Machine

The tasks in this section explain how to configure a dial-out machine. The tasks use as an example the dialing in from home scenario that was introduced in Figure 30-1. You can perform the tasks at your company before passing on the machine to a prospective user. Alternatively, you can instruct experienced users so that they can set up their own home machines. Anyone setting up a dial-out machine must have root permission for that machine.

Tasks for Configuring the Dial-out Machine (Task Map)

Table 31-2 Task Map for Setting Up the Dial-out Machine

Task 

Description 

For Instructions 

1. Gather preconfiguration information 

Gather data that is needed prior to setting up the link, such as peer host names, target phone numbers, and modem speed. 

"Planning a Dial-up PPP Link"

2. Configure the modem and serial port 

Set up the modem and serial port.  

"How to Configure the Modem and Serial Port (Dial-out Machine)"

3. Configure the serial line communication 

Configure the characteristics of the transmission across the serial line. 

"How to Define Communications Over the Serial Line"

4. Define the conversation between the dial-out machine and the peer 

Gather communications data and use the information to create the chat script. 

"How to Create the Instructions for Calling a Peer"

5. Configure information about a particular peer 

Configure PPP options to call an individual dial-in server. 

"How to Define the Connection With an Individual Peer"

6. Call the peer. 

Type the pppd command to initiate communications.

"How to Call the Dial-in Server".

Dial-up PPP Template Files

Solaris PPP 4.0 provides template files, each of which contains common options for a particular PPP configuration file. The next table lists the sample templates that can be used for setting up a dial-up link, and their equivalent Solaris PPP 4.0 files.

Template File 

PPP Configuration File 

For Instructions 

/etc/ppp/options.tmpl

/etc/ppp/options

"/etc/ppp/options.tmpl Template"

/etc/ppp/options.ttya.tmpl

/etc/ppp/options.ttyname

"options.ttya.tmpl Template File"

/etc/ppp/myisp-chat.tmpl

File with the name of your choice to contain the chat script 

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

/etc/ppp/peers/myisp.tmpl

/etc/ppp/peers/peer-name

"/etc/ppp/peers/myisp.tmpl Template File"

If you decide to use one of the template files, be sure to rename it to its equivalent PPP configuration file. The one exception is the chat file template /etc/ppp/myisp-chat.tmpl. You can give chat scripts any names that you want.

Configuring Devices on the Dial-out Machine

The first task for setting up a dial-out PPP machine is to configure the devices on the serial line: the modem and serial port.


Note -

Tasks that apply to a modem usually apply to an ISDN TA.


Before performing the next procedure, you must have done the following.

For planning information, see Table 30-2.

How to Configure the Modem and Serial Port (Dial-out Machine)

  1. Program the modem.

    Even though a variety of modem types is available, most modems are shipped with the correct settings for Solaris PPP 4.0. The following table lists basic settings for modems that use Solaris PPP 4.0.

    Table 31-3 Modem Settings for Dial-up PPP

    Parameter 

    Setting 

    DCD 

    Follow carrier 

    DTR 

    Low so that the modem hangs up (puts the modem on-hook) 

    Flow Control 

    RTS/CTS for full-duplex hardware flow control 

    Attention Sequences 

    Disable 

    If you have problems in setting up the link and suspect that the modem is at fault, first consult the modem manufacturer's documentation. Also, a number of sites on the World Wide Web offer help with modem programming. Finally, you can find some suggestions for clearing modem problems in "How to Diagnose Modem Problems".

  2. Attach the modem cables to the serial port on the dial-out machine and to the telephone jack.

  3. Become superuser on the dial-out machine.

  4. Run admintool, as explained in "Setting Up Terminals and Modems with Serial Ports Tool" in System Administration Guide: Advanced Administration.

    1. Click the port where you have attached the modem, either port a or port b.

      The Modify Serial Port window is displayed.

    2. Specify modem direction as dial-out only.

      Although you can set up the modem as bidirectional (the default template for admintool). The dial-out-only choice is more secure against possible intruders.


    Note -

    You can set the baud rate and timeout from admintool, however, the pppd daemon ignores these settings.


  5. Click Okay to convey the changes.

Configuring Communications on the Dial-out Machine

The procedures in this section show how to configure communications over the serial line of the dial-out machine. Before you can use these procedures, you must have configured the modem and serial port, as described in "How to Configure the Modem and Serial Port (Dial-out Machine)".

The next tasks show how to enable the dial-out machine to successfully initiate communications with the dial-in server, based on options that are defined in the PPP configuration files. You need to create the following files:

Solaris PPP 4.0 provides templates for the PPP configuration files, which you can change to suit your needs. Refer to "Dial-up PPP Template Files" for detailed information about these files.

How to Define Communications Over the Serial Line

  1. Become superuser on the dial-out machine.

  2. Create a file that is called /etc/ppp/options with the following entry:


    lock
    

    The /etc/ppp/options file is used for defining global parameters that apply to all communications by the local machine. The lock option enables UUCP-style locking of the form /var/spool/locks/LK.xxx.yyy.zzz.


    Note -

    If the dial-out machine does not have an /etc/ppp/options file, only the superuser can run the pppd command. However, the /etc/ppp/options can be empty.


    For a complete description of /etc/ppp/options, refer to "/etc/ppp/options Configuration File".

  3. (Optional) Create a file that is called /etc/ppp/options.ttyname for defining how communications should be initiated from a specific serial port.

    The next example shows an /etc/ppp/options.ttyname file for the port with the device name /dev/cua/a.


    # vi /etc/ppp/options.cua.a
    crtscts
    

    The PPP option crtscts tells the pppd daemon to turn on hardware flow control for serial port a.

    For more information about the /etc/ppp/options.ttyname file, go to "/etc/ppp/options.ttyname Configuration File".

  4. Set the modem speed, as described in "How to Set the Modem Speed".

How to Create the Instructions for Calling a Peer

Before the dial-out machine can initiate a PPP link, you must collect information about the dial-in server to become the peer. Then you use this information to create the chat script, which describes the actual conversation between the dial-out machine and the peer.

  1. Determine the speed at which the dial-out machine's modem needs to run.

    For more information, see "Configuring the Modem Speed".

  2. Obtain the following information from the dial-in server's site:

    • Server's telephone number

    • Authentication protocol that is used, if appropriate

    • Login sequence that is required by the peer for the chat script

  3. Obtain the names and IP addresses of name servers at the dial-in server's site.

  4. Put instructions for initiating calls to the particular peer in a chat script.

    For example, you might create the following chat script, /etc/ppp/mychat, to call the dial-in server myserver.


    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
            ogin:--ogin: pppuser
            TIMEOUT 20
            ABORT 'ogin incorrect'
            ssword: \qmypassword
            "% " \c
            SAY "Logged in.  Starting PPP on peer system.\n" 
            ABORT 'not found'
            "" "exec pppd"
            ~ \c
    The script contains instructions for calling a Solaris dial-in server that requires a login sequence. For a description of each instruction, refer to "Basic Chat Script Enhanced for a UNIX-Style Login". For complete details on creating a chat script, read the section "Defining the Conversation on the Dial-up Link".


    Note -

    You do not invoke the chat script directly. Rather, you use the file name of the chat script as an argument to the connect option, which invokes the script.


If a peer runs Solaris or a similar UNIX-based operating system, consider using the previous chat script as a template for your dial-out machines.

How to Define the Connection With an Individual Peer

  1. Become superuser on the dial-out machine.

  2. Update DNS databases by creating the following /etc/resolv.conf file:


    domain bigcompany.com
    nameserver 10.10.111.15
    nameserver 10.10.130.8
    

    domain bigcompany.com

    Specifies that the peer's DNS domain is bigcompany.com.

    nameserver 10.10.111.15

    nameserver 10.10.130.8

    Lists the IP addresses of name servers at bigcompany.com.

    For complete details on DNS implementation, refer to "Setting Up Terminals and Modems with Serial Ports Tool" in System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP).

  3. Edit the /etc/nsswitch.conf file to have the DNS database searched first for host information.


    hosts:      dns [NOTFOUND=return] files 
  4. Create the /etc/ppp/peers directory, and then add a file for the peer.

    For example, you would create the following file to define the dial-in server myserver:


    # cd /etc/ppp
    # mkdir peers
    # cd peers
    # vi myserver
    /dev/cua/a
    57600
    noipdefault
    defaultroute
    idle 120
    noauth
    connect "chat -U 'mypassword' -T 1-123-555-1213 -f /etc/ppp/mychat"
    

    /dev/cua/a

    Specifies that the device /dev/cua/a should be used as the serial interface for calls to myserver.

    57600

    Defines the speed of the link. 

    noipdefault

    Specifies that for transactions with peer myserver, the dial-out machine initially has an IP address of 0.0.0.0. myserver assigns an IP address to the dial-out machine for every dial-up session.

    idle 120

    Indicates that the link is to time out after it is idle for 120 seconds. 

    noauth

    Specifies that the peer myserver does not need to provide authentication credentials when negotiating the connection with the dial-out machine.

    connect "chat -U 'mypassword' -T 1-123-555-1213 -f /etc/ppp/mychat"

    Specifies the connect option and its arguments, including the phone number of the peer, and the chat script /etc/ppp/mychat with calling instructions.

Where to Go From Here

Task 

For Instructions 

Configure another dial-out machine 

"How to Configure the Modem and Serial Port (Dial-out Machine)".

Test modem connectivity by dialing out to a another computer 

cu(1C) and tip(1) man pages. These utilities can help you test if your modem is properly configured and can establish a connection with another machine.

Get detailed information about the PPP configuration files 

"Using PPP Options in Files and on the Command Line".

Begin configuring the dial-in server 

"Configuring Devices on the Dial-in Server".

Configuring the Dial-in Server

The tasks in this section are for configuring the dial-in server, the peer machine that receives the call over the PPP link from the dial-out machine. The tasks show how to configure the dial-in server myserver that was introduced in Figure 30-1.

Tasks for Configuring the Dial-in Server (Task Map)

Table 31-4 Task Map for Setting Up the Dial-in Server

Task 

Description 

For Instructions 

1. Gather preconfiguration information 

Gather data that is needed prior to setting up the link, such as peer host names, target phone numbers, and modem speed. 

"Planning a Dial-up PPP Link"

2. Configure the modem and serial port 

Set up the modem and serial port. 

"How to Configure the Modem and Serial Port (Dial-in Server)"

3. Configure calling peer information 

Set up the user environments and PPP options for every dial-out machine that is permitted to call the dial-in server. 

"How to Configure Users of the Dial-in Server"

4. Configure the serial line communication. 

Configure the characteristics of the transmission across the serial line. 

"How to Define Communications Over the Serial Line (Dial-in Server)"

Configuring Devices on the Dial-in Server

The following procedure explains how to configure the modem and serial port on the dial-in server.

Before you do the next procedure, you must have completed the following activities on the peer dial-in server:

How to Configure the Modem and Serial Port (Dial-in Server)

  1. Program the modem, as instructed in the modem manufacturer's documentation.

    For other suggestions, refer to "How to Configure the Modem and Serial Port (Dial-out Machine)".

  2. Attach the modem to the serial port on the dial-in server.

  3. Become superuser on the dial-in server.

  4. Configure the serial port by using admintool, as described in "Setting Up Terminals and Modems with Serial Ports Tool" in System Administration Guide: Advanced Administration.

    Use admintool to do the following:

    1. Select the serial port where you have attached the modem, either port a or port b.

      The Modify Serial Port window is displayed.

    2. Specify modem direction as dial-in only.


      Note -

      Solaris PPP 4.0 does support bidirectional communications for a modem.


    3. Click Okay to convey the changes.

How to Set the Modem Speed

The next procedure explains how to set the modem speed for a dial-in server. For suggestions on speeds to use with Sun Microsystems' computers, see "Configuring the Modem Speed".

  1. Log in to the dial-in server.

  2. Use the tip command to reach the modem.

    Instructions for using tip to set the modem speed are in the tip(1) man page.

  3. Configure the modem for a fixed DTE rate.

  4. Lock the serial port to that rate, using ttymon or admintool, as discussed in "Setting Up Terminals and Modems with Serial Ports Tool" in System Administration Guide: Advanced Administration.

Where to Go From Here

Task 

For Instructions 

Configure another serial port and modem on the dial-in server 

"How to Configure the Modem and Serial Port (Dial-in Server)"

Configure information about users that call the dial-in server 

"How to Configure Users of the Dial-in Server"

Setting Up Users of the Dial-in Server

Part of the process of setting up a dial-in server involves configuring information about each known remote caller.

Before starting the procedures in this section, you must have done the following:

How to Configure Users of the Dial-in Server

  1. Become superuser on the dial-in server.

  2. Create a new account on the dial-in server for each remote PPP user.

    You can use admintool or the Solaris Management Console to create a new user. For instructions on creating a new user through Solaris Management Console, see "Setting Up User Accounts (Task Map)" in System Administration Guide: Basic Administration. For instructions on creating a new user through admintool, see admintool(1M).


    Note -

    The remaining steps show how to create an account by using admintool. You can use the same parameters for creating an account with Solaris Management Console.


  3. Use the Add User template to create the new user.

    For example, the next table shows how you might fill out PPP-related parameters for an account that is called pppuser for user1 on the dial-out machine myhome.

    Template Parameter 

    Value 

    Definition 

    User Name 

    pppuser

    The user account name for the remote user. This account name should correspond to the account name that is given in the login sequence of the chat script. For example, pppuser is the account name that is found in the chat script in "How to Create the Instructions for Calling a Peer".

    Login Shell 

    /usr/bin/pppd

    The default login shell for the remote user. The login shell /usr/bin/pppd initially restricts the caller to a dedicated PPP environment.

    Create Home Dir Path 

    /export/home/pppuser

    The home directory /export/home/pppuser is set when the caller successfully logs in to the dial-in server.

  4. Create for each caller a $HOME/.ppprc file that contains various options that are specific to the user's PPP session.

    For example, you might create the following .ppprc file for pppuser.


    # cd /export/home/pppuser
    # vi .ppprc
    noccp

    noccp turns off compression control on the link.

Where to Go From Here

Task 

For Instructions 

Set up more users of the dial-in server 

"How to Configure Users of the Dial-in Server"

Configure communications over the dial-in server 

"How to Define Communications Over the Serial Line (Dial-in Server)"

Configuring Communications Over the Dial-in Server

The next task shows how to enable the dial-in server to open communications with any dial-out machine, based on options that are defined in the following PPP configuration files:

For detailed information about these files, refer to "Using PPP Options in Files and on the Command Line".

Before you proceed, you should have done the following:

How to Define Communications Over the Serial Line (Dial-in Server)

  1. Become superuser on the dial-in server.

  2. Create the /etc/ppp/options file with the following entry.


    nodefaultroute
    

    nodefaultroute indicates that no route is defined for the server.


    Note -

    If the dial-in server does not have an /etc/ppp/options file, only the superuser can run the pppd command. However, the /etc/ppp/options file can be empty.


  3. Create the file /etc/options.ttyname to define how calls that are received over serial port ttyname should be handled.

    The following /etc/options.ttya file defines how the dial-in server's serial port /dev/ttya should handle incoming calls.


    :10.0.0.80
    xonxoff
    

    :10.0.0.80

    Assigns the IP address 10.0.0.80 to all peers that are calling in over serial port ttya

    xonxoff

    Allows the serial line to handle communications from modems with software flow control enabled

Where to Go From Here

If you have followed all the procedures in this chapter, you have completed the configuration of the dial-up link.

Task 

For Instructions 

Test modem connectivity by dialing out to another computer 

cu(1C) andtip(1) man pages. These utilities can help you test if your modem is properly configured and can establish a connection with another machine.

Configure more options for the dial-in server 

"Configuring the Dial-in Server"

Configure more dial-out machines 

"Configuring the Dial-out Machine"

Have the remote machine call the dial-in server 

"Calling the Dial-in Server"

Calling the Dial-in Server

You establish a dial-up PPP link by having the dial-out machine call the dial-in server. You can instruct the dial-out machine to call the server by specifying the demand option in the PPP configuration files on the dial-out machine. But the most common method for establishing the link is for the user to run the pppd command on the dial-out machine.

Before you proceed to the next task, you should have done either or both of the following:

How to Call the Dial-in Server
  1. Log in to the dial-out machine by using your regular user account, not root.

  2. Call the dial-in server by running the pppd command.

    For example, the following command initiates a link between the dial-out machine and dial-in server myserver:


    % pppd 57600 call myserver
    

    pppd

    Starts the call by invoking the pppd daemon

    57600

    Sets the speed of the line between host and modem 

    call myserver

    Invokes the call option of pppd. pppd then reads options in the file /etc/ppp/peers/myserver, which was created in "How to Define the Connection With an Individual Peer"

  3. Contact a host on the server's network, for example, the host lindyhop that is shown in Figure 30-1:


    ping lindyhop

    If the link is working correctly, the standard Telnet login sequence should be displayed in the terminal window. If the link is not working correctly, refer to Chapter 35, Fixing Common Problems (Tasks).

  4. Terminate the PPP session:


    % pkill -TERM -x pppd
    

Where to Go From Here

If you have followed all the procedures in this chapter, you have completed the configuration of the dial-up link.

Task 

For Instructions 

Have users start working on their dial-out machines 

"How to Call the Dial-in Server"

Fix problems on the link 

Chapter 35, Fixing Common Problems (Tasks)

Learn more about the files and options that are used in this chapter 

"Using PPP Options in Files and on the Command Line"