this is to get round the problem where you can not login from LAN to a grid-connected region from LAN.
192.168.1.100 is the IP of the server on the lan, the script and viewer was run from another box on the lan this will also work with viewer and server on same box.
Code:
#!/bin/bash
echo -n “Your external IP Address is:
WAN_IP="`wget www.whatismyip.com/automation/n09230945.asp -O - -q`"
echo $WAN_IP
echo updating iptabs....
iptables -t nat -A OUTPUT --dst $WAN_IP -p tcp --dport 9000:9010 -j DNAT --to-destination 192.168.1.100
iptables -t nat -A OUTPUT --dst $WAN_IP -p udp --dport 9000:9010 -j DNAT --to-destination 192.168.1.100
echo done