October 12th, 2005, 22:17
Note: It's best if you have read through the first tutorial (http://screamingelectron.org/forum/archive/index.php/t-1222.html) on initial installation before reading this one. Refer back to this page during actual installation for the Internet connection portion. You'll also need to take a look at the instructions for setting up a firewall (http://screamingelectron.org/forum/archive/index.php/t-1224.html), found on the tutorial for dialup networking.

Of all the tasks in FreeBSD, setting up a broadband connection is probably one of the easiest. All the various BSDs are built around networking, and most broadband connections operate pretty much like an extended LAN, using the same hardware, often called an "ethernet" connection: something that looks like fat phone lines, which plug into similarly fat-looking sockets which resemble telephone jacks.

If you are paying attention during initial installation, you'll see an opportunity to setup networking. If you miss it, you can always go back to the installer by invoking on the commandline (logged in as root): /stand/sysinstall. On the menu that opens, look for Configuration, which allows you to make changes after installation. On the next menu, select Interfaces, which brings you to the same window you get when you say "yes" to that option during the installation.

At this point, you will be presented with a list of interfaces which FreeBSD has detected. These interfaces are a combination of letter abbreviations followed by a number, always starting with zero. If there is only one of each interface, each will have a zero on the end. If your machine possess anything resembling a serial port, FreeBSD assumes it can be used for networking, calling it a plip interface. FreeBSD also assumes you could have a dialup modem on the machine somewhere, and will offer a ppp interface, as well as the older sl (slip) interface, but you aren't likely to be using that.

If FreeBSD can detect an ethernet device or wireless device, it will offer one of a long list of interfaces usually identified by a two- or three-letter code. For example, a standard wireless card on a laptop will be labeled as wi0, and a second one would be wi1, and so forth. The "wi" means wireless. Most of the time, the interface abbreviation will be based on the chipset used. An example would be the "rl" (lowercase RL) interface, which indicates RealTek 8129/8139 chips. The list of possible abbreviations is quite long. If you see anything beyond the standard interfaces listed previously, FreeBSD has decided it found something it knows how to use. If you know you have an ethernet device and FreeBSD doesn't see it, you'll have to research loading the driver module manually, and there's no room to cover that here. Rest assured, FreeBSD has a driver for most ethernet hardware.

When you have determined which item is your broadband connection interface, use the arrow keys to highlight the item and hit ENTER. Running through the scripted process, sysinstall will ask a series of questions. Unless you know, you can usually accept the default answer on each one. Most broadband services require you to use something called DHCP, a protocol whereby your computer periodically asks the ISP to supply an IP address it should use when connecting to the Internet. If your broadband provider says you need DHCP, make sure to answer "yes" to that question. The last thing you'll see is a gray page with blocks to be filled.

We discuss elsewhere (http://screamingelectron.org/forum/archive/index.php/t-1222.html) the Host name you should give your machine (see #7 on that page). To summarize, unless your provider has told you what to use, it's best to choose something fake, something that is not recognized on the Internet as a valid machine name. I recommend you choose a simple four- to eight-letter nickname, followed by a dot, then local.bsd. My own machine at this time is crunch.local.bsd. Most likely the rest of the blocks will be filled in, especially if your machine is already plugged into a working broadband connection. If not, it's okay to leave the other blocks blank. By using DHCP, most details are taken care of automatically.

Once you are finished, hit the TAB key until you highlight the OK button and hit ENTER If you are still in the initial installation of FreeBSD, the last question should be asking if you want to bring up that interface. Unless you have a good reason not to, you'll probably want to say "yes" to that. You should also see some questions about whether this machine will serve as a gateway, FTP server, etc. These are outside the scope of this tutorial, so I'll advise you to say "no" to everything.

The firewall you'll need for your broadband service is the same as for the dialup firewall (http://screamingelectron.org/forum/archive/index.php/t-1224.html) with one exception. The line which identifies your outside interface has to change to match the interface you configured above. For mine, that line near the top of the firewall file looks like this:


Everything else in your /etc/firewall.conf should be the same as the example. To engage the firewall, as root go to the commandline and type:


Should you experience trouble connecting, it won't be a disaster to turn off the firewall for a time by commenting out in your /etc/rc.conf file every line that begins with "firewall" by inserting a hashmark (#) at the beginning. Rerun the netstart command as above and try again. Then join any one of several BSD forums and ask for help. I recommend Screaming Electron (http://screamingelectron.org/), but there are others.