PPP uses several components on your system. The first is a daemon called pppd, which controls the use of PPP. The second is a driver called the high-level data link control (HDLC) , which controls the flow of information between two machines. A third component of PPP is a routine called chat that dials the other end of the connection for you when you want it to. Although PPP has many "tunable" parameters, the default settings work well for most people.
NOTE
You can check to see whether PPP is installed on your system by running the pppdcommand as root from a command line with the --helpargument, like this:
# pppd --help
That will list the current version number and describe a few available options if PPP is installed.
If PPP isn't installed on your system, use the rpm command to install the PPP package from the Fedora DVD or use the Packages menu item from the System Settings menu. Chapter 34, "Advanced Software Management," covers the details of using rpm and the graphical package manager.
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 chatcommand, the pppddaemon, 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 chatcommand; this script contains error-handling and negotiation responses between the remote system and the chatcommand 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*/scriptsdirectory to the /etc/pppdirectory, like so:
# cp -ar /usr/share/doc/ppp*/scripts/ppp-o* /etc/ppp
Using your favorite text editor, edit the ppp-onfile (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_IPentry 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-dialerscript and will start the pppddaemon on your computer after establishing a connection. Using a text editor, change the modem device ( /dev/ttyS0in this example) to /dev/modem.
CAUTION
You can use /dev/modemonly if Fedora's kudzuutility has recognized and configured the computer's modem. (If /dev/modemdoes not exist, use the lncommand 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/modemlink 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 1 15200or 57600. When finished, save the file.
Next, use the chmodcommand 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 tailcommand with its -f"loop-forever" option, as follows:
# tail -f /var/log/messages
To connect to your ISP, run the ppp-onscript:
# /etc/ppp/ppp-on
Use the ppp-offscript to stop the PPP connection, like so:
# /etc/ppp/ppp-off
You can also move the ppp-onand ppp-offscripts 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 yumor from source code, start it the first time with the -sargument 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 ATcommand to set and see its responses.
If you do not want to go to that trouble, you can use the echocommand to send commands to the modem, but the modem won't be capable of responding to you. For example, the AT&Wcommand can be sent as follows:
# echo "AT&W" > /dev/modem
Using the Fedora Internet Configuration Wizard
The Fedora Modem Configuration Wizard can be used to set up the many kinds of network connection types that exist. Fedora provides wizards for the following connections:
► IPSec (VPN) connection (virtual private network using crypto IP encapsulation)
► Ethernet connection
► ISDN connection
► Modem connection
► Token Ring connection
► Wireless connection
► xDSL connection
The example provided here uses the wizard to configure a modem connection — the most commonly encountered home network connection. The other types are configured in essentially the same manner.
From the System menu, select the Administration submenu and click Network to open the Network Configuration tool. Enter the root password to gain access to the tool and click New in the toolbar to start the wizard. Select Modem Connection from the list of options, shown in Figure 14.4, and click Forward.
Читать дальше