I think it would be nice to have a /etc/init.d/ipfilter script that excecutes a /etc/ipfilter/rc.firewall on start and /etc/ipfilter/flush.firewall on stop. That way you don't have to edit files in /etc/init.d to setup your firewall.
Created attachment 27 [details] ipfilter init-script might need some love but I'm not a good bash-programmer :)
we could add a default firewall to /etc/conf.d, but it really should be integrated into our new "net" design.
hmm .. noticing now that I wrote the wrong name, shouldn't be ipfilter, should of course be iptables. Anyway, an iptables-ebuild that depend on the net is probably what we want. If the actual scripts lives in /etc/conf.d/iptables.{start,stop} or in /etc/iptables/iptables.{start,stop} doesn't really matter to me.
Added Azarah to the CC-list of this issue.
Good idea would probably to place this "after" pcmcia (for all those who use pcmcia networking) as well as depends on net. as for the firewall script, some recommend mon-motha's scripts, or we could brew our own one.
A nice easy to implement iptables script is gShield (http://muse.linuxmafia.org/gshield.html) I've got it running under gentoo quite easily.
I vote to not include any default firewall rules. So I won't. Im gonna put this together the best I can figure out. Where should firewall state be saved? My first impression is to store it in /etc/conf.d/firewall, so I will.
#!/sbin/runscript # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/iptables,v 1.0 2002/04/01 24:10:28 ssrit Exp $ depend() { need net } start() { ebegin "Loading iptables state and starting firewall" if [ ! -f /etc/conf.d/iptables ] then iptables-restore < /etc/conf.d/iptables fi eend $? } stop() { ebegin "Stopping firewall and saving iptables state" iptables-save > /etc/conf.d/iptables iptables -F eend $? } If this is good, here it is. I just wanted to contribute. =) Very simple obviously.
*** This bug has been marked as a duplicate of 2355 ***