Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I don't need iptables on my computer, since I'm behind a NAT Server and a router. I, therefore, flushed all the rules I had left to disactivate the firewall. I'm wonder if I could probably prevent iptables from starting on boot as well. My first trial was do blacklist all modules related to it on /etc/modprobe.d/blacklist.conf, which were all together ip6table_filter, ip6_tables, ip6table_filter, iptable_filter, ip_tables, iptable_filter and x_tables. But it did not worked out.

My question is how can I avoid iptables to get loaded at startup?

share|improve this question

4 Answers 4

up vote 0 down vote accepted

If You are determined to get clear of iptables:

sudo modprobe -r ip6_tables iptable_filter ip_tables

could do the trick for you...

Of course, If You're satisfied with result it could be made permanent...

share|improve this answer

My first trial was do blacklist all modules related to it on /etc/modprobe.d/blacklist.conf, which were all together ip6table_filter, ip6_tables, ip6table_filter, iptable_filter, ip_tables, iptable_filter and x_tables.

Well, if you have no rules and the firewall is disabled, those modules aren't going to be loaded anyway.

My question is how can I avoid iptables to get loaded at startup?

Strictly speaking, iptables is a utility for managing the firewall functionality (aka netfilter) built into the Linux kernel. So your question turns into how do I remove firewall functionality from the kernel?

The answer to that is...build your own kernel, after configuring it appropriately.

share|improve this answer
    
> Well, if you have no rules and the firewall is disabled, those modules aren't going to be loaded anyway. If so, then I do not understand the last lines from the dmesg output: >[ 20.477633] ip_tables: (C) 2000-2006 Netfilter Core Team <br> >[ 20.768856] ip6_tables: (C) 2000-2006 Netfilter Core Team <br> It seems to be loaded after any boot. Otherwise you're answer to compile my own kernel may be an option. –  Til Hund Jun 12 '12 at 10:01
    
@TilHund - you cannot blacklist modules built into the kernel - the only way is to force-unload them if visible, else compile the kernel without them. –  izx Jun 12 '12 at 11:46

Flushing iptables rules / accept everything

You may skip this step since you mentioned in your question that you have flushed all the rules.

iptables -X &&
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

After flushing your iptables rules.

Run:

  • iptables-save > save-file

  • iptables-apply save-file

share|improve this answer
    
I did indeed this step already, but thank you anyway. –  Til Hund Jun 12 '12 at 9:53
    
@TilHund - You did this step and when you restarted you had again iptables rules setup? –  pl1nk Jun 12 '12 at 12:49
    
Yes, I did it and it appears again on any startup. –  Til Hund Jun 15 '12 at 9:41

Ubuntu does not come with firewall enabled by default. However, it does come ufw package/service, which is the default firewall program, as far as I know it is not active by default. You could check if the service is active with rcconf, you need to install the package

sudo apt-get install rcconf dialog

You will need dialog to run rcconf even though it is not marked as a dependency.
More information on ufw here: https://help.ubuntu.com/12.04/serverguide/firewall.html
There are other firewall packages, I don't know them all, but you could do a

apt-cache search firewall | less

And see if there are some that sounds you familiar, for a service or package installed. Other ones I've seen in some installations are:

  • firestarter
  • fail2ban
share|improve this answer
    
Yes, I have ufw installed and disabled it in the hope this would prevent ip-tables from booting, which was without avail. –  Til Hund Jun 12 '12 at 9:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.