openbsd-misc
[Top] [All Lists]

Re: pf.conf and 'include' option

To: OpenBSD Misc <misc@openbsd.org>
Subject: Re: pf.conf and 'include' option
From: Jan Johansson <janj-openbsd@wenf.org>
Date: Wed, 31 Oct 2001 21:13:24 +0100
In-reply-to: <00bb01c16240$46def390$1601a8c0@andrey>; from asmagin@rapidds.com on Wed, Oct 31, 2001 at 01:14:33PM -0600
References: <00bb01c16240$46def390$1601a8c0@andrey>
Sender: owner-misc@openbsd.org
User-agent: Mutt/1.2.5i
On Wed, Oct 31, 2001 at 01:14:33PM -0600, Andrey Smagin wrote:
>Is there any way to use some kind of 'include' option in pf.conf
>to be able to construct the final ruleset from several small
>rulesets, each in a separate file? For example if I need to
>block several hundreds of Nimda infected hosts from any access
>to my server, I have to edit the main pf.conf file all the time
>- is it the only option?

This is UNiX doit with a onliner or a shell script.

--make_me_rule_file.sh--
#!/bin/sh --

cd /etc/pf

rm final.pf

for file in *.pf ; do

  cat ${file} >> final.pf

done

pfctl -F a -f /etc/pf/final.pf

--make_me_rule_file.s--

Its ugly but I think it works..

<Prev in Thread] Current Thread [Next in Thread>