BSD DevCenter
oreilly.comSafari Books Online.Conferences.


Connecting to the Internet Using PPP or a Cable Modem
Pages: 1, 2, 3, 4

Giving users permission to use PPP

Now let's fine-tune our system for ppp. By default, only root can use ppp, but you don't want to be root just to access the Internet, because that isn't an administrative task. Let's look at the error message, and then fix it. Open up a terminal and log in as a regular user.


Resulting in:

/usr/sbin/ppp: Permission denied

Now as root:

pico /etc/group

Change the network: line to network:*:69:username1,username2, where username1,username2 is a comma-separated list of the users you wish to give ppp access to. Save this file, switch to a terminal one of these users is logged into, and try again:


This time, we see:

default: User access denied

What happened? We put the user in the correct group to use ppp, but we didn't tell ppp. Let's edit ppp's configuration file as root:

pico /etc/ppp/ppp.conf

At the end of the default: section, add the following line:

allow users username1 username2

Again, substitute the actual usernames and save the file. Now your users should be able to connect to the Internet using ppp.

If you would like more information on configuring ppp, check out the Pedantic PPP Primer.

Configuring a cable modem

You don't need to configure a connection to your cable provider, as you are always connected. However, you do need an IP address in order to use the Internet. Your cable provider has computers called DHCP (Dynamic Host Configuration Protocol) servers who will lease you an IP address for a period of time. In order to communicate with these DHCP servers, you must configure your NIC to use the DHCP client software that is built into FreeBSD.

If you don't know the device name of your NIC, use:
dmesg | grep Ethernet

Resulting in something like:

rl0: Ethernet address: 00:00:b4:94:9d:3f

If you're not sure if this is the right NIC, you can type:

whatis rl

and get more information:

rl(4) - RealTek 8129/8139 fast ethernet device driver

When you know the device name for your NIC, type:

and select Configure, and then Networking; use your spacebar to select Interfaces. If you receive a message stating: Running multi-user, assume that the network is already configured?, answer No.

Highlight the entry representing your NIC's device name and press enter.

For the message Do you want to try DHCP configuration on the interface?, answer Yes.

Assuming your cable modem is physically connected to your cable provider and their DHCP server is running, you should receive a message asking if you want to bring your interface up now; answer yes and exit.

Now, let's verify that we will continue to receive the correct DHCP information when we reboot. As root:


Toward the end of your boot messages, you should notice one or more DHCPREQUESTS followed by a DHCPACK and your DHCP information, which should include your IP address, default gateway address, DNS server address, and lease period.

To test your connectivity, try:


You should be taken to the web site that hosts the descriptions of the FreeBSD ports collection -- an excellent opportunity to start browsing and downloading your favourite applications.

In our next article, we'll discuss building an X Server and a Window Manager.

Dru Lavigne is a network and systems administrator, IT instructor, author and international speaker. She has over a decade of experience administering and teaching Netware, Microsoft, Cisco, Checkpoint, SCO, Solaris, Linux, and BSD systems. A prolific author, she pens the popular FreeBSD Basics column for O'Reilly and is author of BSD Hacks and The Best of FreeBSD Basics.

Read more FreeBSD Basics columns.

Discuss this article in the O'Reilly Network Operating Systems.

Return to the BSD DevCenter.


Sponsored by: