Configuring a dial-up connection using PPP in GNU/Linux is very simple. PPP (point to point protocol) makes it possible to establish IP-Links between two computers with a modem (that it must be a modem supported by GNU/Linux, as not all modems, especially internal ones or those known as Winmodems, can be configured because many of them need additional software in order to establish communication). [Vas00, Law07, Sec00].
To start with, we must have the following information: the modem init-string (this is not normally necessary but if it is and it is not available, we can use ATZ, which works in most modems or we can consult specialised init-string lists).
We also need the ISP data: connection ID (login name), password and telephone number. The DNS addresses would be advisable, but this is optional in the current versions of pppd. Also, we should verify that the modem is connected properly. With an external modem, we must execute echo > /dev/ttyS0 and check the LEDs on the modem to see if it is active. Otherwise, try with ttyS1, if the modem is connected to the 2nd serial port. With an internal modem, check the supported hardware manual to see if this modem can be recognised by GNU/Linux; if this is the case, it may be necessary to reconfigure the kernel in order to use it. We can also use cat /proc/pci in case it is in the PCI bus. [PPP00]
The easiest way to configure the modem now is through the kppp package (we must install the kdenetwork-ppp* and ppp* packages). On a terminal, execute /usr/bin/kppp. On the window, fill in the following boxes:
|Accounts ⇒ New Connection|
|Dial ⇒ Authentication 'PAP/CHAP'|
|Store Password ⇒ yes|
|IP ⇒ Dynamic IP Address|
|Autoconfigure hostname ⇒ No|
|Gateway⇒DefaultGateway⇒ Assign the Default Route|
|DNS ⇒Configuration Automatic ⇒Disable existing DNS|
|Device ⇒ttyS1(com1) o ttyS2 (com2)|
|Modem ⇒Query Modem to see the results (if you do not obtain the results, change the ttySx device).|
After entering the login name and password, we will be connected to the Internet (to check that we are connected, execute ping www.google.com for example). Here, we have used the kppp package, but we could as easily have used linuxconf or gnomeppp indistinctly).
A quick way of configuring pppd in Debian consists of using the pppconfig program, which comes with the package. pppconfig configures files such as the preceding ones after asking the user some questions through the menu interface. Another option for using pppd consists of executing it from wvdial, which comes with the wvdial package. Instead of making pppd execute chat to dial and negotiate the connection, wvdial dials, carries out the initial negotiation and then starts up pppd so that it can do the rest. In most cases, with just the telephone number, username and password, wvdial can start the connection.
Once PPP has been configured, for it to work with, for example, my_isp, we must edit /etc/network/interfaces so that it includes a section such as the following (the ifup, ifdown commands use the pon and poff commands to configure PPP interfaces):
iface ppp0 inet ppp provider mi_isp
with this section, ifup ppp0 executes:
It is not currently possible to use ifup down to perform a supporting configuration of the PPP interfaces. As pon disappears before pppd has finished establishing the connection, ifup executes the up scripts before the PPP interface is ready to be used. Until this fault is resolved, it will still be necessary to configure the connection later in /etc/ppp/ip-up or /etc/ppp/ip-up.d/.
Many broadband Internet Service Providers (ISP) use PPP to negotiate the connection even when the clients' machines are connected through Ethernet and/or ATM networks. This is achieved through PPP over Ethernet (PPPoE) which is a technique for encapsulating PPP flow within Ethernet frames. Suppose that the ISP is called my_isp. First, we must configure PPP and PPPoE for my _isp. The easiest way of doing this consists of installing the pppoeconf package and executing pppoeconf from the console. We then edit /etc/network/interfaces so that it includes a fragment such as the following:
iface eth0 inet ppp providermi_isp
Sometimes, problems arise with PPPoE that are related to the maximum transmit unit (or MTU) in DSL (digital subscriber line) lines; you may consult DSL-HOWTO for further details. If the modem has a router, as the modem/router will handle the PPPoE connection on its own and it will appear on the LAN side as a simple Ethernet to Internet gateway.