iptables port forwarding - with DHCP
Hi,
I am trying to use iptables to forward ftp protocol through my NAT box but I am worried about what happens with DHCP. I have a startup script:
/sbin/iptables -t nat -A PREROUTING -p $proto -d XXX.XXX.XXX.XXX --dport $low:$high -j DNAT --to-destination $ip
/sbin/iptables -t nat -A OUTPUT -p $proto -d XXX.XXX.XXX.XXX --dport $low:$high -j DNAT --to-destination $ip
The problem being that when my WAN interface is setup to use dhcp, the script may run before there is an IP. I have tried replacing the IP with the interface name, but I am unsure how this will affect the forward? Can someone help?
|