Troubleshooting issues with pf (or not) on FreeBSD
December 20, 2024 —
Nico Cartron
Context
I was finalising the pf
configuration on one of my FreeBSD servers, like a
gentleman, but for
some reason, this very specific server would allow inbound connections, but
outbound connections (e.g. DNS requests or ping) would not work.
Fixing it
It took me a few minutes to understand what was going on.
But as usual, in the end: always come back to the basics!.
I compared the /etc/resolv.conf
configuration with other servers that were
using the same DNS servers, and this caught my eye:
root@XXX:/home/nc # cat /etc/resolv.conf
namserver 193.17.REDACTED
namserver 193.17.REDACTED
nameserver 2001:67c:REDACTED:c001
nameserver 2001:67c:REDACTED:c02a
^ I was "just" missing an e
on the IPv4 nameservers.
Since I was using that server mostly for incoming RSYNC over SSH, I never
noticed this issue - it only became apparent when I checked that everything
worked fine after I enabled/configured pf
.