From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Rossato Subject: Re: how to forward packets to another gateway, if i'm one Date: Tue, 17 Dec 2002 17:07:09 +0100 Sender: netfilter-admin@lists.netfilter.org Message-ID: <3DFF4BAD.6080306@istitutocolli.org> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: netfilter@lists.netfilter.org Saulius Menkevicius wrote: > Now, I want to make some traffic that comes from some client and > that should go through gateway 10.0.0.1 to be forwarded to 10.0.0.2 > (without any changes). The need is to make the forwarding transparent > to both 10.0.0.2 and the client. in 10.0.0.1 ip rule add from YOUR_CLIENT [to DESTINATION] table fbsd.out ip route add default via 10.0.0.2 dev $DEV table fbsd.out I think this should do the job (for more information http://lartc.org/) you create a routing table (fbsd.out) that will use 10.0.0.2 as gateaway for packets comming from your client. I did not test this config, since I'm marking packets in the FORWARD chain of the mangle table and use ip rule add fwmark to route them. hope this helps. andrea