FreeBSDのethernet switchサポートフレームワークのetherswitchはetherswitchcfgというコマンドで設定を行えます。
# etherswitchcfg help
usage: etherswitchctl
etherswitchcfg [-f control file] info
etherswitchcfg [-f control file] config command parameter
config commands: vlan_mode
etherswitchcfg [-f control file] phy phy.register[=value]
etherswitchcfg [-f control file] portX [flags] command parameter
port commands: pvid, media, mediaopt, led
etherswitchcfg [-f control file] reg register[=value]
etherswitchcfg [-f control file] vlangroupX command parameter
vlangroup commands: vlan, members
実はadrianさんは最後にATUサポートを入れたのですが、helpにはでてきません。
ATUサポートはswitchに格納されてるMAC Addressのdumpとflushを行う機能です。
# etherswitchcfg atu dump
[0] 00:18:84:00:00:01: portmask 0x00000004
[1] d4:94:a1:00:00:02: portmask 0x00000010
[2] 00:18:84:00:00:03: portmask 0x00000008
portmaskのビットでどのポートに接続されているか確認できます。
flushはすべてとportのMACアドレスのエントリーを消すことが出来ます。
ATUのサポートはatherosのswithだけ実装されていて、蟹さんやRalinkでは実装されていません。
# etherswitchcfg atu dump
etherswitchcfg: ioctl(IOETHERSWITCHGETTABLE): Device not configured
すべてのswitchでATUのdumpが出来て回収できれば、どのポートにどのPCやスイッチが接続されているか、解析できるのではないでしょうか。