PDA

Bekijk de volledige versie : Simple iptables question



NTAdmin
12-10-2005, 10:12
Hi,
I have set up a thttpd server on port 81 and I can access it from lan fine, but no matter what I do with my post-firewall script I cannot make it accessible from wan, here is my post-firewall:


[root@asus root]$ cat ../sbin/post-firewall
#!/bin/sh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 81 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $1 -p tcp --dport 80 -j DNAT
--to-destination $4:81

iptables -A INPUT -j DROP



Can anyone comment on what';s wrong here please

NTAdmin
12-10-2005, 16:21
I figured out what was wrong with forwarding - I had DMZ enabled and needed to insert rules, not just append them. But now there is another problem:
I have 2 routers, one set's the asus in DMZ, so all ports are available to asus. Some PC's are connected to the first router, some to asus. The problem is, that pcs from the other router are able to access my website on the router, but when I try to access it from another host (using ssh and lynx) it fails.