What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Asus ZenWiFi XT8 VLAN/SSID Bridge Script (Merlin/Gnuton)

r80xcore

New Around Here
I really wanted working VLANs on my Asus ZenWiFi XT8 mesh setup and as I couldn't find any good ones the only alternative was to make one. I'm not a coder but I'm stubborn and I love to read up and learn new stuff. So I sat down with Google, ChatGPT and a lot of coffee for two weeks and now I got (as far as I know) a working VLAN script.

How it works
This script uses SSID identification. I noticed that the mesh Wi-Fi network (e.g., “MyMain5G1”) can live on different internal interface names on the XT8 main and the XT8 node. Therefor using interface names when configuring VLANs seemed much more complicated. When I hard-code interface names, it workked on one box, then failed on the other.
So the script does this instead:
  • You use the same SSID as in the Web GUI ( be vary of bands. 2.4, 5-1 and 5-2)
  • You choose VLAN using the Wi-Fi name you see in the air (e.g., r80xcore-wifi-IoT:20).
  • The script handles the interface identification from there.
  • Result: the same config file works on both Main and Node, regardless of how the mesh shuffled the internal names.
I have tested the 'switch' topology and it works. Daisy chaining could work so i have a script that you can use on the main unit to create a trunk port. This IS NOT tested, but it would be really fun if someone wanted to test and give me some feedback.

I have created quite a extensive READ.ME in the scripts so you can set it up as you want. But if you have any questions, just ask them. And please give feedback and provide logs if you encounter any errors. Logs are in /jffs/scripts/vlan_manager.log, if you use the boot script. If you want to run logs manually you can run the script with "/jffs/scripts/vlan_manager.sh >> /jffs/scripts/vlan_manager.log 2>&1".

Installation:
  • Enable JFFS scripting in Web GUI.
  • Make sure JFFS is enabled by running "nvram get jffs2_on" and "nvram get jffs2_scripts", it should say "1". If "0" run the command to enable it:
    nvram set jffs2_on=1
    nvram set jffs2_scripts=1
    nvram commit
    reboot
    Heads up: Web Gui only enables JFFS on the main unit, so you need to manually enable on the node.
  • create the script with nano (on both/all units!):
    nano /jffs/scripts/vlan_manager.sh
    edit the txt file to you liking and copy the contents into the file. Press "ctrl+x" then "y" and "enter" to save.
  • Make it executable with:
    chmod +x /jffs/scripts/vlan_manager.sh
  • Before you install, make sure everything works by setting
  • PERSISTENT="no"
    If you only want to see what the script should have done without making any changes, enable this:
    DRY_RUN="yes"
  • When satisfied, change PERSISTENT to "yes"
  • Create the services-start by running this whole block:

    echo 'Creating /jffs/scripts/services-start hook'
    cat > /jffs/scripts/services-start <<'EOF'
    #!/bin/sh
    LOG="/jffs/scripts/vlan_manager.log"
    MAX=65536
    KEEP=$((MAX/2))

    # trim the log if needed
    if [ -f "$LOG" ]; then
    SIZE=$(wc -c < "$LOG" 2>/dev/null || echo 0)
    if [ "$SIZE" -gt "$MAX" ]; then
    tail -c "$KEEP" "$LOG" > "$LOG.tmp" && mv "$LOG.tmp" "$LOG"
    fi
    fi

    # --- Daisy-chain helper (optional) ---
    # To enable, remove the leading '#' on BOTH lines below:
    #sleep 10
    #[ -x /jffs/scripts/daisy_trunk_helper.sh ] && /jffs/scripts/daisy_trunk_helper.sh >> "$LOG" 2>&1

    # Apply VLAN/SSID bridges
    # Use 20s normally; if you enabled the daisy helper above, make this 10s
    sleep 20
    /jffs/scripts/vlan_manager.sh >> "$LOG" 2>&1
    EOF

  • After rebooting, check you logs with "tail -n 100 /jffs/scripts/vlan_manager.log"

  1. The procedure needs to be done on both/all units.
  2. Daisy-Chaining mesh is experimental at best. Use the daisy_trunk_helper to setup a trunk port.
  3. Wireless backhaul cannot have mesh VLANs. Only VLANs on the main unit.
  4. Only the 1st Guest on each (three guests) can use mesh VLANs. The other six Guests can only be VLAN tagged on the main unit.

I hope someone have use for this!
 

Attachments

Last edited:
I really wanted working VLANs on my Asus ZenWiFi XT8 mesh setup and as I couldn't find any good ones the only alternative was to make one. I'm not a coder but I'm stubborn and I love to read up and learn new stuff. So I sat down with Google, ChatGPT and a lot of coffee for two weeks and now I got (as far as I know) a working VLAN script.

How it works
This script uses SSID identification. I noticed that the mesh Wi-Fi network (e.g., “MyMain5G1”) can live on different internal interface names on the XT8 main and the XT8 node. Therefor using interface names when configuring VLANs seemed much more complicated. When I hard-code interface names, it workked on one box, then failed on the other.
So the script does this instead:
  • You use the same SSID as in the Web GUI ( be vary of bands. 2.4, 5-1 and 5-2)
  • You choose VLAN using the Wi-Fi name you see in the air (e.g., r80xcore-wifi-IoT:20).
  • The script handles the interface identification from there.Result: the same config file works on both Main and Node, regardless of how the mesh shuffled the internal names.
Can you remove beta tag as you don't release any Beta build. Thx
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top