Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new in CentOS and I'm trying to create a little script in Python, something like:

$ python -m SimpleHTTPServer

If I try to access port 8000 in my web browser, I don't get access, however if I turn off the firewall with:

$ system-config-firewall-tui

I'm able to access the service.

I just need to access port 3343 and 8880 but I don't want to disable the firewall.

share|improve this question
So it works with the firewall off, but not when it's on? – slm Oct 21 '13 at 1:38
Exactly! I think i need to configure the firewall to access only to this ports, but i dont know how :( – kuait Oct 21 '13 at 1:40
up vote 1 down vote accepted

Try something like this:

$ iptables -A INPUT -p tcp --dport 3343 -j ACCEPT
$ iptables -A INPUT -p tcp --dport 8880 -j ACCEPT
share|improve this answer
if IPTables are not running you may need to run "system-config-securitylevel" first. And if you want them to be permanent save them by running "/sbin/service iptables save" – Purinda Gunasekara Oct 21 '13 at 4:22
@PurindaGunasekara - getting ahead of ourselves. If these rules solve the issue then yes, we can make these permanent. – slm Oct 21 '13 at 5:05

Just for anybody who needs, after make the change in iptables i reload the services with:

/etc/init.d/iptables restart


/etc/init.d/networking restart
share|improve this answer

Your Answer


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.