LAN interface status "NO_DEVICE" on custom snapshot build

I have built a custom build of the latest snapshot release (r16206-bb95be9265) for the TP-Link TL-WR842ND v2 platform. The configuration is heavily modified to minimize the size of the image, no changes have been made to the actual source code. When I boot my firmware image the LAN interface does not come up, through a serial header I can see the following in ifstatus:

root@OpenWrt:/# ifstatus lan
{
[...]
        "errors": [
                {
                        "subsystem": "interface",
                        "code": "NO_DEVICE"
[...]

I do see the Ethernet interfaces present and they appear to be functioning correctly, though showing as down:

root@OpenWrt:/# ip a s eth0
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN qlen 1000
    link/ether 30:b5:c2:e7:75:5a brd ff:ff:ff:ff:ff:ff

On another router running an official snapshot build I see my interface functioning correctly:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether 30:b5:c2:e7:70:b6 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::32b5:c2ff:fee7:70b6/64 scope link 
       valid_lft forever preferred_lft forever

Examining dmesg we can see the interface came up and then went down during bootup / interface configuration:

root@OpenWrt:/# dmesg | grep eth0
[    1.488419] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    6.765014] eth0: link up (1000Mbps/Full duplex)
[   11.232896] eth0: link down

If I reboot the router in failsafe mode the LAN interface comes up correctly and is usable:

root@(none):/# ip a s eth0.1
4: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 30:b5:c2:e7:75:5a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global eth0.1
       valid_lft forever preferred_lft forever

The /etc/config/network file is generated as expected on the first boot and appears identical between the two devices; the relevant sections are as follows:

root@OpenWrt:/# cat /etc/config/network
[...]
config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 0t'

Big thanks to @jow for helping to me understand the issue with some troubleshooting assistance on IRC. The root cause of the issue is the lack of bridge support caused by changes to .config and kernel_menuconfig.

If you want to test for this type of issue yourself you can run the following command brctl addbr test, it shouldn't fail, if it does as in the following example then something is wrong with your kernel bridge support.

root@OpenWrt:/# brctl addbr test
brctl: bridge test: No error information

I could work around the issue by commenting out the option type 'bridge' setting but I need the interface to be a bridge.

Avoid making changes to disable IPv6 like I did, it can cause all kinds of unusual issues.

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