Fixing the Confusion Around PPPoE Dial-Up Commands for ADSL and Broadband on Various Linux Distributions

Read more: Explanations of broadband, narrowband, ADSL, PPPoE, virtual dial-up, and related terms

When I first installed Red Hat in a virtual machine, I “Googled” on Baidu countless times, wandered through endless forums and blogs, read post after post and article after article, and tried all kinds of methods, but I still could not find a way to get “broadband” connected to the internet.

Later, it was the same with Ubuntu. Ubuntu’s built-in client simply could not connect, and when I tried to find a solution, the answers I saw were often completely off the mark. It was truly discouraging.

Although commands are broadly similar across Linux distributions, there are still differences in some places. Below is a collection of commands commonly used when configuring PPPoE/ADSL virtual dial-up on popular distributions. Because distribution versions vary quite a bit, package names, paths, and network interface names should be checked against your own environment. Before operating, you can use ip link to check the network interface name, and use your distribution’s package manager to confirm whether rp-pppoe or the corresponding PPPoE client is installed.

Red Hat Linux

On Red Hat Linux, ADSL modem-related commands are commonly used to configure broadband modem operation.

First, check whether PPPoE software is installed and confirm that the version meets your needs. Older references commonly required a version later than 3.5-1. If the version is too old, you can upgrade the software first, for example to rp-pppoe-3.5-3.i386.rpm:

rpm -Uvh rp-pppoe-3.5-3.i386.rpm

Friendly reminder: I do not think upgrading is necessary. If you are sure you want to upgrade, download the appropriate PPPoE package on another computer first, place it under /home/your-username/, and then run the command above. Pay attention to capitalization in the command, and replace the file name with the actual name of the file you downloaded.

After installation, the system usually provides the following four commands:

  • adsl-setup: Configure DNS, user account, password, and other options.
  • adsl-start: Connect to the internet using ADSL.
  • adsl-stop: Disconnect the ADSL internet connection.
  • adsl-status: Check the ADSL connection status.

Create an ADSL connection:

[root@sample ~]# adsl-setup

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

LOGIN NAME

Enter your Login Name (default root):

Enter the username for the ADSL connection here.

INTERFACE

Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethX, where 'X' is a number.
(default eth0):

Specify the network access device here. If there is only one network card, the default eth0 is usually used. On newer systems, it may no longer be called eth0, so fill in the actual interface name according to the output of ip link.

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' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
Enter the demand value (default no):

Press Enter directly to accept the default setting.

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
Enter the DNS information here:

If you know the DNS server address, enter it here; if not, you can press Enter to skip it. Older references once provided a download link for “National DNS Server IP Addresses”: http://olseeling.qjwm.com/down_1249888.html.

PASSWORD

Please enter your Password:
Please re-enter your Password:

Enter and confirm the ADSL connection password.

USERCTRL

Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes): no

Enter no to prevent normal users from controlling the PPPoE connection.

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. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

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
Choose a type of firewall (0-2): 0

Enter 0, meaning that no firewall will be configured here.

Start this connection at boot time

Do you want to start this connection at boot time?
Please enter no or yes (default no): yes

Enter yes to connect ADSL automatically when the system starts.

** Summary of what you entered **

Ethernet Interface: eth0
User name: caun870293@ca.dti.ne.jp
Activate-on-demand: No
DNS: Do not adjust
Firewalling: NONE
User Control: no
Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
(But first backing it up to /etc/ppp/chap-secrets.bak)
(But first backing it up to /etc/ppp/pap-secrets.bak)

Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.

After confirming that the configuration information is correct, type y to accept the settings.

Start the ADSL connection:

adsl-start

Wait a moment. If startup succeeds, it will usually return directly to the command prompt. The absence of extra output may also indicate that the connection succeeded. You can then check with the following commands:

adsl-status
ip addr show ppp0
route -n

Ubuntu

  1. Open the Applications menu and choose “Accessories” -> “Terminal”.
  2. Enter the following in the terminal window:
sudo pppoeconf
  1. The system will prompt you for the password of the current Ubuntu administrator user. Enter it and press Enter.
  2. When asked about network devices, usually choose “Yes” to let the program detect them, then continue choosing “Yes”.
  3. You will then be prompted to enter the ADSL username and password. When entering the account, delete the original user first and then enter your own account. Apart from the password, you can usually answer “Yes” to all other questions.
  4. Finally, it will ask whether to dial automatically at startup. If you choose “Yes” (Y), it will dial automatically at boot by default without prompting, and you can access the internet directly. If you choose “No” (N), you need to manually enter the terminal and run the following when you want to dial:
sudo pon dsl-provider

Common commands are as follows:

  • pon: Enable the ADSL connection.
  • poff: End the ADSL connection.
  • plog: View ADSL messages, useful for debugging.
  • ifconfig ppp0: Check whether the ppp0 interface exists. On newer systems, you can also use ip addr show ppp0.
  • route -n: Check whether the default gateway is correct.
  • nslookup: Check whether DNS can resolve correctly.

These commands can help resolve problems encountered when using ADSL for internet access, and can also be used to debug an ADSL connection.

CentOS

Same as Red Hat Linux.

BackTrack Linux

Same as Red Hat Linux.

Slax

Same as Red Hat Linux.

Leave a Reply