One possibility would be to make a separate vlan for each switch port
and bridge them all.

That way the switching would be happening in the software switch and
not the hardware switch.
brctl configures / shows statistics about the software switch.


# brctl show br0
bridge name     bridge id               STP enabled     interfaces
br0             8000.001517e7c20c       yes            peth0

     peth1
# brctl showmacs br0 | head -n 2
port no mac addr                is local?       ageing timer
  1     00:00:5e:00:01:65       no                 0.20

that 'port 1' I believe translates into 'peth0', while port 2 would be 'peth1'

For most hardware switch chips configuration/dump is really limited
and probably there is no way to get a mac table out of the chip.

On Tue, Mar 24, 2015 at 2:36 AM, Luca Bertoncello <[email protected]> wrote:
> Hi List!
>
> I'm new to OpenWRT and I have a little problem...
>
> I need to assign the VLAN-ID to the port dynamically, based for example on a
> Radius server. This for WIRED devices. For WLAN-device I already created
> more SSID.
>
> Since I could find a way to do that using the standard way (hostapd), I'd
> like to write a little program to do that.
> With swconfig I can get the port where a cable is plugged in and with
> HotPlug I can trigger an event.
> Well, now I just need to know the MAC-Address of the device plugged in...
>
> I can get a list of known MACs with "brctl showmacs br-lan", but I can't
> know on which port they are...
> I'm sure, that the switch MUST know on which port he can find the MAC, but I
> don't know how can I get this information...
>
> Could you help me?
> I'm using OpenWrt Barrier Breaker 14.07 / LuCI Trunk (0.12+svn-r10530) on a
> TP-Link TL-WR1043N/ND v1.
> Kernel version is 3.10.49.
>
> Thanks a lot
> Luca Bertoncello
> ([email protected])
> _______________________________________________
> openwrt-users mailing list
> [email protected]
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-users
_______________________________________________
openwrt-users mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-users

Reply via email to