[Solved] Having a hard time with VLANs - interface name was too long

Hi,

I've been banging my head against the LEDE configs for a little while now trying to create a new VLAN interface and haven't had much luck. Specifically, the router (Netgear R7800) is configured as a Dumb AP with an IP address on vlan 1. The AP is connected via the WAN port to an upstream firewall. I've created two SSIDs, one for the primary network and the other for guests. The upstream firewall is configured as a trunk port with the untagged VLAN being the primary network and vlan 111 being for guest traffic. I created an interface for the guest vlan (unmanaged), created the guest SSID, assigned the VLAN to the switch ports (tagged), and created the Guest SSID. Network config is:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd3f:cae7:1139::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.5'
        option gateway '192.168.1.1'
        option dns '1.1.1.1'
        option ifname 'eth1.1'
        option auto '1'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'

config interface 'Guest'
        option ifname 'eth1.111'
        option type 'bridge'
        option proto 'none'
        option auto '1'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '1 2 3 4 5 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0'
        option vid '2'

config switch_vlan
        option device 'switch0'
        option vlan '3'
        option ports '5t 6t'
        option vid '111'

Wireless config is:

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'soc/1b500000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'VHT80'
        option country 'US'
        option channel '153'
        option noscan '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'PrimaryNet'
        option encryption 'psk2'
        option key 'censored'
        option wmm '1'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
        option htmode 'HT20'
        option country 'US'
        option channel '6'
        option noscan '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'PrimaryNet'
        option encryption 'psk2'
        option key 'censored'
        option wmm '1'

config wifi-iface
        option device 'radio1'
        option mode 'ap'
        option encryption 'none'
        option ssid 'Guest'
        option network 'Guest'

Output of ifconfig:

br-lan    Link encap:Ethernet  HWaddr DC:EF:09:E3:B9:6B
          inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd3f:cae7:1139::1/60 Scope:Global
          inet6 addr: fe80::deef:9ff:fee3:b96b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5574 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1486 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:994499 (971.1 KiB)  TX bytes:467966 (456.9 KiB)

eth0      Link encap:Ethernet  HWaddr DC:EF:09:E3:B9:6C
          inet6 addr: fe80::deef:9ff:fee3:b96c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:235 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:76192 (74.4 KiB)
          Interrupt:30

eth1      Link encap:Ethernet  HWaddr DC:EF:09:E3:B9:6B
          inet6 addr: fe80::deef:9ff:fee3:b96b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:382927 errors:0 dropped:0 overruns:0 frame:0
          TX packets:214376 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:557544286 (531.7 MiB)  TX bytes:20711664 (19.7 MiB)
          Interrupt:31

eth1.1    Link encap:Ethernet  HWaddr DC:EF:09:E3:B9:6B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:382927 errors:0 dropped:0 overruns:0 frame:0
          TX packets:214362 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:550651600 (525.1 MiB)  TX bytes:19851847 (18.9 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr DC:EF:09:E3:B9:6D
          inet6 addr: fe80::deef:9ff:fee3:b96d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25855 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26492 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5003330 (4.7 MiB)  TX bytes:7996181 (7.6 MiB)

wlan1     Link encap:Ethernet  HWaddr DC:EF:09:E3:B9:6E
          inet6 addr: fe80::deef:9ff:fee3:b96e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:197018 errors:0 dropped:0 overruns:0 frame:0
          TX packets:372439 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15765203 (15.0 MiB)  TX bytes:558936349 (533.0 MiB)

wlan1-1   Link encap:Ethernet  HWaddr DE:EF:09:E3:B9:6E
          inet6 addr: fe80::dcef:9ff:fee3:b96e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:864 (864.0 B)

It appears that the bridge interface and vlan interface are never created, regardless of what I try. I've tried rebooting, etc. What am I missing??

Thanks for your help.

When you have a choice (and you do here), do not try to run untagged and tagged traffic on the same Ethernet cable. Tag both your LAN and the guests on the trunk cable.

By convention, use all lowercase for network names.

Thanks - will do. Is that the reason that the interfaces are not being created? Seems odd (regardless of tagging) that the interfaces in the config file aren't showing up in ifconfig...

Figured out the issue. It appears there is a bug relating to the interface name length. If I rename the VLAN 111 interface to a short name, everything works. Clearly I was hitting a wall relating to the character length and it wasn't willing to truncate. Interesting...

How does one go about submitting a bug?

If your interface name was longer than 15 characters, it isn't a bug.

See:

https://elixir.bootlin.com/linux/v3.19/source/include/uapi/linux/if.h#L26

Also, no config you displayed shows a a VLAN 111, just Switch configs.

Yeah, I've been bitten by that quite a few times. OpenWRT also insists in prefixing names so the 15-character limit goes away pretty quickly

gre4t-ABCD.NNNN

You've got only four characters to specify the OpenWRT interface name when using VLAN notation and one of the longer-named interface types.

I can't say that it's a bug, per se, as the Linux standard is a 15-character interface name.

Thanks. Yeah...the length issue should have hit me sooner.

Agree that it isn't really a bug, more of a feature request? It would be a bit more friendly if it didn't fail silently (LuCi doesn't error on it either) so you pretty much need to stare at it until you realize your mistake.

Thanks for everyone's help!

Agreed, as there is nothing in the logs indicating that there is a configuration that is incompatible with the "hidden" renaming of interfaces done by netifd

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.