if_bridge with two subnets

H.fazaeli fazaeli at sepehrs.com
Sun May 11 13:18:12 UTC 2008


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 at sepehrs.com>
Technical Manager 
Sepehr S. T. Co. Ltd.

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






More information about the freebsd-net mailing list