LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How can i go back to default iptables settings in Ubuntu? (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-go-back-to-default-iptables-settings-in-ubuntu-747863/)

judoka 08-16-2009 12:46 AM

How can i go back to default iptables settings in Ubuntu?
 
I'm running Ubuntu 9.04 and started messing around with my firewall, it got a little too complecated for me, so I just would like to be able to somehow restore the default iptables setting. Any idea how I can do this?

judoka 08-16-2009 01:26 AM

And since I installed some programs already if I do $ iptables -F won't it put my system in jeopardy since some port could have been unblocked as a result of installing some packages?

centosboy 08-16-2009 05:52 AM

If the added rules are run time only - that is if they have been added via the command line and not saved, then a restart of iptables should do it.

judoka 08-16-2009 11:13 AM

I've actually saved the rules.

centosboy 08-16-2009 12:27 PM

me personally, i would uninstall and reinstall iptables, but consider the security implications between the uninstall and install time :)

judoka 08-16-2009 03:10 PM

How do you uninstall and install iptables? As far as the security implications I'll just disconnect from the internet while installing and reinstalling them.

shizzles 08-17-2009 03:37 PM

try doing $ iptables-save > somefile Then edit the file as you see fit.

Once done run $ iptables-restore < somefile

I try to put a $ -F at the begining of the file to clear out the iptables and load the rest of the file. This will clear your existing rules and reload the ones that you just edited.

salasi 08-18-2009 05:11 AM

Quote:

Originally Posted by judoka (Post 3645436)
I've actually saved the rules.

If you mean that you used iptables-save to save the rules while they were still in a good state, you could use its companion iptables-restore to restore them (see the man pages for options). If you did something else, the formats may not be exactly what is required for iptables-restore. You could fix that, I suppose...


All times are GMT -5. The time now is 04:38 PM.