Many individuals and even some small businesses that need to connect to the Internet still do so using modems and telephone lines. Your modem connects to a serial port (COM1, COM2, and so on) on your computer and then into a telephone wall jack. Then your computer dials a modem at your Internet service provider or business that has a connection to the Internet.
The most common protocol for making dial-up connections to the Internet (or other TCP/IP network) is Point-to-Point Protocol (PPP). This section describes how to use PPP protocol to connect to the Internet.
To establish a PPP connection, you need to get some information from the administrator of the network that you are connecting to. This is either your Internet service provider (ISP) when you sign up for Internet service, or the person in your workplace who walks around carrying cables, two or more cellular phones, and a couple of beepers. (When a network goes down, these people are in demand!) Here is the kind of information you need to set up your PPP connection:
— This telephone number gives you access to the modem (or pool of modems) at the ISP. If it is a national ISP, make sure that you get a local or toll-free telephone number (
An IP number
— Most ISPs use Dynamic IP
DNS Server IP addresses
— Your computer
PAP or CHAP secrets
— You may need a PAP id or CHAP id and a secret, instead of a login and password when connecting to a
Besides providing an Internet connection, your ISP typically also provides services for use with your Internet connection. Although you don’t need this information to create your connection, you will need it soon afterward to configure these useful services. Here is some information you should acquire:
Mail server — If your ISP is providing you with an e-mail account, you must know the address of the mail server, the type of mail service (such as Post Office Protocol or POP3), and the authentication password for the mail server in order to get your e-mail.
News server — To enable you to participate in newsgroups, the ISP may provide the name of a news server. If the server requires you to log on, you will also need a password.
After you have gathered this information, you are ready to set up your connection to the Internet. To configure Fedora to connect to your ISP, follow the PPP procedure described below.
Point-to-Point Protocol (PPP) is used to create Internet Protocol (IP) connections over serial lines. Most often, the serial connection is established over a modem; however, it will also work over serial cables (null modem cables) or digital lines (including ISDN and DSL).
Although one side must dial out while the other side must receive the call to create a PPP connection over a modem, after the connection is established, information can flow in both directions. For the sake of clarity, however, I refer to the computer placing the call as the client and the computer receiving the call as the server.
To simplify the process of configuring PPP (and other network interfaces), Fedora lets you configure dial-up by using either the Internet Configuration Wizard or another tool, such as kppp:
Internet Configuration Wizard — From the main desktop menu, choose System Tools Internet Configuration Wizard. The Select Device Type window that appears lets you configure and test your dial-up PPP connection.
KPPP Window — From the KDE desktop, select Internet KPPP, or from a Terminal window run the kppp command. From the KPPP window you can set up a PPP dial-up connection and launch it.
Before you begin either of the two dial-up procedures, physically connect your modem to your computer, plug it in, and connect it to your telephone line. If you have an internal modem, you will probably see a telephone port on the back of your computer that you need to connect. If your modem isn’t
You can use the Internet Configuration Wizard to set up dial-up networking. To start it, choose System Tools Internet Configuration Wizard from the main menu. (Type the root password, if prompted.) A Select Device Type window appears to help you select the device for your Internet connection (a dial-up modem, in this case), as shown in Figure 16-1.
Figure 16-1: The Internet Configuration Wizard helps you set up a PPP Internet connection.
Follow the procedure below from the first Select Device Type window.
From the Select Device Type window that appears, select Modem connection and click Forward. The wizard searches for a modem and the Select Modem window appears.
Select the following modem properties:
Modem Device — If the modem is connected to your first serial port (COM1) you can select /dev/ttyS0; for the second serial port (COM2) choose /dev/ttyS1. (By convention, the device is often linked to /dev/modem . Type ls –l /dev/modem to see if it is linked to a tty device.)
Baud Rate — This is the rate at which the computer talks to the modem (which is typically considerably faster than the modem can talk over the phone lines). The default is 115200. For dial-up connections, the value of 57600 is probably fine.
Flow Control — Check the modem documentation to see if the modem supports hardware flow control (CRTSCTS). If it doesn’t, select software flow control (XON/XOFF).
— This is off by default, because the modem noise can be annoying. However, I usually select medium while I am setting up the modem. Then I
Use touch tone dialing — Leave this check box on in most cases. If for some reason your phone system doesn’t support touch-tone dialing, you can turn it off.
Click Forward. The Select Provider window appears.
Enter the following provider information:
— If you are using Internet service in any of the
Phone Number — Enter the telephone number of the ISP you want to dial into. (An optional prefix is available in case you need to dial 9 or some other number to get an outside dial tone.)
Provider Name — The name of the Internet service provider. You could use ppp0 here as the provider name, to identify the interface. (For multiple dial-up accounts, use ppp1 , ppp2 , and so on.)
Login Name — The login name assigned to you from the ISP. The ISP may have called the login name a login ID or something similar.
Password — The password associated with the login name.
Click Forward, and the IP Settings window appears.
With a dial-up connection, you would typically select Automatically obtain IP address settings. However, if the ISP has assigned a static IP address that you can use, click the Statically set IP addresses check box, and then enter your IP address, Subnet Mask, and Default Gateway Address. Then click Forward to continue.
The Create Dialup Connection window appears, displaying information you just entered.
If all the information looks correct, click Apply (otherwise, click the Back button to change any information). The window
The Network Configuration window appears,
Click the new dial-up entry so it is highlighted.
Click File Save to save the new dial-up configuration you just created.
Click the ppp device name and click the Activate button. The Internet dialer starts up and dials your ISP. (If you have sound turned on, you should hear your modem dialing out.)
If everything is working properly, you should see your login and password accepted and the PPP connection completed. Try opening Mozilla or another Web browser and see if you can access a Web site on the Internet. If this doesn’t work the first time, don’t be discouraged. There are many things to check to get your dial-up PPP connection working. If your dial-up connection isn't working yet, skip ahead to the “Checking your PPP connection” section.
Although your dial-up connection should now be configured (as described in the previous section), it is not set to connect automatically. One way to start the connection is to set it up to launch from the desktop panel. Here’s how:
From the GNOME desktop:
Right-click the Panel and then choose Add to Panel
Launcher from Menu
Network from the main menu. An icon appears on the panel that you can click to
Select the new icon from the panel. A Network Configuration window appears.
Select the dial-up interface you added (probably ppp0 ) and click Activate to connect.
From the KDE desktop:
Right-click the panel and then choose Add Application Button System Settings Network from the main menu.
Select the new icon from the panel (type the root password, if prompted). A Network Configuration window appears.
Select the dial-up interface you added (probably ppp0 ) and click Activate to connect.
From this point forward, icons will appear on your desktop that you can select to immediately connect to your ISP over the dial-up connection you configured.
Instead of starting a dial-up PPP connection manually each time you want to contact the Internet, you can set your dial-up connection to start automatically when an application (such as a Web browser or e-mail program)
The dial-up connection on your Linux system is acting as the gateway for other computers in your home or office. You don’t have to run over to your Linux box to start the connection when another computer needs the dial-up connection.
You run programs at off hours that require an Internet connection (like remote
You don’t want to be bothered clicking an extra icon when you just want to browse the Web a bit.
The risk of on-demand dialing is that dial-up connections can start up when you don’t want them to, since the connection starts automatically. (Some people get worried when their computer starts dialing by itself in the middle of the night.)
Here is an example of settings you can add to your dial-up configuration file (probably /etc/sysconfig/network-scripts/ifcfg-ppp0 ) to configure on-demand dialing:
ONBOOT=yes DEMAND=yes IDLETIMEOUT=600 RETRYTIMEOUT=30
starts the pppd daemon (but doesn’t immediately begin dialing because
is set to
). Also, because
, a dial-up connection attempt is made
Because it can take a bit of time for dial-up connections to be established, operations may fail while dialing occurs. In particular, DNS
To debug your PPP connection or simply to better understand how it works, you can run through the steps below. They will help you understand where information is being stored and how tools can be used to track this information.
It is possible that your modem is not supported under Linux. If that is the case, your PPP connection might be failing because the modem was not detected at all. To scan your serial ports to see where your modem might be, type the following (as root
$ wvdialconf create
command is really made to build a configuration file (the
file) that is used by the dialer command (
). Its first action, however, is to scan the serial ports on your computer and report where it finds modems. If it
If the modem wasn’t detected, you should determine whether or not it is a modem supported in Linux. You can do this by finding out what type of chip set is used in the modem. This is even more important than finding out the manufacturer of the modem, since the same manufacturer can use chips from different companies. (This applies primarily to internal modems, since most external serial modems and many USB modems are supported in Linux.)
After you have determined the chip set being used, check the Web site linmodems.org . This site contains information on so-called Win-modems, which have only recently begun to be supported in Linux. Search for the chip set on your modem from this site. It will tell you if there is a driver available for your modem.
One way to check that the PPP interface is working is with the ping command. From the Terminal window, type ping along with any Internet address you know. For example:
$ ping www.handsonhistory.com PING handsonhistory.com (184.108.40.206) from 192.168.0.43 : 56(84) bytes of data. 64 bytes from handsonhistory.com (220.127.116.11): icmp_seq=0 ttl=240 time=120 msec 64 bytes from handsonhistory.com (18.104.22.168): icmp_seq=1 ttl=240 time=116 msec 64 bytes from handsonhistory.com (22.214.171.124): icmp_seq=2 ttl=240 time=120 msec --- www.handsonhistory.com ping statistics --- 4 packets transmitted, 3 packets received, 25% packet loss round-trip min/avg/max/mdev = 116.816/119.277/120.807/1.779 ms
Press Ctrl+C to end the
command. The previous lines show the responses from
. It sent back packets from the IP address
in response to each one it received. You can see the sequence of packets (
) and the time it took for each response (in
After starting a dial-up connection, check that the default route is set using route -n , as shown in the following example:
# /sbin/route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 126.96.36.199 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 188.8.131.52 0.0.0.0 UG 0 0 0 ppp0
This shows that the gateway was set to the remote PPP server ( 184.108.40.206 ), as well as showing the other interfaces running on my computer. There are two ppp0 entries. The first shows the destination as a host ( UH ). The second shows the destination as a gateway ( UG ). All addresses that can’t be resolved on the local LAN are directed to the gateway address.
If you are able to ping a remote computer by IP address, but are not able to resolve any addresses, your DNS servers may not be set correctly. As root user from a Terminal window, open the /etc/resolv.conf file and check that there are lines identifying one or more DNS servers in this file. These should be supplied to you by your ISP (unless you run your own DNS server). Here are some examples (the numbers are fictitious):
nameserver 220.127.116.11 nameserver 18.104.22.168
Try using the ping command to make sure that the name servers are live.
PPP supports two authentication protocols in Fedora: Challenge Handshake Authentication Protocol (CHAP) and Password Authentication Protocol (PAP). Here is what each protocol does to authenticate:
CHAP — The server sends the client a challenge packet (which includes the server name). The client sends back a response that includes its name and a value that combines the secret and the challenge. The client name and secret are stored in your /etc/ppp/chap-secrets file.
PAP — The client sends its name and a password (clear text) for authentication. The client name and secret are stored in your /etc/ppp/pap-secrets file.
By default, PPP in Fedora will authenticate if the server requests it, unless it has no secrets to share. If it has no secrets, PPP (or, more
The chap-secrets and pap-secrets formats are the same. Each authentication line can contain the client name, the server name, and the secret. The server name can be represented by an * (to allow this secret to be used to authenticate any server). This is useful if you don’t know what the server name will be. Also, remember that case is significant (that is, Myserver is not the same as myserver).
For more about PAP and CHAP in PPP for Linux, see the pppd man page (type man pppd ).
In any case, here’s an example of what a chap-secrets file may look like:
# Secrets for authentication using CHAP # client server secret IP addresses ####### redhat-config-network will overwrite this part!!! (begin) ###### "abcusername" "ppp0" "MySecretPassword"
The pap-secrets and chap-secrets files should not be accessible by anyone but the root user.
The ifcg-ppp0 file ( /etc/sysconfig/network-scripts/ifcfg-ppp0 ) contains options that are passed to the pppd daemon for features that are negotiated with the remote PPP server. Most of the problems that can occur with your PPP connection result from getting some of the options wrong (particularly asking for features the server can’t or won’t provide).
Here is an example of the ifcfg-ppp0 file used to connect to a Windows NT PPP server:
DEVICE=ppp0 NAME=Acme_Internet_Service MODEMPORT=/dev/ttyS0 LINESPEED=115200 PAPNAME=guest ONBOOT=yes DEFROUTE=yes DEMAND=yes IDLETIMEOUT=600
The device name is
(which is associated with the configuration file
is the name you assigned to the connection.
is the device name associated with the port the modem is connected to (in this case, COM1).
sets the speed, in bps, between the computer and the modem (not the dial-up speed, which is typically slower).
is the user name that you log in with,
ONBOOT is set to yes to start the pppd daemon at boot time (but not dial out yet, since DEMAND=yes is set). DEFROUTE=yes sets the default route to be this PPP connection. DEMAND=yes causes the link to be initiated only when traffic is present. IDLETIMEOUT=600 causes your connection to time out after 600 seconds of being idle.
If you want to see the exact options set by each of these parameters, look at the contents of the
script. For example, if
, then the option
You can add a PPPOPTIONS line to set any additional options you want passed to the pppd daemon process. There are some cases where the ISP will require other values that are not included here. Likewise, there are some options that you should not put in this file when connecting to certain types of servers. Here are some suggestions of values that either should not be in this file or should be (in some cases) for some Windows NT servers. For descriptions of these options, see the pppd man page:
remotename= remotename — You may need this value for PAP authentication, but it should not be entered for CHAP authentication. (For CHAP, the remote PPP server sends you its name.)
require-chap, require-pap, auth, noauth
— It’s a nice idea to ask a Windows NT server to authenticate itself (which is what
do for their respective protocols). The
value requires the server to authenticate itself before packets can be sent or received. However, I’m told on good authority that Windows NT will not let you do any of this. Authentication will fail and you will not get a connection. You may need to
default-asyncmap — PAP can fail to authenticate because of “link transparency problems.” If authentication fails and you are sure you have the authentication information correct, try adding this value.
ipcp-accept-local, ipcp-accept remote — Sometimes a server will request your local IP address, even if it wants to assign one itself. The same is true of the remote address. Try adding these lines to the options file:
192.168.0.1:192.168.0.2 ipcp-accept-local ipcp-accept-remote demand
This gives temporary local and remote addresses and tells the remote server that it can replace those values. Instead of using private IP addresses (as shown here), you could use 0.0.0.0 instead.
bsdcomp, deflate — Certain kinds of compression are not supported with Windows NT PPP servers. So, you should not request BSD compression ( bsdcomp ) or Deflate compression ( deflate ). In some cases, you may want to prohibit those types of compression: nobsdcomp , nodeflate , and noccp (for no compression control protocol).
As noted earlier, the best place for descriptions of pppd options is the pppd man page. For a sample options file, look in /usr/share/doc/ppp*/sample .
If your modem is working, but you are not getting connected at all, the first thing to do is turn on logging for PPP. This will help you track down the problem. If you are still stumped after looking at the logging output, have an expert review the log file. Make sure that debugging is turned on by setting DEBUG=yes in the ifcfg-ppp0 file.
I recommend posting your failed PPP output to the comp.protocol.ppp newsgroup, where some very smart PPP experts can help answer your questions. Before you post, however, read a few days’ worth of messages from the group. Chances are that someone has already run into the same problem and has a solution. Also, post only the
To have debugging directed to a separate log file for PPP, add these lines to the /etc/syslog.conf file:
daemon.* /var/log/pppmsg local2.* /var/log/pppmsg
After this, restart the syslogd daemon process as
# service syslog restart
It’s best to try to do this debugging process from the desktop because it helps to have several Terminal windows open (I would suggest at least three). From the first window, start a command that lists the contents of the log file we just defined above ( pppmsg ) as debug messages come in:
# tail -f /var/log/pppmsg
In the next window, start the PPP interface. Assuming it is the ppp0 interface, use the following command as root user:
# ifup ppp0
Here is a partial listing of the output:
Sep 6 20:43:51 maple pppd: pppd 2.4.1 started by root, uid 0 Sep 6 20:43:51 maple ifup-ppp: pppd started for ppp0 on /dev/modem at 115200 Sep 6 20:43:52 maple chat: abort on (BUSY) Sep 6 20:43:52 maple chat: abort on (ERROR) Sep 6 20:43:52 maple chat: abort on (NO CARRIER) Sep 6 20:43:52 maple chat: abort on (NO DIALTONE) Sep 6 20:43:52 maple chat: abort on (Invalid Login) Sep 6 20:43:52 maple chat: abort on (Login incorrect) Sep 6 20:43:52 maple chat: send (ATZ^M) Sep 6 20:43:52 maple chat: expect (OK) Sep 6 20:43:53 maple chat: ATZ^M^M Sep 6 20:43:53 maple chat: OK Sep 6 20:43:53 maple chat: -- got it Sep 6 20:43:53 maple chat: send (ATDT5551212^M) Sep 6 20:43:53 maple chat: expect (CONNECT) Sep 6 20:43:53 maple chat: ^M Sep 6 20:44:10 maple chat: ATDT5551212^M^M Sep 6 20:44:10 maple chat: CONNECT Sep 6 20:44:10 maple chat: -- got it Sep 6 20:44:10 maple chat: send (\d) Sep 6 20:44:14 maple pppd: Serial connection established. Sep 6 20:44:14 maple pppd: Using interface ppp0 Sep 6 20:44:14 maple pppd: Connect: ppp0 <--> /dev/modem . . . Sep 6 20:44:17 maple pppd: local IP address 22.214.171.124 Sep 6 20:44:17 maple pppd: remote IP address 126.96.36.199 Sep 6 20:44:17
maplepppd: primary DNS address 188.8.131.52 Sep 6 20:44:17 maple pppd: secondary DNS address 184.108.40.206
This output shows starting the PPP connection on /dev/modem . After verifying that the modem is working, the chat script sends the telephone number. The connection is made, and the PPP interface is started. After some parameter negotiations, the server assigns IP addresses to both sides of the communication, and the connection is ready to use.
If you do get connected, but none of your applications (Web browser, FTP, and so on) seem to work, check that your PPP interface is noted as the default route ( /sbin/route -n ). If it is, check that you have the DNS servers specified correctly in your /etc/resolv.conf file. Use the ping command on those DNS servers’ IP addresses to make sure you can get through.