[CentOS] Screwed up my iptables firewall

Wed Jan 25 17:05:55 UTC 2006
James Pifer <jep at obrien-pifer.com>

On Wed, 2006-01-25 at 11:38 -0500, Barry L. Kline wrote:
> James Pifer wrote:
> > I have a server that I screwed up iptables on. Now when the server
> > restarts it locks up trying to apply the firewall rules. 
> > 
> > How can I remove the rules (set to all ACCEPT) in a linux rescue mode or
> > knoppix or other way of getting to the file system? 
> > 
> > Any suggestions how to fix this?
> > 
> Those rules are stored in /etc/sysconfig/iptables, so you have some choices:
> 1) Boot into rescue mode, then do /sbin/service iptables stop, then exit 
> to boot the system normally.  You'll have no firewall at this point. 
> Create the rules as you want them (with iptables command), then do an 
> /sbin/service iptables save to fix the file.
> 2) Boot into rescue mode, then edit /etc/sysconfig/iptables to make the
> firewall what you wanted in the first place, then exit to boot normally.

Thanks for the quick responses. Combination of interactive and then
correcting the rules and saving did the trick.