Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jun 2004 17:01:35 -0400
From:      Charles Swiger <cswiger@mac.com>
To:        matt@example.com
Cc:        freebsd questions <freebsd-questions@freebsd.org>
Subject:   Re: Redirection with a bridge ?
Message-ID:  <2E739980-C3C6-11D8-BF1C-003065ABFD92@mac.com>
In-Reply-To: <3514.134.210.7.179.1087850914.squirrel@134.210.7.179>
References:  <40D3752A.8000809@atopia.net> <40D46636.1020909@mac.com> <3514.134.210.7.179.1087850914.squirrel@134.210.7.179>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 21, 2004, at 4:48 PM, matt@example.com wrote:
> Is it possible to redirect packets that are being passed through a 
> bridge
> based on their protocol/port, so that if a HTTP packet (port 80) goes
> through the bridge, no matter what its destination is, it will be
> redirected to IP address 4.3.2.1.

Yes.  In order to redirect packets to a different IP address, you have 
to rewrite those packets, which is what natd or ipnat do, working at 
layer 3.

> Thats what I'm trying to solve.  I know that you can do the above
> successfully if you are using a NAT (ipnat) or if you are doing routing
> (IPFW's forward command), but is it possible to do it with a bridge?

Bridging works at layer-2.  Without using NAT, bridging alone will 
forward the traffic but not change the destination IP to 4.3.2.1.

Note that the IPFW forward command redirects traffic via a specific 
outbound interface, it does not perform layer-3 routing (ie, your 
traditional IP stuff using netmasks, gateways, and the local routing 
table that most people mean by the word "routing").

-- 
-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2E739980-C3C6-11D8-BF1C-003065ABFD92>