What's new

Help wanted: mapping LAN / ETH ports for MerVLAN device support

r80xcore

Regular Contributor
Help wanted: mapping LAN / ETH ports for MerVLAN device support

I’m looking for help from users willing to map the physical LAN ports on their router so proper MerVLAN device support can be added upstream.

I’ve created a fully standalone helper script that:

  • Detects the WAN/uplink interface
  • Walks you through mapping each physical LAN port (LAN1, LAN2, …)
  • Generates a ready-to-use hw_probe.sh case snippet
  • Saves a full report under /tmp
  • Provides a pre-filled GitHub issue link for submitting the results
  • Optionally patches a local MerVLAN install with temporary support (until official support is added)

Run it with this one-liner​

Code:
mkdir -p /tmp/mervlan_tmp && /usr/sbin/curl -fsL --retry 3 "https://raw.githubusercontent.com/r80xcore/mervlan/dev/functions/device_support_mapper.sh" -o "/tmp/mervlan_tmp/device_support_mapper.sh" && chmod 0755 /tmp/mervlan_tmp/device_support_mapper.sh && sh /tmp/mervlan_tmp/device_support_mapper.sh

How to use the script​

  1. Start with only the WAN cable connected
    Unplug all LAN cables before running the script.
  2. WAN detection (Step 1/2)
    The script will attempt to detect which interface is used as WAN/uplink.
  3. LAN port mapping (Step 2/2)
    • You’ll be asked how many physical LAN ports your router has (excluding WAN)
    • For each LAN port (LAN1 → LANX):
      • Unplug the LAN cable
      • When prompted, plug the cable into the requested LAN port
      • Press Enter and confirm the detected interface
    • You can retry, skip, or quit at any step
  4. Report generation
    • A detailed report is printed and saved under /tmp/mervlan_tmp/results
    • The script outputs a direct GitHub link with a pre-filled device support request
    • Copy/paste any extra notes if needed and submit the issue
  5. Optional local patch
    • If MerVLAN is already installed, the script can patch hw_probe.sh
    • This enables temporary local support for your device
    • This does not replace official upstream support
⚠️ Important notes

  • You do NOT need to have MerVLAN installed to be able to run this.
  • /tmp is cleared on reboot, nothing persistent is left on the unit — save the report or submit the GitHub issue.
  • Local patching is only meant as a stopgap; please submit the report so official support can be added.
  • This is for AP mode testing, but if we can verify if it works in router mode too it would be great for debugging.

Community added model support
This is the currently added profiles. Special Thanks & High-fives to the users that provided the data to broaden support and help me develop MerVLAN!
MODEL
CONTRIBUTOR
FROM
Added in version
RT-AC86U
RT-AX86U
GT-AX6000
RT-AX86S
RT-AX58U
RT-AX88U**
RT-AX88U_PRO
mistermoonlight1
mistermoonlight1
kstamand /SNB
bieniu
commodoro
amplatfus
jksmurf
SNB
SNB
SNB
Github
SNB
SNB
SNB
v0.52.3
TBR v0.52.4
TBR v0.52.4
v0.52.3
TBR v0.52.4
TBR v0.52.4
TBR v0.52.4
** RT-AX88U can map VLAN ID on port 1-4 individually. Port 5-8 (seen as LAN 5) can only be tagged as a group.

If you know the mapping already you can just fill in a template, examples below (text in brackets [ ] is only informational):
Code:
[nvramname]       [model]                   [interface]                          [LAN ports]                   [max lan ports]       [wan port]
RT-AX86U) MODEL="RT-AX86U"; ETH_PORTS="eth4 eth3 eth2 eth1 eth5"; LAN_PORT_LABELS="LAN1 LAN2 LAN3 LAN4 LAN5"; MAX_ETH_PORTS=5; WAN_IF="eth0" ;;
In this example we start by naming the template [nvramname], this is important as this is compared to the nvram to select the right template. The model can have the same name and is only informational.
Then we map eth4->LAN1, eth3->LAN2, eth2->LAN3, eth1->LAN4 and the eth5 (2.5gb port) to LAN5. We map WAN to eth0 and set the map LAN ports to 5.
Code:
[nvramname]       [model]
RT-AX95Q) MODEL="XT8"; ETH_PORTS="eth1 eth2 eth3"; LAN_PORT_LABELS="LAN1 LAN2 LAN3"; MAX_ETH_PORTS=3; WAN_IF="eth0" ;;
Here we can see another example, the Asus XT8. Here we can see a clear difference on a model that has a [nvramname] that differs a lot from the common name the model is know as. We also see that in this mode the eth ports are mapped to the LAN ports in order.
Code:
[nvramname]        [model]                                                                                                [wan port]
RT-AX58U) MODEL="RT-AX58U"; ETH_PORTS="eth3 eth2 eth1 eth0"; LAN_PORT_LABELS="LAN1 LAN2 LAN3 LAN4"; MAX_ETH_PORTS=4; WAN_IF="eth4" ;;
Here we have a model that doesn't map WAN to eth0, but instead to eth4

You do need to specify the name [nvramname] of the unit as it is printen in nvram. Run this command if you are unsure of it (only needed when manually editing):
Code:
nvram get productid

MerVLAN: Models Requiring Testing
Or manual mapping from already known info.


WiFi 7 / BE Series
  • RT-BE58 Go
  • RT-BE86U
  • RT-BE88U
  • RT-BE92U
  • RT-BE96U
  • GT-BE98 Pro
  • GT-BE19000AI

ROG & High-Performance Series
  • GT-AX11000
  • GT-AX11000 Pro
  • GT-AXE11000
  • GT-AXE16000
  • RT-AX86U Pro

TUF Gaming Series
  • TUF-AX3000 v1
  • TUF-AX3000 v2
  • TUF-AX5400 v1

Standard RT-AX Series
  • RT-AX5400
  • RT-AX58U v2
  • RT-AX68U
  • RT-AX82U v1
  • RT-AX82U v2
  • RT-AX92U
  • DSL-AX82U
  • DSL-AX5400

ZenWiFi (Mesh) Series
  • ZenWiFi ET8
  • ZenWiFi Pro XT12


All models that gets a profile gets exluded from this list.

Any help testing different router models is hugely appreciated. Thanks for helping make MerVLAN better!
 
Last edited:
I'm not sure but for some devices (like my AX58U v2) it might be like this or similar:
eth0 = wan
eth1 = internal 4-port switch as one interface (?)
eth2-3 - wifi

Unless I'm mistaken but have not seen extra interfaces being created for more wired clients on my device...
 
Last edited:
Unless I'm mistaken but have not seen extra interfaces being created for more wired clients...
My XT8 maps:
LAN1-LAN3 --> eth1-eth3
WAN --> eth0
WiFi --> eth4-eth6

This have been verified on other devices too.
Thought it might differ if you are in router or AP-mode. MerVLAN is AP-mode only. Would be interesting to see if that makes a difference when testing.
 
Last edited:
Here you go
GT-AX6000) MODEL="GT-AX6000"; ETH_PORTS="eth4 eth3 eth2 eth1 eth5"; LAN_PORT_LABELS="LAN1 LAN2 LAN3 LAN4 LAN5"; MAX_ETH_PORTS=5; WAN_IF="eth0" ;;
 
Small contribution,

for RT-AX58U_V1

RT-AX58U) MODEL="RT-AX58U"; ETH_PORTS="eth3 eth2 eth1 eth0"; LAN_PORT_LABELS="LAN1 LAN2 LAN3 LAN4"; MAX_ETH_PORTS=4; WAN_IF="eth4" ;;

Regards
 
Last edited:
Hi,

For AX88U:

# Credits: https://wu.renjie.im/blog/network/ax88u-vlan/
# Physical port to interface map:
# eth0 WAN
# eth1 LAN 4
# eth2 LAN 3
# eth3 LAN 2
# eth4 LAN 1
# eth5 Bridge of LAN 5, LAN 6, LAN 7, LAN 8
# eth6 2.4 GHz Radio
# eth7 5 GHz Radio

BR,
amplatfus
 

Run it with this one-liner​

mkdir -p /tmp/mervlan_tmp && /usr/sbin/curl -fsL --retry 3 "https://raw.githubusercontent.com/r80xcore/mervlan/dev/functions/device_support_mapper.sh" -o "/tmp/mervlan_tmp/device_support_mapper.sh" && chmod 0755 /tmp/mervlan_tmp/device_support_mapper.sh && sh /tmp/mervlan_tmp/device_support_mapper.sh

How to use the script​


Pulled all the LAN plugs out, ran it from my Wifi Connected device (as PC was on on one of the Ethernet Ports), ran it twice, got the same error.

Code:
ASUSWRT-Merlin RT-AX88U_PRO 3006.102.7_alpha1-gb21e2fae07 Mon Jan 19 20:49:44 UTC 2026
XXXXXXX@RT-AX88U-Pro:/tmp/home/root# mkdir -p /tmp/mervlan_tmp && /usr/s
bin/curl -fsL --retry 3 "https://raw.githubusercontent.com/r80xcore/mervlan/dev/
functions/device_support_mapper.sh" -o "/tmp/mervlan_tmp/device_support_mapper.s
h" && chmod 0755 /tmp/mervlan_tmp/device_support_mapper.sh && sh
 /tmp/mervlan_tmp/device_support_mapper.sh
-sh: syntax error: unexpected "&"
XXXXXXX@RT-AX88U-Pro:/tmp/home/root#

Went directly to https://raw.githubusercontent.com/r80xcore/mervlan/dev/functions/device_support_mapper.sh, copy and pasted the script to a file (0755) device_support_mapper I made in /jffs/scripts/, ran it manually, works.

No idea what went awry with the original line, so checked syntax and this (below) one seems to work better for me...

Code:
mkdir -p /tmp/mervlan_tmp && /usr/sbin/curl -fsL --retry 3 "https://raw.githubusercontent.com/r80xcore/mervlan/dev/functions/device_support_mapper.sh" -o "/tmp/mervlan_tmp/device_support_mapper.sh" && chmod 0755 /tmp/mervlan_tmp/device_support_mapper.sh && sh /tmp/mervlan_tmp/device_support_mapper.sh

The RT-AX88U Pro has 5 "LAN" Ports; 4 x 1GB labelled LAN1 to 4 and a 2.5GB LAN/WAN.

Unfortunately, on my Router it seems LAN4 is dead (I did not know this OR it is somehow used by something else AiMesh?), so I never got a result for that and your script does not skip to what I was going to call LAN5 i.e. the 2.5GB port (located between LAN1 and the WAN port). Anyway, sorry but my results... as far as I have them, are below. Sorry you will need to find someone with a working RT-AX88U Pro unit, unless there is a reason for the Dead LAN4.

RT-AX88U_PRO) MODEL="RT-AX88U_PRO"; ETH_PORTS="eth1 eth2 eth3"; LAN_PORT_LABELS="LAN1 LAN2 LAN3"; MAX_ETH_PORTS=3; WAN_IF="eth0" ;;

Then when I went to look at it under LAN, VLAN (to see what was on LAN4) the page was blank, had to reboot the Router to get the screen back (below). The AiMesh Nodes also showed dead before the reboot. Probably due to yanking out the Ethernet cables...

Fun and games.

What.jpg

VLAN_OK.jpg


[EDIT]
So rebooted again, got VLANs back, attached a known working Ethernet device, redid it using PC Wifi Network Adapter. Result:

RT-AX88U_PRO) MODEL="RT-AX88U_PRO"; ETH_PORTS="eth1 eth2 eth3 eth4 eth5"; LAN_PORT_LABELS="LAN1 LAN2 LAN3 LAN4 LAN5"; MAX_ETH_PORTS=5; WAN_IF="eth0" ;;

Note LAN5 is the port labelled 2.5G LAN/1G WAN, as above. HTH.
 
Last edited:
Pulled all the LAN plugs out, ran it from my Wifi Connected device (as PC was on on one of the Ethernet Ports), ran it twice, got the same error.

Code:
ASUSWRT-Merlin RT-AX88U_PRO 3006.102.7_alpha1-gb21e2fae07 Mon Jan 19 20:49:44 UTC 2026
XXXXXXX@RT-AX88U-Pro:/tmp/home/root# mkdir -p /tmp/mervlan_tmp && /usr/s
bin/curl -fsL --retry 3 "https://raw.githubusercontent.com/r80xcore/mervlan/dev/
functions/device_support_mapper.sh" -o "/tmp/mervlan_tmp/device_support_mapper.s
h" && chmod 0755 /tmp/mervlan_tmp/device_support_mapper.sh && sh
 /tmp/mervlan_tmp/device_support_mapper.sh
-sh: syntax error: unexpected "&"
XXXXXXX@RT-AX88U-Pro:/tmp/home/root#

Went directly to https://raw.githubusercontent.com/r80xcore/mervlan/dev/functions/device_support_mapper.sh, copy and pasted the script to a file (0755) device_support_mapper I made in /jffs/scripts/, ran it manually, works.

No idea what went awry with the original line, so checked syntax and this (below) one seems to work better for me...

Code:
mkdir -p /tmp/mervlan_tmp && /usr/sbin/curl -fsL --retry 3 "https://raw.githubusercontent.com/r80xcore/mervlan/dev/functions/device_support_mapper.sh" -o "/tmp/mervlan_tmp/device_support_mapper.sh" && chmod 0755 /tmp/mervlan_tmp/device_support_mapper.sh && sh /tmp/mervlan_tmp/device_support_mapper.sh

The RT-AX88U Pro has 5 "LAN" Ports; 4 x 1GB labelled LAN1 to 4 and a 2.5GB LAN/WAN.

Unfortunately, on my Router it seems LAN4 is dead (I did not know this OR it is somehow used by something else AiMesh?), so I never got a result for that and your script does not skip to what I was going to call LAN5 i.e. the 2.5GB port (located between LAN1 and the WAN port). Anyway, sorry but my results... as far as I have them, are below. Sorry you will need to find someone with a working RT-AX88U Pro unit, unless there is a reason for the Dead LAN4.

RT-AX88U_PRO) MODEL="RT-AX88U_PRO"; ETH_PORTS="eth1 eth2 eth3"; LAN_PORT_LABELS="LAN1 LAN2 LAN3"; MAX_ETH_PORTS=3; WAN_IF="eth0" ;;

Then when I went to look at it under LAN, VLAN (to see what was on LAN4) the page was blank, had to reboot the Router to get the screen back (below). The AiMesh Nodes also showed dead before the reboot. Probably due to yanking out the Ethernet cables...

Fun and games.

View attachment 70116
View attachment 70119

[EDIT]
So rebooted again, got VLANs back, attached a known working Ethernet device, redid it using PC Wifi Network Adapter. Result:

RT-AX88U_PRO) MODEL="RT-AX88U_PRO"; ETH_PORTS="eth1 eth2 eth3 eth4 eth5"; LAN_PORT_LABELS="LAN1 LAN2 LAN3 LAN4 LAN5"; MAX_ETH_PORTS=5; WAN_IF="eth0" ;;

Note LAN5 is the port labelled 2.5G LAN/1G WAN, as above. HTH.

Thank you for testing it out!

Yea sorry for the typo in the script starter. I have fix that now!

That was some strange issues you had. But great that it worked out in the end. Thank you for the profile!
 
Just tried the script on a RT-BE92U: 10Gb WAN port was detected ok, but the script was unable to detect any LAN ports. Any suggestions how to proceed?

Not sure if this would be of any interest to you, but I'm currently also trying to setup link aggregation. Setting up vlans (through IPTV) I am able to get eth0.v1 and eth0.v2 to be assigned for LAN 3 and 4 ports.
 
Last edited:
Just tried the script on a RT-BE92U: 10Gb WAN port was detected ok, but the script was unable to detect any LAN ports. Any suggestions how to proceed?

Not sure if this would be of any interest to you, but I'm currently also trying to setup link aggregation. Setting up vlans (through IPTV) I am able to get eth0.v0 and eth0.v2 to be assigned for LAN 3 and 4 ports.
Thank you for testing it! The problem seems to come from the fact the the hardware on your unit differs. If you want I could really use the output from three commands to strengthen both this script but also the MerVLAN addon.

Run this twice. Once with only WAN connected and once with a cable in LAN1 too.
Code:
cat > /tmp/diag.sh <<'EOF'
#!/bin/sh

echo "Ready. Press Enter to run (Ctrl+C cancels)."
read -r _

MODEL="$(nvram get productid 2>/dev/null)"
BUILD="$(nvram get buildno 2>/dev/null)"
EXT="$(nvram get extendno 2>/dev/null)"
echo "MODEL=$MODEL"
echo "BUILD=$BUILD"
echo "EXT=$EXT"

echo "---NETDEVS---"
ls -1 /sys/class/net 2>/dev/null | sort

echo "---BR0---"
if [ -d /sys/class/net/br0/brif ]; then
  ls -1 /sys/class/net/br0/brif | sort
else
  echo "no br0"
fi

echo "---STATE (carrier/operstate)---"
CANDS="$(ls -1 /sys/class/net 2>/dev/null \
  | grep -E '^(eth[0-9]+(\.v[0-9]+)?|vlan[0-9]+|lan[0-9]+)$' \
  | sort)"
for i in $CANDS; do
  c="?"
  op="?"
  [ -r "/sys/class/net/$i/carrier" ] && c="$(cat "/sys/class/net/$i/carrier" 2>/dev/null)"
  [ -r "/sys/class/net/$i/operstate" ] && op="$(cat "/sys/class/net/$i/operstate" 2>/dev/null)"
  echo "$i carrier=$c oper=$op"
done

echo "---ETHCTL (Link is)---"
ETHS="$(ls -1 /sys/class/net 2>/dev/null \
  | grep -E '^eth[0-9]+(\.v[0-9]+)?$' \
  | sort)"
for i in $ETHS; do
  echo "== $i =="
  ethctl "$i" media-type 2>/dev/null | grep -m1 'Link is' \
    || echo "(no ethctl / no Link is)"
done

echo "---SWITCH HINTS---"
ls -1 /proc/switch 2>/dev/null || echo "no /proc/switch"
if command -v robocfg >/dev/null 2>&1; then
  robocfg show 2>/dev/null | head -n 80
else
  echo "no robocfg"
fi
EOF

chmod +x /tmp/diag.sh
/tmp/diag.sh

Then run this command:
Code:
ethctl -h 2>&1 | head -n 80
ethctl bcmsw media-type 2>&1 | head -n 80

And this command:
Code:
nvram show 2>/dev/null | grep -E '(^|_)lan_ifnames|(^|_)wan_ifnames|wan0_ifname|wan_ifname|iptv|vlan|bond|lag|lacp|switch' | sort

Send this info to me in a txt document if you got the time and want to help!
 
Not sure how many models will be like this; the script does not work for the GT-BE98 PRO as it has the 4 x 2.5G ports all sharing a single eth interface behind an internal switch.

Here is what I have determined using `brctl show`, `ethtool`, and `ip link show`:
  • eth0 = LAN 1 - 10G
  • eth1 = (Always shows as link status UP even when nothing is plugged in)
    • LAN 1 - 2.5G (both LAN 1 ports can be used at the same time with this router)
    • LAN 2 - 2.5G
    • LAN 3 - 2.5G
    • LAN 4 - 2.5G
  • eth2 = LAN 5 - 1G
  • eth3 = LAN 6 - 10G
Maybe a check to see if more than one eth interface has a link status of UP to maybe identify this scenario?
 
Not sure how many models will be like this; the script does not work for the GT-BE98 PRO as it has the 4 x 2.5G ports all sharing a single eth interface behind an internal switch.

Here is what I have determined using `brctl show`, `ethtool`, and `ip link show`:
  • eth0 = LAN 1 - 10G
  • eth1 = (Always shows as link status UP even when nothing is plugged in)
    • LAN 1 - 2.5G (both LAN 1 ports can be used at the same time with this router)
    • LAN 2 - 2.5G
    • LAN 3 - 2.5G
    • LAN 4 - 2.5G
  • eth2 = LAN 5 - 1G
  • eth3 = LAN 6 - 10G
Maybe a check to see if more than one eth interface has a link status of UP to maybe identify this scenario?
It seems most models that has native support for vlans also uses a different bridge setup where the ethX are not exposed directly.

Without one of these models at my my disposal or someone that would co-develop MerVLAN for models like this, it's really hard for me to debug this. For the current being the fallback is to handle the port hidden under a combined bridge as one Interface and let those get tagged together.

In a future release I am planning a modular ETH handler override from the UI where the user can override the ports and experiment more.

But for now I need to get more device map profiles.

I guess that ETH0 is the WAN port here?
 
It seems most models that has native support for vlans also uses a different bridge setup where the ethX are not exposed directly.

Without one of these models at my my disposal or someone that would co-develop MerVLAN for models like this, it's really hard for me to debug this. For the current being the fallback is to handle the port hidden under a combined bridge as one Interface and let those get tagged together.

In a future release I am planning a modular ETH handler override from the UI where the user can override the ports and experiment more.

But for now I need to get more device map profiles.

I guess that ETH0 is the WAN port here?
Yes, ETH0 is the primary WAN port, however, the router has two that are labeled and are selectable as the WAN port in the settings (LAN 1 - 10G and LAN1 - 2.5G).

Be happy to gather more information or run some tests if ever needed.
 

Attachments

  • rt-be98pro_ports.jpg
    rt-be98pro_ports.jpg
    79.6 KB · Views: 6
What is the correct step to test out this config? I added this to the hw_probe.sh and re-ran hw_probe then install.sh (the asp page did not update unless I rerun install). I was hoping to see the labels, but they did not show on the page. Are the hyphens and underscore not allowed? Thank you.
Code:
[nvramname]       [model]                   [interface]                          [LAN ports]                   [max lan ports]       [wan port]
GT-BE98_PRO) MODEL="GT-BE98_PRO"; ETH_PORTS="eth0 eth1 eth2 eth3"; LAN_PORT_LABELS="LAN1_10G LAN1-4 LAN5 LAN6"; MAX_ETH_PORTS=4; WAN_IF="eth0" ;;

Attached is how it looks after I do this:
 

Attachments

  • Screenshot 2026-02-16 104446.png
    Screenshot 2026-02-16 104446.png
    182.4 KB · Views: 5
What is the correct step to test out this config? I added this to the hw_probe.sh and re-ran hw_probe then install.sh (the asp page did not update unless I rerun install). I was hoping to see the labels, but they did not show on the page. Are the hyphens and underscore not allowed? Thank you.
Code:
[nvramname]       [model]                   [interface]                          [LAN ports]                   [max lan ports]       [wan port]
GT-BE98_PRO) MODEL="GT-BE98_PRO"; ETH_PORTS="eth0 eth1 eth2 eth3"; LAN_PORT_LABELS="LAN1_10G LAN1-4 LAN5 LAN6"; MAX_ETH_PORTS=4; WAN_IF="eth0" ;;

Attached is how it looks after I do this:
It should look like this:

Code:
[nvramname]       [model]                   [interface]                          [LAN ports]                   [max lan ports]       [wan port]
GT-BE98_PRO) MODEL="GT-BE98_PRO"; ETH_PORTS="eth1 eth2 eth3"; LAN_PORT_LABELS="LAN1 LAN2 LAN3"; MAX_ETH_PORTS=3; WAN_IF="eth0" ;;

The ports in this case is strictly "what goes where", think of it as a switch, this port goes to this label. It's so the scripts and UI knows what to do. A rename function is planned but not implemented yet. Right now you will have to keep track what LAN1-3 is.
 

Latest 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