PDA

View Full Version : saving rules


sangfroid
May 15th, 2010, 17:47
Hi,

I would like to know how do I save the rules permanently which were created with ipfw ?

I created few rules like

ipfw add allow tcp from any to any 80

But after i reboot the system, the rule is gone..how do I save rules from running configuration so that it becomes permanent ?

DutchDaemon
May 15th, 2010, 18:53
ipfw


LIST OF RULES AND PREPROCESSING
To ease configuration, rules can be put into a file which is processed
using ipfw as shown in the last synopsis line. An absolute pathname must
be used. The file will be read line by line and applied as arguments to
the ipfw utility.



ipfw [-cfnNqS] [-p preproc [preproc-flags]] pathname


See also
grep ^firewall /etc/defaults/rc.conf
and
/etc/rc.firewall

sangfroid
May 15th, 2010, 20:28
I didn't get you clearly...can you please provide some more information ?

(I am infact new to FreeBSD)

aragon
May 15th, 2010, 21:05
Put your rules into a file such as /etc/ipfw.conf, then add this to /etc/rc.conf:


firewall_enable="YES"
firewall_type="/etc/ipfw.conf"