[Bug 256410] pf: Add pf_default_rules option

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

--- Comment #10 from Thomas Steen Rasmussen / Tykling <thomas_at_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_at_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_at_nuc2 ~]$

After setting pf_default_rules_file to an existing file:

[tykling_at_nuc2 ~]$ sudo sysrc pf_default_rules_file="/etc/pf.conf"               
pf_default_rules_file: /etc/pf-default.conf -> /etc/pf.conf
[tykling_at_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_at_nuc2 ~]$

-- 
You are receiving this mail because:
You are the assignee for the bug.
Received on Thu Jun 10 2021 - 20:03:52 UTC

Original text of this message