LAN doesn't work in 19.07.2 custom build

Hi!

I have been using DIR-615-C1 for many years with OpenWRT. I always used stable releases for this router, but after 17.01.4 I have to make custom builds.
Latest working firmware was custom build 18.06.4.
After that I compiled custom build 19.07.2 without pppoe, IPv6 and firewall(it's not need because I use this router as repeater).
Also I disabled all devices except DIR-615-C1 from kernel - [Solved] Building a smaller kernel for a specific device

Now LAN and WAN ports don't work: I can't ping any local address from the router and the router doesn't response to ping from LAN side. Physical layer works: LED blinks and I see in the log that link is up.
By the way WLAN works without problem.
LAN(eth0.1), WAN(eth1) and WLAN are in one bridge.

It is not a problem with memory: free RAM is above 8Mb, free ROM is above 300kb.

There are my configs below. Also there is the log from serial console.

Network config:

root@OpenWrt:~# cat /etc/config/network

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

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option delegate '0'
        option ifname 'eth0.1 eth1'
        option ipaddr '11.0.1.5'
        option gateway '11.0.1.1'
        list dns '11.0.1.1'

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'

Wireless config:

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/ath9k'
        option htmode 'HT20'
        option disabled '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

Serial log:

U-Boot 1.1.4 (Sep  5 2008 - 17:05:35)

AP81 (ar7100) U-boot
DRAM:  AP81 initdram

sri:ddr_init
32 MB
Top of RAM usable for U-Boot at: 82000000
Reserving 177k for U-Boot at: 81fd0000
Reserving 192k for malloc() at: 81fa0000
Reserving 44 Bytes for Board Info at: 81f9ffd4
Reserving 36 Bytes for Global Data at: 81f9ffb0
Reserving 128k for boot params() at: 81f7ffb0
Stack Pointer at: 81f7ff98
Now running in RAM - U-Boot at: 81fd0000
ar7100 flash_init
id read 0x10000107
flash size 400000, sector count = 64
Flash:  4 MB
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   eth_initialize CONFIG_NET_MULTI
ag7100_enet_initialize
eth0: 00:22:b0:ba:50:1f
ethernet found.
eth0
## Booting image at bf030000 ...
checksum:970e3d35
   Image Name:   MIPS OpenWrt Linux-4.14.171
   Created:      2020-02-27  21:05:12 UTC
   Image Type:   MIPS Linux Kernel Image (lzma  compressed)
   Data Size:    1212538 Bytes =  1.2 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   LZMA Umcompressing Kernel Image ...    Image loaded from 80060000-803f752c
    OK
   Boot image os 5=IH_OS_LINUX
## do_bootm_linux start....
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 33554432

##Starting kernel ...

[    0.000000] Linux version 4.14.171 (pine@dev) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10947-65030d81f3)) #0 Thu Feb 27 21:05:12 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR9130 rev 1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff]
[    0.000000] random: get_random_bytes called from 0x803d46ec with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 8128
[    0.000000] Kernel command line:  board=DIR-615-C1 console=ttyS0,115200 mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[    0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 28128K/32768K available (2981K kernel code, 147K rwdata, 400K rodata, 176K init, 197K bss, 4640K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:100.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000013] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.008020] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.094384] pid_max: default: 32768 minimum: 301
[    0.099357] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.106072] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.116277] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.126299] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.133106] NET: Registered protocol family 16
[    0.139170] MIPS: machine is D-Link DIR-615 rev. C1
[    0.716704] clocksource: Switched to clocksource MIPS
[    0.723169] NET: Registered protocol family 2
[    0.728721] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.735810] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.742328] TCP: Hash tables configured (established 1024 bind 1024)
[    0.748984] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.754924] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.761674] NET: Registered protocol family 1
[    0.771845] Crashlog allocated RAM at address 0x1f00000
[    0.778866] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.793047] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.799020] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.821269] io scheduler noop registered
[    0.825251] io scheduler deadline registered (default)
[    0.830838] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.837836] console [ttyS0] disabled
[    0.861512] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 6250000) is a 16550A
[    0.870280] console [ttyS0] enabled
[    0.870280] console [ttyS0] enabled
[    0.877285] bootconsole [early0] disabled
[    0.877285] bootconsole [early0] disabled
[    0.890329] m25p80 spi0.0: found s25sl032a, expected m25p80
[    0.895914] m25p80 spi0.0: s25sl032a (4096 Kbytes)
[    0.900793] 4 cmdlinepart partitions found on MTD device spi0.0
[    0.906705] Creating 4 MTD partitions on "spi0.0":
[    0.911497] 0x000000000000-0x000000020000 : "u-boot"
[    0.919436] 0x000000020000-0x000000030000 : "config"
[    0.926237] 0x000000030000-0x0000003f0000 : "firmware"
[    0.943131] 2 uimage-fw partitions found on MTD device firmware
[    0.949090] 0x000000030000-0x0000001580ba : "kernel"
[    0.955066] 0x0000001580ba-0x0000003f0000 : "rootfs"
[    0.961090] mtd: device 4 (rootfs) set to be root filesystem
[    0.966868] 1 squashfs-split partitions found on MTD device rootfs
[    0.973041] 0x000000360000-0x0000003f0000 : "rootfs_data"
[    0.982061] 0x0000003f0000-0x000000400000 : "art"
[    0.989963] libphy: Fixed MDIO Bus: probed
[    1.009767] switch0: Atheros AR8216 rev. 1 switch registered on ag71xx-mdio.0
[    1.018451] libphy: ag71xx_mdio: probed
[    1.404882] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd042, driver=Atheros AR8216/AR8236/AR8316]
[    1.416336] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rmii
[    1.758130] ag71xx ag71xx.1: connected to PHY at ag71xx-mdio.0:04 [uid=004dd042, driver=Atheros AR8216/AR8236/AR8316]
[    1.769592] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: rmii
[    1.777610] NET: Registered protocol family 17
[    1.785464] 8021q: 802.1Q VLAN Support v1.8
[    1.797476] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    1.805612] Freeing unused kernel memory: 176K
[    1.810102] This architecture does not have kernel memory protection.
[    2.566718] random: fast init done
[    3.054897] init: Console is alive
[    3.058682] init: - watchdog -
[    4.226995] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.305281] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.323562] init: - preinit -
[    5.904118] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    6.897153] eth0: link up (100Mbps/Full duplex)
[    9.289216] jffs2: notice: (364) jffs2_build_xattr_subsystem: complete building xattr subsystem, 8 of xdatum (0 unchecked, 6 orphan) and 9 of xref (6 dead, 0 orphan) found.
[    9.306606] mount_root: switching to jffs2 overlay
[    9.341480] overlayfs: upper fs does not support tmpfile.
[    9.360653] urandom-seed: Seeding with /etc/urandom.seed
[    9.630491] eth0: link down
[    9.649639] procd: - early -
[    9.652644] procd: - watchdog -
[   10.312338] procd: - watchdog -
[   10.315881] procd: - ubus -
[   10.587462] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.596389] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.604234] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.611914] procd: - init -
Please press Enter to activate this console.
[   11.736177] kmodloader: loading kernel modules from /etc/modules.d/*
[   11.899650] Loading modules backported from Linux version v4.19.98-0-gd183c8e2647a
[   11.907270] Backport generated by backports.git v4.19.98-1-0-g8204eb99
[   11.942880] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   12.073928] xt_time: kernel timezone is -0000
[   12.119203] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.356870] ieee80211 phy0: Atheros AR9100 MAC/BB Rev:7 AR2122 RF Rev:a1 mem=0xb80c0000, irq=2
[   12.587180] kmodloader: done loading kernel modules from /etc/modules.d/*
[   13.200221] urngd: v1.0.2 started.
[   14.109068] random: crng init done
[   14.112480] random: 6 urandom warning(s) missed due to ratelimiting
[   28.138402] br-lan: port 1(eth0.1) entered blocking state
[   28.143803] br-lan: port 1(eth0.1) entered disabled state
[   28.149649] device eth0.1 entered promiscuous mode
[   28.154432] device eth0 entered promiscuous mode
[   28.264250] br-lan: port 2(eth1) entered blocking state
[   28.269549] br-lan: port 2(eth1) entered disabled state
[   28.275138] device eth1 entered promiscuous mode
[   29.137853] eth0: link up (100Mbps/Full duplex)
[   29.142944] br-lan: port 1(eth0.1) entered blocking state
[   29.148391] br-lan: port 1(eth0.1) entered forwarding state
[   31.914296] br-lan: port 3(wlan0) entered blocking state
[   31.919687] br-lan: port 3(wlan0) entered disabled state
[   31.925386] device wlan0 entered promiscuous mode
[   32.004371] br-lan: port 3(wlan0) entered blocking state
[   32.009744] br-lan: port 3(wlan0) entered forwarding state

Is there any idea about this problem?
I have tried to compile standard 19.07.2 without any changes in menuconfig, but in this case eth0 and eth1 also do not work.
18.06.8 works without problem.

        option ipaddr '11.0.1.5'
        option gateway '11.0.1.1'
        list dns '11.0.1.1'

Is this how you have your network configured? Are these the actual addresses of the openwrt router? How about on your main network? Theses are not valid rfc1918 private address ranges and may be a large part of your problem. You could try 10.0.1.0/24 as an address space - that would be valid. You also need to ensure that the whole network is using the same subnet.

11.0.1.0/24 is my network and 11.0.1.1 is my main router. It is not a problem.

Eth in DIR615-C1 does not work also if it connects directly to laptop LAN port and network is 192.168.1.0/24.

Actually, it is a problem. Unless you are the US Department of Defense (specifically the DoD Network Information Center)

Source: whois.arin.net
IP Address: 11.0.1.0
Name: DODIIS
Handle: NET-11-0-0-0-1
Registration Date: 1/19/84
Range: 11.0.0.0-11.255.255.255
Org: DoD Network Information Center
Org Handle: DNIC
Address: 3990 E. Broad Street
City: Columbus
State/Province: OH
Postal Code: 43218
Country: United States

There is a reason that the RFC1918 address ranges exist. Please use them.

1 Like

Ok. I will use 10.0.1.0/24.
I wrote that it does not work with any network range(192.168.1.0/24 for example).
But it works with identical configuration with v18.06.
Problem is in firmware version because only with v19.07 it does not work.

After you have adjusted your main network and your AP, try again.

19.07 works well in the normal builds. I suspect that if there is a problem, it may be related to something not present and/or misconfigured in your custom image. You are, after all, building an image to fit into a 4MB flash device (if you haven't already, see this warning which applies mostly to a normal image, but still applies to custom images like what you are doing.

Also, are you using the image builder, or actually compiling from source? The image builder is much easier and faster, and you can simply omit packages that are not required to save space - there is a guide to help (de-)select the packages that will save you the most space.

I repeat one more time that I connect the device directly with laptop LAN port without main network and the network range of laptop LAN port is 192.168.1.0/24.

I know that. I have another devices with normal builds.

I am compiling from source because for my device DIR615-C1 is not possible to user image builder after LEDE v17. There is not DIR615-C1 in the device list of image builder in v18 and in v19.

Can you draw a diagram of your network topology, including devices addresses. That might make it more clear what is happening.

dir615

Really?

If you want help, provide relevant information. In this case, it would be the whole network as you want it to be working.

It is testing configuration without any network.
It has to work.

so what exactly are you doing to test it? If I look at the OP, you said

So does this imply that in the directly connected state, you cannot ping any local addresses? How are you testing that -- via serial into the device and then pinging an address from there?

In directly state I can't ping the laptop from the device and I can't ping the device from the laptop.
If I enable WLAN I can ping.

You can't ping the laptop from the device -- how are you accessing the device itself in order to try pinging things? (wifi, serial, something else?)

I can access via serial.

what do you see if you issue ifconfig?

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:22:B0:BA:50:1F
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:378 (378.0 B)

eth0      Link encap:Ethernet  HWaddr 00:22:B0:BA:50:1F
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:1475 (1.4 KiB)
          Interrupt:4

eth0.1    Link encap:Ethernet  HWaddr 00:22:B0:BA:50:1F
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:378 (378.0 B)

eth1      Link encap:Ethernet  HWaddr 00:22:B0:BA:50:20
          UP BROADCAST MULTICAST  MTU:1500  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:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:58 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5056 (4.9 KiB)  TX bytes:5056 (4.9 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:22:B0:BA:50:20
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:540 (540.0 B)

Can the OpenWrt device ping itself (192.168.1.1) -- I think it should be able to do that, but if it doesn't, it implies that isn't connecting the address to the system for some reason.

Also, since these are 100Mbps ports, have you tried a crossover cable, just to make sure that isn't relevant here? It shouldn't be necessary in the first place, but if there is software logic to an auto-crossover feature in the chipset and it isn't working properly, maybe a crossover would help.

root@OpenWrt:/# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=0.282 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=0.301 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=0.289 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=0.303 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.282/0.293/0.303 ms