Now the simple 5-port switch function works with this initialization below.
My understandig for the switch function is: The BCM53125 can only distinguish the source port of an incoming telegram using different VLAN IDs, added by the ports. It is important for LLDP, RSTP, ... and Router. In this initialization sequence the VID 101, 102, 103, 104, 105 are assigned the ports lan1, lan2, lan3, lan4, wan and stored in the ports own PVID Register.
The forwarding of the incoming frames to other ports and cpu port is controlled by entries in VLAN table. Each entry is indexed by VID, here the PVID. Each VLAN table entry has a bit mask with one bit for each port to forward.
rfkill unblock 0
ip link set eth0 up
ip link add link eth0 name eth0.101 type vlan id 101
ip link set eth0.101 up
ip link add link eth0 name eth0.102 type vlan id 102
ip link set eth0.102 up
ip link add link eth0 name eth0.103 type vlan id 103
ip link set eth0.103 up
ip link add link eth0 name eth0.104 type vlan id 104
ip link set eth0.104 up
ip link add link eth0 name eth0.105 type vlan id 105
ip link set eth0.105 up
ip link add br0 type bridge
ip link set dev br0 type bridge stp_state 0
# BCM53125 ports 4, 0, 1, 2, 3
ip link set lan1 master br0
ip link set lan2 master br0
ip link set lan3 master br0
ip link set lan4 master br0
ip link set wan master br0
bridge vlan add vid 101 dev lan1 pvid untagged
bridge vlan del dev lan1 vid 1 self
bridge vlan add vid 102 dev lan2 pvid untagged
bridge vlan del dev lan2 vid 1 self
bridge vlan add vid 103 dev lan3 pvid untagged
bridge vlan del dev lan3 vid 1 self
bridge vlan add vid 104 dev lan4 pvid untagged
bridge vlan del dev lan4 vid 1 self
bridge vlan add vid 105 dev wan pvid untagged
bridge vlan del dev wan vid 1 self
ip link set eth0.101 master br0
ip link set eth0.102 master br0
ip link set eth0.103 master br0
ip link set eth0.104 master br0
ip link set eth0.105 master br0
ip link set br0 up
ip link set lan1 up
ip link set lan4 up
ip link set lan2 up
ip link set lan3 up
ip link set wan up
ifup br0
hostapd -dd /etc/hostapd/hostapd.conf
The Image I have build with https://github.com/igorpecovnik/lib , complete including Desktop
root@bpi:~# uname -a
Linux bpi 4.10.6-sunxi #2 SMP Tue Mar 28 10:47:42 CEST 2017 armv7l armv7l armv7l GNU/Linux root@bpi:~#
But some problems pending:
- For LLDP in driver B53_common.c there must be reset the Bit 1 in page 0 Register 0x2F.
- lldpd is not able to watch at eth0.101...eth01.105, only receives frames from eth0. Wireshark works with all ports.
- WLAN bridge does not work, hostapd fails:
root@bpi:~# hostapd -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
drv->ifindex=8
Configure bridge br0 for EAPOL traffic.
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to mode(3)!
Could not set interface to master mode!
rtl871xdrv driver initialization failed.
... root@bpi:~#
Now I have a little progress ( unfortunly back ).
LLDP and other local link multicasts are dropped if switch is in unmanaged mode. After reset, managed mode seems to be set. But function b53_enable_vlan(...) in b53_common.c disables switch managed mode, and I have not found any function to enable.
Maybe in DSA for BCM53125 there is no support for simple managed switch.
What may be the reason why VLAN is used for WAN and router?
Hello,
On my lamobo_r1 I would like to use only the 5-port switch function (and later additional WLAN-Bridge).
It seems to work a little bit except the forwarding of multicasts for lldp, stp, ...
There is running
- Linux bpi 4.10.3-sunxi #1 SMP Wed Mar 15 17:35:56 CET 2017 armv7l armv7l armv7l GNU/Linux
- configuration like this link https://github.com/igorpecovnik/lib/issues/511
- A little change in b53_common.c: struct b53_switch_chips[], BCM53125_DEVICE_ID I have added: .arl_entries = 4
The lldp-Multicast 01:80:c2:00:00:0e is set by lldpd on eth0 and br0:
root@bpi:~$ bridge fdb show | grep ^01:80
01:80:c2:00:00:21 dev eth0 self permanent
01:80:c2:00:00:0e dev eth0 self permanent
01:80:c2:00:00:0e dev lan2 self static
01:80:c2:00:00:0e dev br0 master br0 permanent root@bpi:~$
At lan2 I can't see any lldp frames.
At next step I have try to add static multicast to lan1 and lan2. You can see at line 3. Unfortunly we can see only last port I have set.
But no effect.
I have configured STP for testing only. Same effect, no BPDUs.
Maybe my concept is wrong. I have no manual found from BCM53125.
Any have an idea and can help?