For the longest time I’ve been using a craptastic stock Linksys wifi router to handle all my incoming traffic from the interwebs at home, a role which it performs adequately at best. However, I’ve also got another hacked Linksys acting as a wireless bridge to a LAN segment on the other side of the house, which means that WPA or wireless security is out the window. I also had no real firewall between my network and the internet, which can be a dangerous game when I’ve got some open r/w shares on the network. Thus, my home network pretty much resembled a block of swiss cheese, where outsiders with any skills could get in, and neighbors in the apartment complex behind me could pilfer my wifi for internet access. However, my mom had this ancient Dell Inspiron laptop that was sitting in her closet, collecting dust. Ancient, of course, is a relative term, since it’s actually got 512MB RAM and a 2GHz processor under the hood. Nevertheless, it lacks integrated wifi and is about the same size as a medical textbook. A large medical textbook. Tired of my porous network, and always ready to inherit old hardware from random family members, I decided that the best solution to my problems would be to build myself a little system which could handle firewall, DHCP, DNS, printing, and web serving duties.
The laptop has an integrated NIC, but in order to do firewall duties effectively, I knew it was a good idea to have another card installed. A quick trip to Fry’s and I found myself a gigabit PC card to plug in for about $20. Having used OpenBSD at an earlier job, I figured that would be the route to go as far as an OS was concerned, but unfortunately, a fair slice of hardware was undetected on installation. While I could probably have rooted out the problems and installed all the right stuff, I’m lazy, so I just opted to try FreeBSD for the first time, knowing that it offered OpenBSD’s pf firewall, which is what I was really after in the first place. After installing the OS from a memory stick, I was pleased to find that all my hardware was detected, so off I went.
Step 1: Installing FreeBSD
So installing FreeBSD over the network sounds a lot harder than it actually is. While I could have burned it to CD and installed that way, I opted for a memstick installation, since I had one sitting right in front of me, and I’m lazy. The documentation packages are provided but no other packages, which is fine, since I was planning on doing a network installation. After downloading the 8.0 image, I followed the instructions verbatim and used dd to image the memstick:
# dd if=8.0-RELEASE-i386-memstick.img of=/dev/sdg bs=10240 conv=sync
If you’ve never used dd, I’d strongly recommend reading the man pages, and triple checking that the of= field is your destination device. Otherwise you could nuke something you really didn’t want to. After imaging the memstick, I unplugged it, jacked it into my laptop, fired it up, chose the USB device as the boot device, and viola! Installation prompts!
If you’ve ever installed anything other than Windows, the installation prompts should make a fair amount of sense. The first important question had to do with HDD partitioning, but since I had no idea how a BSD system would sort its apps, I simply let the installer choose. Given that my intent was to use this as a server-class device, there was really no reason to install x11 or xorg stuff at the beginning, since a GUI is useless if it’s going to sit in a corner with the lid closed all the time. I installed essentially everything else, except the source code, since I didn’t think I’d be needing it. I was wrong, but nevertheless, I learned later how to go grab sources when I needed them. Network transfers went smoothly, and in no time I was up and running with FreeBSD. Woohoo! Now, how do I make this do all the stuff I want??