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 made changes to iptables config file in /etc/iptables/filter in ubuntu and want to reload them. I read the man page and also googled but couldn't find the information. Any help will be appreciated.

Thank you
Bala

share|improve this question

migrated from stackoverflow.com Dec 30 '11 at 0:33

This question came from our site for professional and enthusiast programmers.

    
You have neither provided any information about the version of Ubuntu you are using, nor searched the web well, before posting this question. –  Puspendu Banerjee Dec 6 '10 at 18:35

3 Answers 3

up vote 9 down vote accepted

Easiest way is to reboot (also if below does not work, reboot, check if that made the change).

Second easiest is to restart the daemons using iptables configurations (google: restart daemon ubuntu).

examples (depends your configuration):
/etc/init.d/iptables restart
/etc/init.d/networking restart
/etc/init.d/firewall restart

br,
Juha

share|improve this answer
    
There is no file by name /etc/init.d/iptables –  Raccha Dec 6 '10 at 18:19
1  
what network related exists in /etc/init.d ? try to restart that. –  Juha Dec 6 '10 at 18:20
    
/etc/init.d/networking restart? –  Juha Dec 6 '10 at 18:22
    
Dead link is dead. –  Dustin Graham Mar 14 at 17:45
    
@DustinGraham thanks, the broken link is removed. –  Juha Mar 17 at 15:42

To activate the firewall rules in your config file you must use:

sudo iptables-restore < /etc/iptables.firewall.rules

And you can check that they are activated with:

sudo iptables -L

If you want that the rules are activated each time you boot the computer create this file:

sudo nano /etc/network/if-pre-up.d/firewall

With this content:

#!/bin/sh
/sbin/iptables-restore < /etc/iptables.firewall.rules

And give it permission of execution:

sudo chmod +x /etc/network/if-pre-up.d/firewall

Hope it helps you =)

share|improve this answer

After googling a little, this is what i found to restart iptables. . . sudo /etc/init.d/firewall restart

share|improve this answer
    
There is no file by name /etc/init.d/firewall –  Raccha Dec 6 '10 at 18:16

Your Answer

 
discard

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