PDA

Bekijk de volledige versie : Port opening and forwarding



pvarela
08-11-2007, 14:34
Dear All,

I'm relatively new to Linux/Firewalls so I need your help to be able to access my web pages from outside.

I've lighttpd running and listening in port 8082. What do I have to do to access the pages from the WAN?

Related to the above, I have ssh running with access from the LAN working fine. What do I need to do to allow ssh from the WAN?

Regards,

PVarela

sollie
08-11-2007, 14:39
Add this to rc.local:



# Opening port 8082
iptables -I INPUT 7 -p tcp --dport 8082 -j ACCEPT


Sollie.

pvarela
08-11-2007, 17:09
Sollie, thank you. I'll try that tonight.

Do I need also to redirect port 8082 to router_local_ip:8082 in the web interface?

Regards,

PVarela

al37919
08-11-2007, 17:26
Do I need also to redirect port 8082 to router_local_ip:8082 in the web interface?

no


iptables -I INPUT 7 -p tcp --dport 8082 -j ACCEPT

This statement is questional (does he has 7 rules? By default I have only 6)

I suggest either (as a result you rule will be the first one):


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

or better (as a result you rule will be the last one):


# set default policy
iptables -P INPUT DROP

# remove the last default rule
iptables -D INPUT -j DROP

# Allow access to lighthttpd server from WAN
iptables -A INPUT -p tcp --dport 8082 -j ACCEPT


Anyway check the result with iptables -L

pvarela
08-11-2007, 23:17
Sollie, al37919,

Thank you both. Everything is working perfectly now.

Regards,

PVarela