Skip to content
Contents
GuidesOpenWrt

OpenWrt tunnel names: count protocol prefixes and VLAN suffixes before renaming

From l3_device, obtain the actual device name of the tunnel, count the protocol prefix and VLAN suffix together in bytes, then verify strategy binding.

The logical interface name written in UCI may not be the exact device name ultimately created by the kernel. Some protocol processors add a prefix, and when VLANs are stacked, an additional .ID may be appended. The Linux conventional interface name buffer is 16 bytes long, including the terminating null character, so the actual name can be at most 15 bytes.

Get the real name from running state

On the router, replace office with your logical interface. First check the status, then view the device table:

ubus call network.interface.office status
ip -o link show
logread -e netifd

Look for device, l3_device, and the actual interfaces registered in the kernel. Field values may be missing during offline operation; combine this with the failure log from the first entry for analysis. Assume a protocol generates a four-byte prefix gre-, with a base name officewest occupying ten bytes, plus .20 for three bytes, totaling seventeen bytes. This can be verified in shell using printf %s gre-officewest.20 | wc -c. This example does not imply that all protocols share the same prefix.

Before renaming, first check dependencies

For cases exceeding the limit, during test configuration shorten the base name and then verify firewall zones, policy routing, and script references. When the length is compliant, check for name conflicts, peer addresses, and protocol loading errors. During acceptance, first confirm the target device is present, then verify that a previously allowed service can reach the peer through the tunnel. If renaming causes existing policies to lose binding, restore the original interface name and references via the wired management port.

Reference

Related guide · Plan four VLANs on OpenWrt and map each managed switch port

Explore hardware

Comments