Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ iw phy phy0 interface add wifi2 type __ap
iw phy phy0 interface add wifi2.1 type __ap
iw phy phy0 interface add wifi2.2 type __ap
iw phy phy0 interface add mld0 type __ap radios all
iw phy phy0 interface add mld1 type __ap radios all

#Obtain the wifi mac address
wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2 | head -n1`
Expand Down Expand Up @@ -60,13 +61,23 @@ ifconfig wifi2.1 up
ifconfig wifi2.2 up

# Set MLD interface address as wifi2 MAC address + 1
prefix="${wifi2_mac%:*}"
last_byte="${wifi2_mac##*:}"
prefix_mld0="${wifi2_mac%:*}"
last_byte_mld0="${wifi2_mac##*:}"

new_byte=$(printf "%02X" $(( (0x$last_byte + 1) & 0xFF )))
new_mac="$prefix:$new_byte"
new_byte_mld0=$(printf "%02X" $(( (0x$last_byte_mld0 + 1) & 0xFF )))
new_mac_mld0="$prefix_mld0:$new_byte_mld0"

ip link set dev "mld0" down
ip link set dev "mld0" address "$new_mac"
ip link set dev "mld0" address "$new_mac_mld0"

# Set MLD interface address as mld0 MAC address + 1
prefix_mld1="${new_mac_mld0%:*}"
last_byte_mld1="${new_mac_mld0##*:}"

new_byte_mld1=$(printf "%02X" $(( (0x$last_byte_mld1 + 1) & 0xFF )))
new_mac_mld1="$prefix_mld1:$new_byte_mld1"

ip link set dev "mld1" down
ip link set dev "mld1" address "$new_mac_mld1"

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ iw phy phy0 interface add wifi2 type __ap
iw phy phy0 interface add wifi2.1 type __ap
iw phy phy0 interface add wifi2.2 type __ap
iw phy phy0 interface add mld0 type __ap radios all
iw phy phy0 interface add mld1 type __ap radios all

#Obtain the wifi mac address
wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2 | head -n1`
Expand Down Expand Up @@ -60,14 +61,24 @@ ifconfig wifi2.1 up
ifconfig wifi2.2 up

# Set MLD interface address as wifi2 MAC address + 1
prefix="${wifi2_mac%:*}"
last_byte="${wifi2_mac##*:}"
prefix_mld0="${wifi2_mac%:*}"
last_byte_mld0="${wifi2_mac##*:}"

new_byte=$(printf "%02X" $(( (0x$last_byte + 1) & 0xFF )))
new_mac="$prefix:$new_byte"
new_byte_mld0=$(printf "%02X" $(( (0x$last_byte_mld0 + 1) & 0xFF )))
new_mac_mld0="$prefix_mld0:$new_byte_mld0"

ip link set dev "mld0" down
ip link set dev "mld0" address "$new_mac"
ip link set dev "mld0" address "$new_mac_mld0"

# Set MLD interface address as mld0 MAC address + 1
prefix_mld1="${new_mac_mld0%:*}"
last_byte_mld1="${new_mac_mld0##*:}"

new_byte_mld1=$(printf "%02X" $(( (0x$last_byte_mld1 + 1) & 0xFF )))
new_mac_mld1="$prefix_mld1:$new_byte_mld1"

ip link set dev "mld1" down
ip link set dev "mld1" address "$new_mac_mld1"

#To update al_mac addr in EasymesgCfg.json
al_mac_addr=`cat /nvram/EasymeshCfg.json | grep AL_MAC_ADDR | cut -d '"' -f4`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
{
"InterfaceName": "wifi2.1",
"MldName": "mld1",
"Bridge": "brlan0",
"vlanId": 0,
"vapIndex": 22,
Expand Down Expand Up @@ -51,6 +52,7 @@
},
{
"InterfaceName": "wifi1.1",
"MldName": "mld1",
"Bridge": "brlan0",
"vlanId": 0,
"vapIndex": 13,
Expand Down Expand Up @@ -80,6 +82,7 @@
},
{
"InterfaceName": "wifi0.1",
"MldName": "mld1",
"Bridge": "brlan0",
"vlanId": 0,
"vapIndex": 12,
Expand Down
Loading