FreeBSD Server 2024 – Configuration

#computers #unix #bsd #servers #freebsdserver2024 #multicastdns #mdnsd #avahi

Well, as you may have guessed, I got fed up with Slackware. It's unfortunate because I thought maybe it would be a good distro to use. But, since it is the most Unix-like of all the Linuxes, I decided I should just go full-Unix. All of the BSDs can claim direct lineage from Bell Labs without all the AT&T proprietary bits. I've always had a fascination with Unix proper too. You need a specific application for it though, and as a server without any GUI is where it truly shines as an operating system. Everyone jokes about the year of the Linux desktop, but Linux really is the system you want to use for a desktop. Turns out BSD is a great choice for a lot of the other stuff that you need computers for.

Right off the bat FreeBSD was immediately the better choice; 1) faster to load, 2) it recognized all of my nics and they could be configured before doing the install, 3) the install was incredibly quick and 4) because it let me configure a wifi adapter before even doing the installation, once it was done installing and I added a second user, I could turn off the monitor and just SSH into the box to continue the configuration from my laptop while not have to physically be on the server to finish setting everything up.

NOW, there have been challenges. Stuff that I simply don't know or have forgotten about after years of habitual Linux use. Even though Linux has man pages, I never consult them because they're always obtuse and not very helpful compared to the myriad of Stack Overflow / forum posts, and Reddit threads that all have quick and easy ways to tackle whatever the issue is without actually having to understand what it is that you're doing, or the reason behind why you're copying and pasting complex commands into your terminal (we've all been there).

On the other hand, the FreeBSD Handbook and online documentation is miles ahead of anything that any Linux distro has... IMO, anyway. I think this is in part due to the fact that there tends to only be one or two ways of officially accomplishing a particular server task. But having one specific location to consult is actually really nice.

Also, because everything is a complete package rather than a collection of disparate software like Linux is, FreeBSD does tend to be easier to understand from an administrative perspective. When I first booted up the system there were 0 (“zero”) packages installed when I issued the command:

pkg info

The system also wants to be configured because it doesn't necessarily have a pre-determined purpose. Whereas, with Linux if you want to accomplish a particular task, there's usually a distro for that.

Multicast DNS / Avahi

So far this is the only issue that I've had. Honestly, it's not the behavior that you want from a server on a production network. For my home network it's perfectly fine though. I would never configure a server like this for use in a business... That's a lie. Maybe for a small business (less than 50 workstations). What I'm about to describe is simply not going to be a recommended configuration.

Disabling /etc/rc.d/resolv is probably not idea, and I don't know if I broke other functionality... But I had to disable that service for multicast dns to work. If, when installing FreeBSD, you tell it to use DHCP, it will also config and deploy resolv automatically (at least I don't think I had a choice on the installer). I wanted the server to just show up as “tallgeese.local” so that I didn't have to remember IP addresses, or have to run a dedicated DNS server. Multicast DNS solves this problem. Avahi was the package that worked for me. I don't know this for certain, but I do know that Apple contributes to FreeBSD because the Darwin kernel is essentially a modified FreeBSD kernel. That being said (and based on what I understand), Avahi (branded as Bonjour) is what MacOS uses to show up as user@macbook.local.

This article helped me a bit. Also, this article as well.

I have yet to use the ports system because so far the binary packages already built for the system are working just fine. I would eventually like to play around with the ports system though. It is one of the more compelling aspects of FreeBSD, however, the handbook advises against mixing binary packages and ports together though. So it's one of those things that you have to decide what it is that you're using the system for first, and also whether you want stable or bleeding edge.

I've compiled software my own systems in the past, and it has never been all that enjoyable of an experience. So I just kept to the binary packages for FreeBSD, because that's what I know. Plus, there hasn't been anything that I've needed to use ports for yet. I'm not running anything crazy, just a ZFS raid for storage and NFS for sharing those files with my laptop and desktop. Technically this all could have been done with SSH, but I haven't set up logging in with keys yet... I might ditch the NFS config in favor of SSHFS. We'll see.

What's Next?

I need some ideas for jails or VMs to run on a home network. So I'm looking to hear from all of you. If you've made it this far, I'm sure you have some thoughts.

Setting up ZFS and raidz was so incredibly simple that it wasn't worth doing a video or blog post on. Honestly the chapter on ZFS in the FreeBSD Handbook is comprehensive and complete enough that it was all that I needed, the commands I gave the computer worked. ZFS was definitely designed with simplicity in mind and to be quick for sysadmins to deploy. I ordered three 3TB white label drives from Amazon (around $140 for all three), plugged them in, ran maybe 6 commands, and it was ready to use.

Setting up NFS was kind of a pain, and I'm still running into permissions issues. But honestly, it's not anything that I can't work-around, understanding POSIX file permissions is a prerequisite though. If you were to set this up in an office setting, it would need to work in the gui... There are ways to get it done like recurrsively making all files in the NFS share executable by all groups and users. On the FreeBSD machine, you're defining which workstations can even access the share, so broadly allowing access at the file level is only somewhat risky. Since it's just a text file (/etc/exports) you can manage it with a script if you would like, or just manually edit stuff if you only have a few machines to maintain.

As far as hardware is concerned, there are definitely upgrades that need to be made... Not only to the new server, Tallgeese, but also to my desktop, Whitebase. I need to just breakdown and buy a package of like 5-10 case fans. There are definitely three that need to be replaced in Whitebase and two that are are very old in Tallgeese... All of the fans currently running in my machines are at least a decade old. New fans would quiet this room down a bit, but honestly, it's not all that loud. I might have to ask my wife though. Just because she hasn't said anything doesn't mean that it doesn't bother her.

Eventually I need to spend the time and money to upgrade the entire wireless network in the house; a new router and new wireless cards.

Anyway, each of those ideas are blog posts in and of themselves.