Книга: Fedora™ Unleashed, 2008 edition

Configuring a Dialup Connection Manually

Configuring a Dialup Connection Manually

The first step in manually configuring PPP is to log in as root to copy and edit the necessary files. After you are logged in, you use the chat command, the pppd daemon, and several files to configure PPP:

/etc/ppp/ppp-on — Used to start a PPP connection. This file contains the ISP's phone number, your username and password, as well as various options such as IP address options, the modem device, and its settings (such as baud rate) for the connection.

/etc/ppp/ppp-off — Used to terminate a PPP connection.

/etc/ppp/ppp-on-dialer — Used to perform dialing and connection with the chat command; this script contains error-handling and negotiation responses between the remote system and the chat command script.

CAUTION

Many software modems do not work with Linux because the manufacturers won't release programming information about them or provide Linux drivers. An external serial port modem or ISA bus modem almost always works; USB and PCI modems are still problematic. It is suggested that you do a thorough Google search, using your modem's name and model number, to see how others have solved problems with that particular modem. Links to software modem compatibility sites appear at the end of this chapter.

Begin by copying the scripts from the /usr/share/doc/ppp*/scripts directory to the /etc/ppp directory, like so:

# cp -ar /usr/share/doc/ppp*/scripts/ppp-o* /etc/ppp

Using your favorite text editor, edit the ppp-on file (making sure to disable the line wrapping function in your editor — that varies from editor to editor — and line-wrapping inserts carriage returns that cause these scripts to stop working) and change the first four entries to reflect your ISP's phone number and your username and password, as follows:

TELEPHONE=555-1212 # The telephone number for the connection
ACCOUNT=hudzilla   # The account name for logon
PASSWORD=spasm     # The password for this account
LOCAL_IP=0.0.0.0   # Local IP address if known. Dynamic = 0.0.0.0

Change the values for TELEPHONE, ACCOUNT, and PASSWORD, substituting your ISP's phone number and your username and password. Change the LOCAL_IP entry to an IP address only if your ISP provides one for use. (Dynamic IPs are typical of dialup accounts.) Otherwise, leave the entry blank. Next, scroll through the script until you find the dialing setup, which can look like this:

exec /usr/sbin/pppd debug lock modem crtscts /dev/ttyS0 38400
 asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP
 noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT

These lines (actually a single script line) contain modem options for the chat script used in the ppp-on-dialer script and will start the pppd daemon on your computer after establishing a connection. Using a text editor, change the modem device (/dev/ttyS0 in this example) to /dev/modem.

CAUTION

You can use /dev/modem only if Fedora's kudzu utility has recognized and configured the computer's modem. (If /dev/modem does not exist, use the ln command to create the file as a symbolic link pointing to the correct serial port.) To create the symlink (from /dev/ttyS2, for example):

# ln -s /dev/ttyS2 /dev/modem

If your modem was not automatically detected and the /dev/modem link configured, it is possible that you have a software modem, also known as a Winmodem or HSF modem (refer to the earlier note).

Set the baud rate (38400 in the default case) to the desired connection speed — most likely 115200 or 57600. When finished, save the file.

Next, use the chmod command to make these scripts executable, like this:

chmod +x /etc/ppp/ppp-o*

To debug or check the progress of your modem connection, dialing, and connection to your ISP, monitor the syslog messages by using the tail command with its -f "loop-forever" option, as follows:

tail -f /var/log/messages

To connect to your ISP, run the ppp-on script:

/etc/ppp/ppp-on

Use the ppp-off script to stop the PPP connection, like so:

# /etc/ppp/ppp-off

You can also move the ppp-on and ppp-off scripts to a recognized $PATH, such as /usr/local/bin. Enabling use of these scripts by normal users will entail changing permissions of the serial port and other files (which can be a security problem because unauthorized users can access it).

TIP

If your modem is installed and working, you can access it with a terminal program such as minicom, which usually is not installed by default. After you install it using yum or from source code, start it the first time with the -s argument to configure it:

$ minicom -s

Set the serial port to that of your modem, and then save the configuration. You can then use minicom to communicate with your modem by using the AT command to set and see its responses.

If you do not want to go to that trouble, you can use the echo command to send commands to the modem, but the modem won't be capable of responding to you. For example, the AT&W command can be sent as follows:

# echo "AT&W" > /dev/modem

Оглавление книги


Генерация: 2.257. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз