📖 ~1 min read
Table of contents
Symptom & Impact
Remote administration is lost immediately after firewall reload, creating outage risk.
Environment & Reproduction
Occurs after editing /etc/pf.conf without explicit management allow rules.
service pf restart
pfctl -sr
ssh user@host
Root Cause Analysis
Rule order or default deny behavior blocks inbound port 22 before pass rule evaluation.
Quick Triage
Use console access to inspect active rules and counters.
pfctl -sr -v
pfctl -si
netstat -an | grep '.22 '
Step-by-Step Diagnosis
Test candidate ruleset syntax and identify which rule drops SSH packets.
pfctl -nf /etc/pf.conf
tcpdump -ni any port 22 -c 30
pfctl -vvsr | head -n 120

Solution – Primary Fix
Insert explicit management allow rule before block directives and reload pf.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
cp -a /etc/pf.conf /etc/pf.conf.bak
awk 'NR==1{print "pass in on egress proto tcp from 198.51.100.0/24 to any port 22 keep state"}1' /etc/pf.conf.bak > /etc/pf.conf
pfctl -nf /etc/pf.conf && service pf reload

Solution – Alternative Approaches
Enable temporary fail-open maintenance policy with automatic rollback timer.
echo 'set skip on lo' > /tmp/pf-safe.conf
cat /etc/pf.conf >> /tmp/pf-safe.conf
pfctl -f /tmp/pf-safe.conf
Verification & Acceptance Criteria
SSH connections succeed from approved management networks and policy remains active.
ssh -o ConnectTimeout=5 [email protected]
pfctl -sr
pfctl -ss | head
Rollback Plan
Restore prior pf.conf backup and reload if new rule set affects production traffic.
cp -a /etc/pf.conf.bak /etc/pf.conf
service pf reload
Prevention & Hardening
Validate pf.conf in CI and enforce out-of-band access before firewall changes.
pfctl -nf /etc/pf.conf
Related Errors & Cross-Refs
Can overlap with routing asymmetry, CARP failover rules, and NAT misordering.
Related tutorial: View the step-by-step tutorial for FreeBSD 12.
View all FreeBSD 12 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
FreeBSD pf firewall guide and secure rule design practices.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.