# Any way to see which member interface of a bridge has a certain remote host connected to it?



## jem (Sep 2, 2021)

I'm running a FreeBSD router system at home with six interfaces, igb0-5.  I've renamed these lan0-lan4 and wan0.  I've also configured a bridge and made lan0, lan1 and lan2 members of it.

When I ping a certain host on my network, tcpdump() shows the ICMP ping request and reply packets on the bridge0 interface as expected, but it also shows those packets on the lan2 physical interface _only_, not lan0 or lan1. FreeBSD must be keeping track of which MAC addresses it has discovered via each member interface, just as an ethernet switch does, and only transmits traffic to that host via that member interface.

Does anyone know if it's possible to view the table of MAC addresses discovered per interface?  '`arp -a`' only shows bridge0, not the individual member interfaces.


----------



## SirDice (Sep 2, 2021)

jem said:


> FreeBSD must be keeping track of which MAC addresses it has discovered via each member interface, just as an ethernet switch does, and only transmits traffic to that host via that member interface.


That's correct.


```
A bridge works like a switch, forwarding traffic from one interface to
     another.  Multicast and broadcast packets are always forwarded to all
     interfaces that are part of the bridge.  For unicast traffic, the bridge
     learns which MAC addresses are associated with which interfaces and will
     forward the traffic selectively.
```
From bridge(4). 



jem said:


> Does anyone know if it's possible to view the table of MAC addresses discovered per interface?


Good question, I'm not aware of anything that would show that information though.


----------



## covacat (Sep 2, 2021)

ifconfig bridge0 addr ?


----------



## mer (Sep 2, 2021)

covacat said:


> ifconfig bridge0 addr ?


I think that may be it.  man ifconfig and search for bridge I came up with:

addr    Display the addresses that have been learned by the bridge.

Not sure if it gives the "per interface that makes up the bridge" OP is looking for.

looks like there may be a few other good commands specifically for bridges.


----------



## jem (Sep 2, 2021)

covacat said:


> ifconfig bridge0 addr ?


Perfect, thank you!


----------



## SirDice (Sep 2, 2021)

Yep, that's it. Learned something new today, awesome.


----------



## mer (Sep 2, 2021)

SirDice said:


> Yep, that's it. Learned something new today, awesome.


Add me to that list of learning something new today.


----------

