Adding Wi-Fi Interface on a custom VLAN (v4.11)

Hi,

Is there a way to add a new WiFi interface to a custom VLAN without it breaking? I’ve tried to add it via LuCI, but it would simply break the wireless settings on the GL.iNet UI, and every reboot would crash Wi-Fi if the new SSID is enabled on boot. If anyone has a way to do this without breaking, please let me know. Thanks.

Model: GL-MT3000 & GL-MT6000

Version: v4.11-op25

You did not specify which router model.

I have used uci to accomplish this task on my Flint 4

uci set wireless.ra0.network=vlan11
uci commit wireless
reboot

ra0 is the default 2.4GHz SSID for me, vlan11 is the new VLAN created.
You would need to adapt to your setup :slight_smile:

Thanks, I edited the post to include the model. Unfortunately, this wasn’t the model I was looking for.

Hi,

For the MT6000, please refer to the following guide for adding Wi-Fi interfaces to a custom VLAN:

For the MT3000, the example below creates additional 2.4 GHz and 5 GHz Wi-Fi networks and associates both with the existing vlan20 interface.

As in the guide above, adjust the network interface name, SSID, and password at the top, then run the commands via SSH.

# Customize these settings
NET='vlan20'
SSID='VLAN20'
WIFI_PASSWORD='ChangeThisPassword123'

# Keep the VLAN bridge available without wired ports
BRIDGE="$(uci -q get "network.${NET}.device")"
for SECTION in $(uci show network | sed -n 's/^network\.\(.*\)=device$/\1/p'); do
    if [ "$(uci -q get "network.${SECTION}.name")" = "$BRIDGE" ] &&
       [ "$(uci -q get "network.${SECTION}.type")" = 'bridge' ]; then
        uci set "network.${SECTION}.bridge_empty=1"
    fi
done

# Create the 2.4 GHz Wi-Fi
uci set wireless.vlan20_2g='wifi-iface'
uci set wireless.vlan20_2g.device='mt798111'
uci set wireless.vlan20_2g.mode='ap'
uci set wireless.vlan20_2g.network="$NET"
uci set wireless.vlan20_2g.ifname='ra3'
uci set wireless.vlan20_2g.ssid="$SSID"
uci set wireless.vlan20_2g.encryption='psk2'
uci set wireless.vlan20_2g.key="$WIFI_PASSWORD"
uci set wireless.vlan20_2g.disabled='0'

# Create the 5 GHz Wi-Fi
uci set wireless.vlan20_5g='wifi-iface'
uci set wireless.vlan20_5g.device='mt798112'
uci set wireless.vlan20_5g.mode='ap'
uci set wireless.vlan20_5g.network="$NET"
uci set wireless.vlan20_5g.ifname='rax4'
uci set wireless.vlan20_5g.ssid="$SSID"
uci set wireless.vlan20_5g.encryption='psk2'
uci set wireless.vlan20_5g.key="$WIFI_PASSWORD"
uci set wireless.vlan20_5g.disabled='0'

unset WIFI_PASSWORD

# Save and reboot
uci commit network
uci commit wireless
sync
reboot

After saving the settings and rebooting, the new Wi-Fi will be associated with your custom VLAN.