Linux Home Networking, Part 5
Dialing into the Internet
Setting up a Linux server as a router with two Ethernet network adapters is more straightforward compared to the dynamic dial-up connection presented in this article because of two things. The first is the fixed IP addresses involved. Second, routing and NAT configuration is static. With a dial-up connection these change. The IP address for the dial-up connection is normally assigned using DHCP by the ISP when a connection is made. Likewise, the routing configuration must be changed to accommodate the new IP address.
This article takes a look at how to configure pppd. Pppd is the Linux point-to-point protocol (PPP) daemon. It provides a network interface to a serial connection that is typically an analog modem or possibly an ISDN adapter. PPP is also used on some non-dial-up connections. More specifically, some ISPs provide DSL and cable modem connections using PPP. In this case, the connection to the PC is via an Ethernet connection is the same as using fixed IP addresses but a protocol called PPP over Ethernet (PPPoE) is used. PPPoE operates the same way PPP does so we will not look at this in any more detail but concentrate on pppd. Typically just the programs are different and some configuration details differ.
Two items must be addressed for the dial-up connection to be used. The first is the pppd program that provides the connection. The second is the ipchains program.
The pppd program essentially replaces one of the Ethernet drivers presented in the prior article that is connected to another network possibly through a cable or DSL modem. The pppd program can be configured to run multiple connections but we will be looking at how it handles one serial port such as ttyS1.
The pppd program uses a number of configuration files. These can be set up using a number of configuration programs including linuxconf, found on Red Hat and related Linux distributions. We will not go into details on pppd configuration but rather look at its overall operation. The details can be found in man pages or HOW-TO files. If you use the linuxconf program then most of the configuration can be done from its menus and dialog boxes.
The pppd program is normally started when Linux boots. A script typically provides configuration parameters including what serial port to use and whether a connection should timeout after a specified idle time. Additional script files are normally referenced by this script so the pppd program can provide features such as logging and running a script when a connection is made and another when it is broken.
There are a number of issues since pppd can handle more than just IP traffic. Features such as IPX protocol support are beyond this article. Some details are more common. For example, the initial handshake protocol can be specified. PAP is the usual protocol used by ISPs but there is also CHAP. User name, passwords and domain names are details that these protocols require, normally supplied by the ISP when an account is opened with them. These parameters are placed into script files handled by programs like linuxconf. All you need to do is provide the details.
The pppd daemon runs in the background. When set up for demand dialing, the program will initiate a call to the ISP when the PC needs to route information through the network adapter. The usual adapter name for a single serial connection is ppp0.
If the local PC is the only one using the serial connection then the job is done, but we are interested in providing Internet access to the entire network accessible to the other network adapter.