This works for me:
Code:
wan_if=$(nvram get wan_ifname)
lan_if=$(nvram get lan_ifname)
wan_ip="83.89.24.37"
intranet="192.168.1.1/24"
# HTTP from Internet to Intranet host
iptables -A PREROUTING -t nat -p tcp -i $wan_if --dport 80 -j DNAT --to-destination 192.168.1.2:80
iptables -A FORWARD -p tcp -i $wan_if --sport 1024: -o $lan_if -d 192.168.1.2 --dport 80 -m state --state NEW -j ACCEPT
# HTTP from intranet to intranet host (using double NAT)
iptables -A PREROUTING -t nat -p tcp -i $lan_if -s $intranet -d $wan_ip --dport 80 -j DNAT --to-destination 192.168.1.2:80
iptables -A POSTROUTING -t nat -p tcp -s $intranet -o $lan_if -d 192.168.1.2 --dport 80 -j SNAT --to $wan_ip
Thanks