# location of iptables config file ???

## bbell2610

Anyone know where the config file is stored for the iptables policies that are loaded when the service starts? I find it easier to change rules via the config file than from the command line but don't know where to find the config file. On redhat, it stores the config file "iptables" in /etc/sysconfig. Where on gentoo?

----------

## magic919

Cat /etc/conf.d/iptables and you'll see it.

----------

## ali3nx

The file generated by iptables-save is stored in /var/lib/iptables in gentoo

```
midas ~ # ls -l /var/lib/iptables/

.keep       rules-save
```

I find changing the location of the file to /root/.iptables/rules-save to be a more secure option. Anyone is open to changing the path to wherever they prefer by editing /etc/conf.d/iptables

----------

## bbell2610

I saw the iptables file in the conf.d directory but the comment in the file seems to indicate that the file was only used for "save on stop" and to restore from. Anyway, I modified the policies in the rules-save file and restarted the service ... that seems to do the trick. thanks.

----------

