Okay....
Now I make NO representations that this is safe, or that it's a good idea.
So here's a code snippet, both lines are required for one port opening.
# Copied from
http://board.protecus.de/showtopic.php?threadid=3361# With minor modifications by Daniel Rose 12/4/03
/sbin/iptables -A FORWARD -i $OUTERIF -o $INTERNALIF -p tcp --dport 5900 -j ACCEPT
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 4661:4662 -j DNAT --to-destination 192.168.0.10:5900
It's double-spaced so you can see where the line breaks are.
You might want to change "tcp" to "upd" and you'll probably want to change 192.168.0.10 to the address of your choice.
You need that code in a file at
/etc/e-smith/templates-custom/etc/rc.d/init.d/masq/
My filenames for this start with 82, eg
82-VNC-Forward-to-192-168-0-10
of course once it's there you'll need a
/sbin/e-smith/expand-template /etc/rc.d/init.d/masq
then a
/etc/rc.d/init.d/masq restart
All this brings me on to another point; On the client, I've given it a fixed IP address, because using DHCP if it changes the forwarding will go to the wrong PC.
Suppose you have a windows dhcp client called fred. I want to put "fred" instead of the IP address in the forwarding commands above. From e-smith server, fred doesn't resolve -- "ping fred" gives "unknown host."
This annoys me. Does anyone know how to make e-smith "see" the hostnames of the PCs it gives IP addresses to or do the clients need to be configured to tell e-smith?