Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 May 2008 19:50:50 +0430
From:      "H.fazaeli" <fazaeli@sepehrs.com>
To:        "Jay L. T. Cornwall" <jay@jcornwall.me.uk>
Cc:        freebsd-net@freebsd.org
Subject:   Re: if_bridge with two subnets
Message-ID:  <48286052.6000507@sepehrs.com>
In-Reply-To: <48274E6D.9060704@jcornwall.me.uk>
References:  <4825EF8D.1050304@jcornwall.me.uk> <4826EB42.104@sepehrs.com> <48274E6D.9060704@jcornwall.me.uk>

next in thread | previous in thread | raw e-mail | index | archive | help


Jay L. T. Cornwall wrote:
> H.fazaeli wrote:
>
>> The bridge works as it should: It receives packets from
>> XX.XX.XXX.YYY on the interface connected to the switch, and
>> forwards them on the interface connected to the gateway.
>>
>> The problem is that forwarding between subnets is the responsibility
>> of your switch. The switch does its job, but since the two clients are
>> not on the same IP subnet, they can not reach each other w/o the help of
>> an intermediate router.
>
> Perhaps I am mixing up two separate networking concepts.
>
> On a machine configured to act as a gateway, I would expect a single 
> interface with more than one subnet to route packets correctly across 
> those subnets. That may not be how it works in practice.
>
> If it does not work, I would question why not. If it does work then I 
> would expect the same behaviour on each of a bridge's constituent 
> interfaces?
>
It does work. However, if I understand your setup correctly, the freebsd 
box
has been setup to act as a bridge, not as a router (routing is enabled with
sysctl net.inet.ip.forwarding=1). Bridging works when the forwarding is
between the same subnets.

For freebsd box to route between subnets:
- enable routing: sysctl net.inet.ip.forwarding=1
- clients must use the freebsd box as gateway.
- IP addresses must be removed from the bridge and assigned to
  the member interfaces. (the bridge is no longer needed).

You may have bridging & routing on the same box at the same time but
note that a single packet coming into the system either goes through
bridging _or_ routing code, but not both. The former case happens
if packet's destination MAC address is not that of box. The
latter case happens when destination MAC address is that of receiving
interface.

If you provide a network diagram along with your requirements,
we can better discuss the matter.

-- 


With best regards.

Hooman Fazaeli <fazaeli@sepehrs.com>
Technical Manager 
Sepehr S. T. Co. Ltd.

Web: http://www.sepehrs.com
Tel: (9821)88975701-2
Fax: (9821)88983352







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48286052.6000507>