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:
Thanks.
Allowing a specific port in iptables :
The general form of the rule is :
Make sure it this rule is before an drop all other packets rule.
The reason you statement is not working is probably because you have specified the interface as
lo
instead ofeth0
To make the rules permanent :
If you just add this rule using the command line, the rule will be discarded when you restart, because the iptables will be loaded again from
/etc/sysconfig/iptables
. So if you want to make it permanent, you have two choice.Use
iptable-save > /etc/sysconfig/iptables
This will save the iptables configuration to the iptables file, from which it will be read when you restart your pc. But in case you have manually edited that file to add comments those will be lost.
Manually edit the
/etc/sysconfig/iptables
file to add this rule to the correct chain. This ensures that comments put in by you are preserved.PS : You may need to find the location of your iptables file and the interface name and make changes accordingly.
you limit your accept rule just to the loopback [by the -i lo part]. to allow world-wide access skip that part and run:
for the best performance your iptables rules should start with:
and only after that other rules should follow.