Hi all,
I have the following rule used to port forward a port to an internal
host:
WAN = eth<X>
EXTERNALIP = <HARD CODED VALUE IN SCRIPT

>
iptables -t -nat -A PREROUTING -p tcp -i ${WAN} -d ${EXTERNALIP} --
dport 8022 -j DNAT --to 192.168.1.X:<PORT>
If i miss out the -d ${EXTERNALIP} argument i cannot get the rule to
work. Unfortunately, the internface eth<X> is assigned a dynamic IP
address at random intervals. I am currently using dhcp to control the
interface.
Obviously when the IP changes, the ${EXTERNALIP} argument is
incorrect. Could anyone recommend, a way that i may be able to tie
this to the interface rather than the ip address. All my attempts have
failed, and im sure this could probably be done?
Any ideas, thanks in advance again for all your help.
David