horns
GreasyDaemon.com - Your Guide to BSD Unix home - news - directory
FreeBSD OpenBSD NetBSD MacOS X Daemon News OpenBSD Journal
Networking a BSD System

Networking is fun, it really is. It is also rather easy once you get your network interfaces working properly. With FreeBSD you can configure your network card(s) during the installation. I am unsure about OpenBSD or NetBSD. Once you have your box set up to do networking you can do just about anything.

Many times BSD systems are used as fileservers, firewalls or gateways. It may also act as a dhcp server for a private network. I will touch on these topics briefly with an example of my own home server.

A while back I got a spanking new DSL line installed. Here at my apartment I have an iMac and a FreeBSD server. I also have some RJ-45 cables and an 8 port hub. I have all I need to use my FreeBSD box as a firewall/gateway/fileserver/dhcp server. After months of reading and tinkering in my spare time it is doing what I want... for the most part.

First off I needed the right hardware. You cannot run a firewall/gateway without two NIC cards, so the FreeBSD box has two cards. I installed the system and configured the two cards. One was set up to the public address assigned to my DSL line and the other I set to 192.18.1.2 for my private network. Right after the install I also set up a firewall with a little help from the FreeBSD site. I use an open firewall as I have yet to learn how to implement a more complete set of firewall rules.

Next I had to get my iMac connected to the internet through the server since I only have one IP. I did this using natd, the network address translation daemon. I found the FreeBSD Diary had great information on natd and ipnat which are the tools I use to make my network run. After some tinkering I was able to get online with my iMac. I actually ran into a small problem with setting this up so after I discovered my problem I shared with the FreeBSD Diary so the documention made note of it. If you intend on using natd or ipnat, read those web pages. You will avoid many headaches with a few minutes of reading.

At this point I was using a static IP on the iMac to talk to the FreeBSD server and the internet. That worked fine but I wanted to get dhcp going on my home network because it was something I had to set up at the office. I use my home network to test things I need to do at work. I used the FreeBSD site once again to learn how to set up dhcp. It was rather easy to get it going. I now use dhcp on the iMac to get a dynamic IP when it boots up. As I add more computers to my home network, perhaps an OpenBSD and NetBSD machine, I will be able to use dhcp to get them running.

Lastly I needed to use the FreeBSD box as a fileserver for my iMac which has a very small hard-drive. A great solution for setting up an AppleShare/IP fileserver on a FreeBSD or any BSD box is Netatalk. It works seemlessly with MacOS networking and has the added advantage of running on a filesystem which is not prone to B-Tree errors like the MacOS. The Netatalk distribution provides very helpful information for getting it installed. There is also a port for it, so you can simply use that. When using the port, be sure to use netatalk-asun, a patched version of Netatalk which allows you to connect to the Netatalk server over IP which is faster than regular Appletalk. It also let's you talk to the server from a remote location.

If I needed to connect to the FreeBSD box for a Windows machine I could set up Samba. That comes with a graphical web-based interface which allows you to set up Samba with a web browser. You can even set up Netatalk and Samba to be aware of eachother so they fight nice. Having both of these file server protocols set up on a BSD box makes for a great solution on a hetergeneous network.

For more information on networking, you can use the search tool below to learn more about a specific topic or you can use the links below and dig until you find the information. If there is information that you cannot find and would like it included on this page, I can do an update. If you also have links which you think would be helpful here, please let me know about them.

Related Links:

GreasyDaemon.com


FreeBSD
Powered by
UdmSearch
O'Reilly & Associates