LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2009, 12:46 AM   #1
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Rep: Reputation: 16
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?
 
Old 08-16-2009, 01:26 AM   #2
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
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?
 
Old 08-16-2009, 05:52 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
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.
 
Old 08-16-2009, 11:13 AM   #4
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
I've actually saved the rules.
 
Old 08-16-2009, 12:27 PM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
me personally, i would uninstall and reinstall iptables, but consider the security implications between the uninstall and install time
 
Old 08-16-2009, 03:10 PM   #6
judoka
Member
 
Registered: Jul 2009
Distribution: Ubuntu 14.04 LTS, CentOS
Posts: 218

Original Poster
Rep: Reputation: 16
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.
 
Old 08-17-2009, 03:37 PM   #7
shizzles
LQ Newbie
 
Registered: Jun 2005
Location: Chicago
Distribution: Ubuntu Server & Debian 6
Posts: 23

Rep: Reputation: 1
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.
 
Old 08-18-2009, 05:11 AM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by judoka View Post
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problemeem with Theme reverting back to default in Ubuntu LinuxNewbie420 Linux - Newbie 0 01-09-2009 02:13 PM
How to reset monitor settings to default autodetected settings in openSUSE? chengas123 Linux - General 2 09-17-2008 11:24 AM
Changing default boot OS back to Ubuntu without being able to boot Ubuntu revenge02 Linux - Newbie 5 04-16-2007 08:37 PM
iptables firewall falls back to default after reboot lx3000 Linux - Security 8 03-31-2006 04:02 PM
Wine Settings back to defaults? TB2 Linux - Software 0 02-24-2006 06:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration