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:
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:
I hope someone have use for this!
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 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"
- The procedure needs to be done on both/all units.
- Daisy-Chaining mesh is experimental at best. Use the daisy_trunk_helper to setup a trunk port.
- Wireless backhaul cannot have mesh VLANs. Only VLANs on the main unit.
- 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: