Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have just installed Webmin on a Ubuntu server. According to the docs you need to open up port 10000 (which is what Webmin runs on), with this:

iptables -A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT

It then says you need to apply the firewall configuration with:

/etc/init.d/iptables restart

However, this command doesn't work for me. Is there a different command that saves the changes on Ubuntu?

share|improve this question
add comment

4 Answers

up vote 3 down vote accepted

Your iptables rule is active once you execute it. Issuing a restart merely restores your iptables config to however it was last saved. There is no need to do the restart.

share|improve this answer
2  
and it will go away on the next reboot –  Arthur Ulfeldt Nov 4 '10 at 23:48
add comment

On many Linux distributions, you can save changes made to iptables config by:

service iptables save

or alternately

/etc/init.d/iptables save

But this doesn't activate changes, it merely makes them permanent. The moment you executed the iptables command, the change was active. This command makes changes in real time.

share|improve this answer
    
there is no such service in the current version of Ubuntu 10.04 –  Arthur Ulfeldt Nov 4 '10 at 23:46
add comment

there is a package that contains a system service to restore

sudo apt-get install iptables-persistent

put rules in /etc/iptables/rules.

one way to do this is:

sudo bash -c "iptables-save > /etc/iptables/rules"
share|improve this answer
add comment
iptables-save
iptables-restore

will save rules in a plain text file, and usually restored on system sturup by the init.d script. see iptables.conf e iptables man for details

share|improve this answer
    
these commands dont exist. –  Arthur Ulfeldt Nov 4 '10 at 23:45
    
Simply forgotten a dash. Fixed –  AlberT Nov 5 '10 at 11:18
add comment

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.