[Bug 256410] pf: Add pf_default_rules option

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 10 Jun 2021 20:03:52 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256410

--- Comment #10 from Thomas Steen Rasmussen / Tykling <thomas@gibfest.dk> ---
Alright, I've attached an updated version of the patch which checks for the
existence of $pf_default_rules_file (which defaults to /etc/pf-default.conf in
/etc/defaults/rc.conf) and if the file exists it loads it, and if not it loads
the rules in $pf_default_rules.

Example:

[tykling@nuc2 ~]$ sudo service pf restart
Enabling pfno IP address found for foo
/etc/pf-typo.conf:2: could not parse host specification
pfctl: Syntax error in config file: pf rules not loaded
/etc/rc.d/pf: WARNING: Unable to load /etc/pf-typo.conf and
pf_default_rules_enable is set to YES.
/etc/rc.d/pf: WARNING: pf_default_rules_file /etc/pf-default.conf not found,
looading pf_default_rules: block drop log all
.
[tykling@nuc2 ~]$

After setting pf_default_rules_file to an existing file:

[tykling@nuc2 ~]$ sudo sysrc pf_default_rules_file="/etc/pf.conf"               
pf_default_rules_file: /etc/pf-default.conf -> /etc/pf.conf
[tykling@nuc2 ~]$ sudo service pf restart
Enabling pfno IP address found for foo
/etc/pf-typo.conf:2: could not parse host specification
pfctl: Syntax error in config file: pf rules not loaded
/etc/rc.d/pf: WARNING: Unable to load /etc/pf-typo.conf and
pf_default_rules_enable is set to YES.
/etc/rc.d/pf: WARNING: Loading pf_default_rules_file: /etc/pf.conf
.
[tykling@nuc2 ~]$

-- 
You are receiving this mail because:
You are the assignee for the bug.