Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 May 2008 17:19:06 +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:  <4826EB42.104@sepehrs.com>
In-Reply-To: <4825EF8D.1050304@jcornwall.me.uk>
References:  <4825EF8D.1050304@jcornwall.me.uk>

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

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.






Jay L. T. Cornwall wrote:
> Hi,
>
> I have an if_bridge, thus:
>
> bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 
> mtu 1500
>     inet XX.XX.XXX.20 netmask 0xfffffff8 broadcast XX.XX.XXX.23
>     inet 192.168.1.30 netmask 0xffffff00 broadcast 192.168.1.255
>
> On one side of the bridge is a layer 2 switch with clients of a mix of 
> addresses from these two subnets. On the other side is a gateway 
> XX.XX.XXX.22. All clients can communicate through the gateway 
> correctly, with the 192.168.1.x subnet being NAT'd.
>
> However, clients from one subnet cannot communicate with clients from 
> the other subnet. Pinging a 192.168.1.X machine from the other subnet 
> shows the packet incorrectly routed out through the gateway, not back 
> through the interface it came.
>
> The routing table shows that both subnets should be routed through the 
> bridge:
>
> XX.XX.XXX.XX/29    link#5             UC          0        0 bridge
> 192.168.1.0/24     link#5             UC          0        0 bridge
>
> The bridge host itself can ping machines on both subnets. So why is 
> the if_bridge routing packets destined for the private subnet out 
> through the default route instead?
>
> (The specific hosts being pinged are present in the routing table from 
> ARP lookups. They are all destined for the bridge interface.)
>

-- 


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?4826EB42.104>