cod3x -
Below is a series of 3 rules that you may be able to use as a template to get your configuration working. In this instance the packet is being forwarded to a different port on the internal/private system, but you should be able to adjust/modify to meet your needs. It may also help you to accept all packets until you get things working. Then you can go back and drop everything (all packets) and only open up (accept) what you need.
EXT_CARD is the firewall's Internet interface
EXT_CARD_IP is the IP address for the firewall's Internet interface
PRIVATE_IP is the IP address of the internal/private system
(1) This entry is used to rewrite the packet:
${IPTABLES} -t nat -A PREROUTING -i ${EXT_CARD} -p tcp -d ${EXT_CARD_IP} --dport 1000 -j DNAT --to ${PRIVATE_IP}:2000
(2) This entry is used to log the packet (optional):
${IPTABLES} -A FORWARD -i ${EXT_CARD} -p tcp -m state --state NEW -d ${PRIVATE_IP} --dport 2000 -j LOG --log-level INFO --log-prefix "IPT FORW - connection to xx "
(3) This entry is used to forward the packet:
${IPTABLES} -A FORWARD -i ${EXT_CARD} -p tcp -d ${PRIVATE_IP} --dport 2000 -j ACCEPT
Hope this helps!
Biker
Systems/Network Administrator
LiveFire Labs - Online UNIX and Linux Training with
Hands-on Lab Exercises