Overview

Laird Connectivity’s 60 Series radio supports what is known as 4addr mode with our enhanced Summit Wi-Fi stack, allowing for layer-2 bridging between two 60-series radios. This is used, for example, to bridge two wired Ethernet networks. This tutorial describes how to set 4addr mode up and offers sample scripts and sample configuration files for quick results.

For information on how to obtain our SUMMIT Wi-Fi stack, please visit: https://www.lairdconnect.com/wireless-modules/wifi-modules-bluetooth/summit-software-stack-60-series and contact your local sales representative.

Prerequisites

To set up 4addr mode between two 60 Series radios, you’ll need the following:

  • 2x embedded linux host systems, each equipped with a 60 Series radio
  • Summit Stack running on each 60 Series radio
  • “hostapd” and “bridge-utils” packages installed on each system
  • Software release 10.4.0.10 or later, available at https://github.com/LairdCP/Sterling-60-Release-Packages/releases
  • scripts and configuration files for the 4addr mode configuration, available here

To prove bridging is working as expected, each of the above Linux systems shall be connected to a PC via Ethernet. This tutorial assumes two PCs running a recent Ubuntu version. E.g. LTS version 20.04. or 18.04.

Setup

This diagram show the connection setup this tutorial uses.

Hardware Setup Expand

Preparation of the Access Point side

Download or create file “4addr_up_AP” and place it in the home directory of the AP board and make it executable with: chmod +x 4addr_up_AP.

ip addr flush dev eth0
sleep 1
ip addr flush dev wlan0
sleep 1
brctl delbr br0
sleep 1
brctl addbr br0
sleep 1
brctl addif br0 eth0
sleep 1
brctl addif br0 wlan0
sleep 1
ip addr add 192.168.50.10/24 dev br0
sleep 1
ip link set br0 up
sleep 1
sdcsupp -iwlan0 -c supp-wds-psk.conf &

Download or create file “supp-wds-psk.conf” and place it in the home directory of the AP board.

network={
	# need ap_config_file with wds entries -- see below
	ap_config_file="/etc/hostapd/hostapd-wds.conf"
	mode=2
	frequency=2437
	ssid="testap"
	scan_ssid=1
	key_mgmt=WPA-PSK
	psk=”1234567890”
	proto=RSN
	pairwise=CCMP
	group=CCMP
}

Download or create file “hostapd-wds.conf” and place it in the directory “/etc/hostapd/” of the AP board.

wds_sta=1
# this needs to match the bridge interface name above
wds_bridge=br0

Connect the AP EL1 board to Ubuntu PC1 and give that PC the IP address 192.168.50.11 in the Ubuntu GUI network settings.

Preparation of the STAtion side

Download or create file “4addr_up_STA” and place it in the home directory of the STA board and make it executable with: chmod +x 4addr_up_STA

ip addr flush dev eth0
sleep 1
ip addr flush dev wlan0
sleep 1
brctl delbr br0
sleep 1
brctl addbr br0
sleep 1
brctl addif br0 eth0
sleep 1
brctl addif br0 wlan0
sleep 1
ip addr add 192.168.50.20/24 dev br0
sleep 1
ip link set br0 up
sleep 1
iw dev wlan0 set 4addr on
sleep 1
sdcsupp -iwlan0 -c supp-sta-psk.conf &

Please note line “iw dev wlan0 set 4addr on” that enable 4addr mode.

Download or create file “supp-sta-psk.conf” and place it in the home directory of the STA board

network={
	ssid="testap"
	scan_ssid=1
	key_mgmt=WPA-PSK
	psk=”1234567890”
	proto=RSN
	pairwise=CCMP
	group=CCMP
}

Connect STAtion EL2 board to Ubuntu PC2 and give that PC the IP address 192.168.50.21 in the Ubuntu GUI network settings.

Note: also make sure that both 60 radios use the same regulatory settings.

Establishing Wifi connection between AP and STA side

On EL1 execute “4addr_up_AP”, wait for it to finish and issue “iw dev”. Observe the AP got created.

root@imx8mp-lpddr4-evk:~# ./4addr_up_AP
bridge br0 doesn't exist; can't delete it
[  111.803027] br0: port 1(eth0) entered blocking state
[  111.808029] br0: port 1(eth0) entered disabled state
[  111.813482] device eth0 entered promiscuous mode
[  111.818189] audit: type=1700 audit(1616581626.196:3): dev=eth0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
[  112.828648] br0: port 2(wlan0) entered blocking state
[  112.833813] br0: port 2(wlan0) entered disabled state
[  112.839277] device wlan0 entered promiscuous mode
[  112.844108] audit: type=1700 audit(1616581627.220:4): dev=wlan0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
[  114.859118] br0: port 1(eth0) entered blocking state
[  114.864110] br0: port 1(eth0) entered forwarding state
[  114.869541] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
root@imx8mp-lpddr4-evk:~# [  119.859973] br0: port 2(wlan0) entered disabled state
[  119.868903] ieee80211 phy0: WMM Turbo=1
[  119.927944] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  119.934567] br0: port 2(wlan0) entered blocking state
[  119.939655] br0: port 2(wlan0) entered forwarding state

root@imx8mp-lpddr4-evk:~#
root@imx8mp-lpddr4-evk:~# iw dev
phy#0
        Interface wlan0
                ifindex 5
                wdev 0x1
                addr c0:ee:40:61:4a:3c
                ssid testap
                type AP
                channel 6 (2437 MHz), width: 20 MHz, center1: 2437 MHz
                txpower 20.00 dBm
root@imx8mp-lpddr4-evk:~#

On EL2 execute “4addr_up_STA” and wait for it to finish and again issue “iw dev” to see the STA is connected to SSID “testap”:

root@imx8mp-lpddr4-evk:~# ./4addr_up_STA
bridge br0 doesn't exist; can't delete it
[  343.078219] br0: port 1(eth0) entered blocking state
[  343.083220] br0: port 1(eth0) entered disabled state
[  343.088468] device eth0 entered promiscuous mode
[  343.093448] audit: type=1700 audit(1616581856.564:3): dev=eth0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
[  344.099714] br0: port 2(wlan0) entered blocking state
[  344.104802] br0: port 2(wlan0) entered disabled state
[  344.110438] device wlan0 entered promiscuous mode
[  344.115533] audit: type=1700 audit(1616581857.588:4): dev=wlan0 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
[  346.129734] br0: port 1(eth0) entered blocking state
[  346.134731] br0: port 1(eth0) entered forwarding state
[  346.140443] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
root@imx8mp-lpddr4-evk:~# [  351.901072] wlan0: authenticate with c0:ee:40:61:4a:3c
[  351.916033] wlan0: send auth to c0:ee:40:61:4a:3c (try 1/3)
[  351.925814] wlan0: authenticated
[  351.931107] wlan0: associate with c0:ee:40:61:4a:3c (try 1/3)
[  351.936889] ieee80211 phy0: Setting 20/40 coex cap
[  351.952667] wlan0: RX AssocResp from c0:ee:40:61:4a:3c (capab=0x411 status=0 aid=1)
[  351.965552] wlan0: associated
[  352.077692] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  352.084363] br0: port 2(wlan0) entered blocking state
[  352.089452] br0: port 2(wlan0) entered forwarding state

root@imx8mp-lpddr4-evk:~# iw dev
phy#0
        Interface wlan0
                ifindex 5
                wdev 0x1
                addr c0:ee:40:61:48:d4
                ssid testap
                type managed
                channel 6 (2437 MHz), width: 20 MHz, center1: 2437 MHz
                txpower 20.00 dBm
                4addr: on
root@imx8mp-lpddr4-evk:~#

Now you should be able to ping across from PC1 to PC2 and vice versa.

Ping 192.168.50.21 (PC2) from PC1 (192.168.50.11):

Ping PC 2 Expand

Ping 192.168.50.11 (PC1) from PC2 (192.168.50.21):

Ping PC 1 Expand