The Four Lakes Amateur Radio Club has been using a
Raspberry Pi 1B+ for a couple of years as our
DHCP/Samba/NAT server for events like ARRL Field Day.
As I had a spare RPi 2 sitting around, I decided to see if I could use
FreeBSD on that device instead, instead of Debian based Raspbian.
I am using the FreeBSD 11.1-RELEASE image for the the OS, the instructions on
the FreeBSD website were easy to use to get the image transferred to an SD
card. Once we were booted up and running, using the ethernet port for network
connectivity, I installed the wpa_supplicant package, I probably could have
skipped this step and used the wpa_supplicant installation in the base system.
I had to update /boot/loader.conf
Additions to /etc/rc.conf
The ntp additions are due to the RPi not having a Real Time Clock, these
settings force the RPi to update the time from network clocks at boot time.
Create the /usr/local/etc/wpa_supplicant.conf file
group=CCMP TKIP WEP104 WEP40
And then reboot to have all of the changes take effect.
Once we were up and running on WiFi, I reconfigured the ethernet port for a
static IP by changing the configuration in /etc/rc.conf from
ifconfig_ue0="inet 10.0.0.1 netmask 255.255.255.0"
Then I installed dnsmasq and samba.
pkg install dnsmasq
pkg install samba48
workgroup = WORKGROUP
server string = Samba Server Version %v
netbios name = fpi
wins support = yes
security = user
passdb backend = tdbsam
map to guest = Bad User
log file = /var/log/samba4/log.%m
log level = 3
comment = Field Day
create mask = 0664
directory mask = 0775
force group = nobody
force user = nobody
guest ok = yes
path = /home/fd
read only = no
And added to /etc/rc.conf again
The directory where we will be sharing files from is /home/fd, so we need to
create it and set permissions.
chown nobody:nobody /home/fd
chmod 775 /home/fd
Now for the NAT portion, since I used to run an OpenBSD firewall for my home
network, I decided to use pf instead of ipfw.
So we need to make some more changes to /etc/rc.conf
And create /etc/pf.conf
localnet = $int_if:network
nat on $ext_if from $localnet to any -> ($ext_if)
Yes, there should probably be more rules here to restrict access and ports.
Now it's time for another reboot and everything should be working.