# saving rules



## sangfroid (May 15, 2010)

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 15, 2010)

ipfw(8)


```
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
[cmd=]grep ^firewall /etc/defaults/rc.conf[/cmd]
and
/etc/rc.firewall


----------



## sangfroid (May 15, 2010)

I didn't get you clearly...can you please provide some more information ?

(I am infact new to FreeBSD)


----------



## aragon (May 15, 2010)

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"
```


----------

