Re: Forwarding traffic from local lan to another host?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2004-11-29 at 14:09, Reginald NALLARATNAM wrote:
> 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



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux