Skip to contentSkip to conversation

Forwarding traffic from local lan to another host?

DISCUSSION Reginald NALLARATNAM 2 participants 2 messages Nov 29, 2004

lore
Share & tools
lore
#0 lore raw

Hello,
Is there a way to forward any traffic from local LAN going to an ftp site to another ftp site.
Example:
If the client ftp's to host 216.24.35.53 from the local LAN, is there a way to send that traffic to a different ftp server say 216.24.36.55? (Sort of port forwarding outwords?)

Thanks.

#1 lore raw
Quoted 7 lines · Reginald NALLARATNAM

Hello,
Is there a way to forward any traffic from local LAN going to an ftp site to another ftp site.
Example:
If the client ftp's to host 216.24.35.53 from the local LAN, is there a way to send that traffic to a different ftp server say 216.24.36.55? (Sort of port forwarding outwords?)

Thanks.

  iptables -t nat -A PREROUTING -i $INSIDE_IF -p tcp -d 216.24.35.53 \
    --dport 21 -j DNAT --to-destination 216.24.36.55

  iptables -t nat -A PREROUTING -i $INSIDE_IF -m helper --helper ftp \
    -d 216.24.35.53 -j DNAT --to-destination 216.24.36.55

iptables -A FORWARD -m state --state ESTABLISHED, RELATED -j ACCEPT

  iptables -A FORWARD -i $INSIDE_IF -p tcp --syn -d 216.24.36.55 \
    --dport 21 -j ACCEPT

can't say i've actually tested this--but that would be the theory...

-j

--
"Ah, good ol' trustworthy beer. My love for you will never die."
--The Simpsons