Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Setting Up a DSL PPPOE Connection

There are many different ways to connect to the Internet, and there are many different commercial solutions offered by ISPs, giant network corporations, and the regional or governmental telephone companies. One of the newest and increasingly popular packages being snapped up by consumers (at least in the U.S.) is the Digital Subscriber Line, or DSL service.

DSL service is offered in a variety of packages, ranging from 256Kbps–640Kbps to 4.5Mbps–7.1Mbps. The service, which presently uses copper telephone lines from a central office to the home, is often cheaper than dedicated Internet connections or Integrated Services Digital Network, or ISDN lines. Like ISDN, a DSL connection offers voice and digital transmissions over the same phone line. Unlike ISDN, DSL does not break voice and data into different channels over a single line, but instead uses a different frequency for data transmission. This necessitates the use of digital filters for all phone lines in the home, and the use of a special modem between the phone line and your Ethernet LAN.

DSL service is an "always on" type of Internet service, although you can turn the connection on or off under Linux through software utilities. Using DSL will require the use of a network interface card in your computer or notebook. In order to share the connection with other computers on your LAN, you'll need to have a gateway, firewall, or other computer with at least two network interface cards.

Establishing a DSL connection with an ISP providing a static IP address is fairly easy. Unfortunately, most DSL providers now use a perverse form of the PPP protocol named PPPOE, or Point-to-Point Protocol over Ethernet, which provides dynamic IP address assignment and authentication by encapsulating PPP information inside Ethernet frames. Fortunately, you'll find a solution included with your Red Hat Linux distribution—Roaring Penguin's rp-pppoe clients!

Setting Up a PPPOE Connection

The basic steps involved in setting up a DSL connection using Red Hat Linux involve connecting the proper hardware, then running a simple configuration script. You'll find the necessary steps to establish a basic connection quite easy, and perhaps even easier than setting up a dial-up PPP connection.

First, connect your DSL modem to your phone line. Plug in your Ethernet cable from the modem to your computer's network interface card. If you plan to share your DSL connection with the rest of your LAN, you'll need at least two network cards, designated eth0 (for your LAN) and eth1 (for the DSL connection).

You'll also need your username and password, along with the IP addresses of your provider's DNS servers. The following example assumes that you have more than one computer and will share your DSL connection on a LAN. First, log in as root, and ensure your first eth0 device is enabled and up. You can use the ifconfig command to do this by typing the interface name and hostname like this:

					
   # ifconfig eth0 stinky up
				

Next, bring up the other interface, but assign a null address like this:

					
   # ifconfig eth1 0.0.0.0 up
				

Now use the adsl-setup command to set up your system. Type the command like this:

					
   # adsl-setup
Welcome to the Roaring Penguin ADSL client setup.  First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...

Looks good!  Now, please enter some information:

USER NAME

Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): bball
				

At the first prompt, enter the username you received from your service provider, and then press Enter. You'll see:

INTERFACE

Enter the Ethernet interface connected to the ADSL modem
(default eth1): eth1
				

Enter the name of the interface connected to your DSL modem and press Enter. You'll then be asked about your connection:

Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped.  If you want the link to
stay up permanently, enter 'no'.
NOTE: Demand-activated links do not interact well with dynamic IP
addresses.  You may have some problems with demand-activated links.
Demand value (default no): no
				

After you type your answer and press Enter, you'll be asked about your ISP's DNS servers:

DNS

Please enter the IP address of your ISP's primary DNS server.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.

Enter the address here: 199.45.32.38
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
Enter the address here: 199.45.32.43
				

Enter the IP addresses of your ISP's DNS servers and press Enter at each prompt. The next section will query for your password:

PASSWORD

Please enter your PPPoE password:
Please re-enter your PPPoE password:

After you enter your password (twice), you'll be asked to choose the firewall and IP masquerading rules. It is essential that you review your Red Hat Linux system to ensure that all unneeded services are disabled and that you have installed all errata-, bug-, and security-related fixes for your system!

FIREWALLING

Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE'and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.

The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
          for ensuring the security of your machine.  You are STRONGLY
          recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing
                workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
                for a LAN

Your choice? 2
				

Enter a 0, 1, or 2 to choose the type of system you'll have connected to the Internet. After you press Enter, you'll see:

** Summary of what you entered **

Ethernet Interface: eth1
User name:          bball99
Activate-on-demand: No
Primary DNS:        199.45.32.38
Secondary DNS:      199.45.32.43
Firewalling:        MASQUERADE

Accept these settings and adjust configuration files (y/n)? y
				

Accept the settings by typing a y and pressing Enter. The setup script will then report:

Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
  (But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
  (But first backing it up to /etc/ppp/pap-secrets-bak)
  (But first backing it up to /etc/ppp/chap-secrets-bak)

Congratulations, it should be all set up!

Type 'adsl-start'to bring up your ADSL link and 'adsl-stop'to bring
it down.

To start your connection, use the adsl-start command like this:

					
   # adsl-start
				

Note that unlike a dial-up connection, the DSL connection should be nearly instantaneous. If you do not connect, ensure that your DSL modem is synched with the phone company's central office, that all cables are properly attached, that your interfaces are properly configured, and that you have entered the correct information to the setup script. There is very little troubleshooting to do on your end if you have a working setup that fails to start up. More likely than not, if a working connection becomes inactive, the problem is on the ISP side, not with your setup. This can happen if the ISP's DNS or authentication servers go down. When establishing a connection for the first time, you should follow your ISP's initial directions explicitly to establish a working connection. After you have a working connection, you can then experiment with different settings, such as the size of the Maximum Transfer Unit used by your Ethernet interface. To share ideas, ask questions, or learn more about ISPs in your area, check out the comp.dcom.xdsl Usenet newsgroup.

In this example, IP masquerading is enabled. This means that you can share your DSL connection with other computers on your LAN that use the same subnet address. For example, if the host computer with the DSL connection is named stinky, and has an IP address of 192.168.2.30, other computers on your LAN in the 192.168.2.XXX range can quickly access the Internet service by using the route command, along with the default and gateway options like this:

					
   # route add default gw stinky
				

To stop your connection, use the adsl-stop command like this:

					
   # adsl-stop
				

Besides man pages for the adsl-setup, adsl-start, and adsl-stop commands, you'll find additional information regarding DSL connections and the Roaring Penguin software under the /usr/share/doc/rp-pppoe-2.2 directory.

Share ThisShare This

Informit Network