PDA

Bekijk de volledige versie : thttpd on port 81 an wan acces from port 1199



likeapear
07-06-2006, 11:50
Hello, I'm running THTTPD server (port 81) on my wl-500g. I need to access this server from WAN (internet). My ISP mapped port 1199 to my wl-500g router.

My post-firewall script is here:



#!/bin/sh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 1199 -j ACCEPT
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 1199 -j DNAT --to-destination $4:81
iptables -A INPUT -j DROP


But it does'nt work from WAN (from LAN it is very well). What to do? Thanks!

likeapear
08-06-2006, 08:40
This is the solution:



#!/bin/sh
ptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 1199 -j DNAT --to-destination $4:81
iptables -A INPUT -j DROP