Aug 5, 2012
tom

Allow accessing to the port :8080 in iptable

Question

I need to access to my website on port :8080
But for a reason, I can’t :

That’s what looks like my iptable -L https://gist.github.com/28e7a48d91e933c6f377

After searching on serverfault, I’ve just added :

iptables -I INPUT 1 -i lo -p tcp --dport 8080 -j ACCEPT 

With no effet (even after a iptable restart)

How to allow access of the port 8080 please (both locally and externally because of the setting i’m going to put for varnish / apache2) ?

EDIT it seems that after a restart of iptable, the rule of allowing the port 8080 has gone:

after restart.

Thanks.

Asked by Tristan

Answer

you limit your accept rule just to the loopback [by the -i lo part]. to allow world-wide access skip that part and run:

iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

for the best performance your iptables rules should start with:

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

and only after that other rules should follow.

Answered by pQd

No related posts.

Leave a comment