Network interface warning has a issue

https://openwrt.org/docs/guide-user/network/network_configuration#section_interface

The Linux kernel limits the physical interface name length to 15 characters including the automatically added prefix that is added for some protocols (e.g.6in4, pppoa-, pppoe-, gre4t-) or with bridges (br-).

Before I change this I want to hear your opinion. I stumbled on this problem IRL this week. I had made a bridge named switch0 and this bridge has both 2, 3 and 4 digit vlans.

And I wasn’t able to get it to work. I noticed that the 2 and 3 digit vlan interfaces worked but not the 4 digit vlan interfaces.

I sleept on the problem and remembered that I had seen a length warning somewhere. And sure here it was found.

The problem is that it isn’t “above 15 char” that is the limit. It is max 14char or “15 and above”, all depending on how you interpret this warning and if we count in binary or in a normal way.

br-switch0.nnnn is exactly 15 char and doesn’t work.
br-switch0.nnn is 14 char and work.
br-switch0.nn is 13 char and work.

I don't know about the underlying limits, but you could just rename the bridge to something shorter (maybe br-sw) to claw back some of those characters.

I did, it ended up named br-sw0.nnnn.

But I think we should change the warning text since it is obviously faulty or I count the char in the wrong way. Because the warning say 15 char should work.

so the 4-digit suffix did work without issue as long as the whole name was 14 characters or fewer?

I'd say that clarifying the documentation to say "less than 15" or "no longer than 14 characters" would be good.

2 Likes

Exactly.

But as the text said, it is a silent error. I found it when I run ip address and saw what interfaces it loaded and which wasn’t loaded at all.

I also while investigating tried to only remove the ‘0’ in switch0 so the longest name became 14char and then all interfaces started working.

I think it is probably accurate to say that it is a silent error if it just fails but doesn't actively alert you to the issue.

What exactly did the ip address command show?

It list all devices and after that all vlan interfaces with their mac and hopefully an IP if it works.

But when this happens the interface that are to long isn’t created or shown at all.

But in that command the whole interface name is printed.

Can you show an example of this? It might be good for the documentation to be able to point to this as a method of troubleshooting.

1 Like

I can try remake the error to show how I found it. But now new year is close so I doubt I make it before that is done :partying_face:

1 Like

Just a note to tackle this kind of fault, to troubleshoot this error a serial connection is required since probably no meaningful working connectivity to the router exists.

It kills all networks? Or just the one(s) with longer names?

It only ignores the interfaces that get to long name. It was because of that I started woundering about the length because I knew the bridge it self worked since some networks got loaded.

If we on wrt3200acm make an test setup that is little extreme but it shows what is going on pretty clear.

If we first makes three interfaces with three lengths of VLAN number, 33, 222 and 1111. We also have the wan at number 2 but that won't matter here. We also make a big bridge name called br-switch10.

root@OpenWrt:~# uci export network
package network

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

config globals 'globals'
        option ula_prefix 'ip:secret6::/48'

config device
        option name 'wan'
        option macaddr 'mac:secret'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config device
        option type 'bridge'
        option name 'br-switch10'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config bridge-vlan
        option device 'br-switch10'
        option vlan '1111'
        list ports 'lan1:u'
        list ports 'lan2:u'

config bridge-vlan
        option device 'br-switch10'
        option vlan '222'
        list ports 'lan3:u'

config bridge-vlan
        option device 'br-switch10'
        option vlan '33'
        list ports 'lan4:u'

config interface 'block1'
        option device 'br-switch10.1111'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.5.1'
        option ip6assign '64'
        option ip6hint '1111'

config interface 'block2'
        option device 'br-switch10.222'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.30.1'
        option ip6assign '64'
        option ip6hint '222'

config interface 'block3'
        option device 'br-switch10.33'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.70.1'
        option ip6assign '64'
        option ip6hint '33'

root@OpenWrt:~#

if we now run ip address it looks like this:

root@OpenWrt:~# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP qlen 1024
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
3: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-switch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
4: lan3@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-switch10 state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-switch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-switch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
7: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret brd ff:ff:ff:ff:ff:ff
    inet ip:secret1/24 brd ip:secret2 scope global wan
       valid_lft forever preferred_lft forever
    inet6 ip:secret3/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 ip:secret4/64 scope global deprecated dynamic noprefixroute
       valid_lft 1779sec preferred_lft 0sec
    inet6 ip:secret5/64 scope link
       valid_lft forever preferred_lft forever
13: br-switch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
14: br-switch10.33@br-switch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.70.1/24 brd 192.168.70.255 scope global br-switch10.33
       valid_lft forever preferred_lft forever
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
root@OpenWrt:~#

wan works and get an upstream IP address at line 7, it is also possible to ping 8.8.8.8 with the serial port. The big bridge is also loaded at line 13.
At line 14 we se that the interface with VLAN 33 is also loaded and has its gateway IP address. But that's it, we are missing the VLAN 222 and 1111 interfaces.

'br-switch10.33' at line 14 is 14 chars.

Now we continue and remove 's' in br-switch10 so it becomes br-witch10 and reloads the network setup.

Now we get a network config that looks like this:

root@OpenWrt:~# uci export network
package network

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

config globals 'globals'
        option ula_prefix 'ip:secret6::/48'

config device
        option name 'wan'
        option macaddr 'mac:secret'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config device
        option type 'bridge'
        option name 'br-witch10'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config bridge-vlan
        option device 'br-witch10'
        option vlan '1111'
        list ports 'lan1:u'
        list ports 'lan2:u'

config bridge-vlan
        option device 'br-witch10'
        option vlan '222'
        list ports 'lan3:u'

config bridge-vlan
        option device 'br-witch10'
        option vlan '33'
        list ports 'lan4:u'

config interface 'block1'
        option device 'br-witch10.1111'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.5.1'
        option ip6assign '64'
        option ip6hint '1111'

config interface 'block2'
        option device 'br-witch10.222'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.30.1'
        option ip6assign '64'
        option ip6hint '222'

config interface 'block3'
        option device 'br-witch10.33'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.70.1'
        option ip6assign '64'
        option ip6hint '33'

root@OpenWrt:~#

and if we run ip address it looks like this:

root@OpenWrt:~# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP qlen 1024
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
3: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-witch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
4: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-witch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-witch10 state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-witch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
7: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret brd ff:ff:ff:ff:ff:ff
    inet ip:secret1/24 brd ip:secret2 scope global wan
       valid_lft forever preferred_lft forever
    inet6 ip:secret3/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 ip:secret4/64 scope global dynamic noprefixroute
       valid_lft 1799sec preferred_lft 1799sec
    inet6 ip:secret5/64 scope link
       valid_lft forever preferred_lft forever
15: br-witch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
16: br-witch10.222@br-witch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.30.1/24 brd 192.168.30.255 scope global br-witch10.222
       valid_lft forever preferred_lft forever
    inet6 ip:secret6:222::1/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
17: br-witch10.33@br-witch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.70.1/24 brd 192.168.70.255 scope global br-witch10.33
       valid_lft forever preferred_lft forever
    inet6 ip:secret6:33::1/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
root@OpenWrt:~#

'16: br-witch10.222@br-witch10'...Look now we have another VLAN and interface fully loaded and working.
But 16: 'br-witch10.222' is still 14 char.

We move on and remove another char in the bridge, 'w' this time.
This give a new network config that looks like this:

root@OpenWrt:~# uci export network
package network

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

config globals 'globals'
        option ula_prefix 'ip:secret6::/48'

config device
        option name 'wan'
        option macaddr 'mac:secret'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config device
        option type 'bridge'
        option name 'br-itch10'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config bridge-vlan
        option device 'br-itch10'
        option vlan '1111'
        list ports 'lan1:u'
        list ports 'lan2:u'

config bridge-vlan
        option device 'br-itch10'
        option vlan '222'
        list ports 'lan3:u'

config bridge-vlan
        option device 'br-itch10'
        option vlan '33'
        list ports 'lan4:u'

config interface 'block1'
        option device 'br-itch10.1111'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.5.1'
        option ip6assign '64'
        option ip6hint '1111'

config interface 'block2'
        option device 'br-itch10.222'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.30.1'
        option ip6assign '64'
        option ip6hint '222'

config interface 'block3'
        option device 'br-itch10.33'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.70.1'
        option ip6assign '64'
        option ip6hint '33'

root@OpenWrt:~#

And ip address

root@OpenWrt:~# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP qlen 1024
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
3: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-itch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
4: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-itch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-itch10 state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-itch10 state LOWERLAYERDOWN qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
7: wan@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret brd ff:ff:ff:ff:ff:ff
    inet ip:secret1/24 brd ip:secret2 scope global wan
       valid_lft forever preferred_lft forever
    inet6 ip:secret3/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 ip:secret4/64 scope global dynamic noprefixroute
       valid_lft 1670sec preferred_lft 1670sec
    inet6 ip:secret5/64 scope link
       valid_lft forever preferred_lft forever
18: br-itch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
19: br-itch10.1111@br-itch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.1/24 brd 192.168.5.255 scope global br-itch10.1111
       valid_lft forever preferred_lft forever
    inet6 ip:secret6:1111::1/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
20: br-itch10.222@br-itch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.30.1/24 brd 192.168.30.255 scope global br-itch10.222
       valid_lft forever preferred_lft forever
    inet6 ip:secret6:222::1/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
21: br-itch10.33@br-itch10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether mac:secret2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.70.1/24 brd 192.168.70.255 scope global br-itch10.33
       valid_lft forever preferred_lft forever
    inet6 ip:secret6:33::1/64 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 mac:secret3/64 scope link
       valid_lft forever preferred_lft forever
root@OpenWrt:~#

Look how nice, here they all are at line 19, 20 and 21. All the VLAN and working interfaces with gateway IP address fully operational.
Still we have 'br-itch10.1111' that now is 14char and therefore is now working.

The wiki update and link to the above example is also now done. So case closed.

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