Help with OpenWrt configuration, multiple devices same network

I have 3 devices based on MT7628AN configured for ethernet, (eth0.1), different ips and mac addresses. Everything else (wifi, WAN, DHCP...) is off. I don't need anything else other than ethernet, no firewall, nothing. I use them to stream a usb camera over the local network.

If I connect them to a decent router all works great. If I connect them to a worse router I have intermittent comms. If I connect them to an unmanaged switch I also get intermittent comms.

Could there be anything wrong on the my configuration that could be causing network issues, and that a good router could be solving?

My /etc/config/network file looks like this (different ips and mac addresses for eth0.1 for the other 2 units):


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 'fdf2:ba54:6f40::/48'

config interface 'lan'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.0.207'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.0.1'
        option broadcast '192.168.0.255'
        option delegate '0'
        option force_link '0'

config device 'lan_dev'
        option name 'eth0.1'
        option macaddr 'b8:d8:12:62:ae:cf'

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

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 6t'

Both in the bad router and in the unmanaged switch I get this in one of them, another doesn't even respond and the last one seems more or less ok.


44.793709] rt3050-esw 10110000.esw: link changed 0x00
[   46.431885] rt3050-esw 10110000.esw: link changed 0x01
[   48.386907] rt3050-esw 10110000.esw: link changed 0x00
[   50.020357] rt3050-esw 10110000.esw: link changed 0x01
[   50.223384] rt3050-esw 10110000.esw: link changed 0x00
[   51.865861] rt3050-esw 10110000.esw: link changed 0x01
[   57.735428] rt3050-esw 10110000.esw: link changed 0x00
[   59.386378] rt3050-esw 10110000.esw: link changed 0x01
[   64.469765] rt3050-esw 10110000.esw: link changed 0x00
[   66.125834] rt3050-esw 10110000.esw: link changed 0x01
[   68.269781] rt3050-esw 10110000.esw: link changed 0x00
[   70.084105] rt3050-esw 10110000.esw: link changed 0x01
[   74.151474] rt3050-esw 10110000.esw: link changed 0x00
[   75.974147] rt3050-esw 10110000.esw: link changed 0x01
[   77.869534] rt3050-esw 10110000.esw: link changed 0x00
[   79.547146] rt3050-esw 10110000.esw: link changed 0x01
[   83.809518] rt3050-esw 10110000.esw: link changed 0x00
[   85.639175] rt3050-esw 10110000.esw: link changed 0x01
[   87.410567] rt3050-esw 10110000.esw: link changed 0x00
[   89.190917] rt3050-esw 10110000.esw: link changed 0x01
[   92.270935] rt3050-esw 10110000.esw: link changed 0x00
[   93.927710] rt3050-esw 10110000.esw: link changed 0x01
[   98.282039] rt3050-esw 10110000.esw: link changed 0x00
[   99.930628] rt3050-esw 10110000.esw: link changed 0x01
[  104.310359] rt3050-esw 10110000.esw: link changed 0x00
[  106.061059] rt3050-esw 10110000.esw: link changed 0x01
[  108.050576] rt3050-esw 10110000.esw: link changed 0x00
[  109.660932] rt3050-esw 10110000.esw: link changed 0x01
[  111.730578] rt3050-esw 10110000.esw: link changed 0x00
[  113.535235] rt3050-esw 10110000.esw: link changed 0x01
[  117.730341] rt3050-esw 10110000.esw: link changed 0x00
[  119.397640] rt3050-esw 10110000.esw: link changed 0x01
[  121.410111] rt3050-esw 10110000.esw: link changed 0x00
[  123.198724] rt3050-esw 10110000.esw: link changed 0x01
[  123.879925] rt3050-esw 10110000.esw: link changed 0x00
[  125.558020] rt3050-esw 10110000.esw: link changed 0x01
[  127.429399] rt3050-esw 10110000.esw: link changed 0x00
[  131.656452] rt3050-esw 10110000.esw: link changed 0x01
[  134.709033] rt3050-esw 10110000.esw: link changed 0x00
[  136.372484] rt3050-esw 10110000.esw: link changed 0x01
[  138.589530] rt3050-esw 10110000.esw: link changed 0x00
[  140.194307] rt3050-esw 10110000.esw: link changed 0x01
[  140.991273] rt3050-esw 10110000.esw: link changed 0x00
[  142.663698] rt3050-esw 10110000.esw: link changed 0x01
[  143.269694] rt3050-esw 10110000.esw: link changed 0x00
[  147.492099] rt3050-esw 10110000.esw: link changed 0x01
[  149.410827] rt3050-esw 10110000.esw: link changed 0x00
[  151.182595] rt3050-esw 10110000.esw: link changed 0x01
[  154.209460] rt3050-esw 10110000.esw: link changed 0x00
[  155.933955] rt3050-esw 10110000.esw: link changed 0x01
[  156.671081] rt3050-esw 10110000.esw: link changed 0x00
[  158.312963] rt3050-esw 10110000.esw: link changed 0x01
[  159.010749] rt3050-esw 10110000.esw: link changed 0x00
[  163.261955] rt3050-esw 10110000.esw: link changed 0x01
[  168.549873] rt3050-esw 10110000.esw: link changed 0x00
[  170.224131] rt3050-esw 10110000.esw: link changed 0x01
[  171.011198] rt3050-esw 10110000.esw: link changed 0x00
[  172.730115] rt3050-esw 10110000.esw: link changed 0x01
[  175.814006] rt3050-esw 10110000.esw: link changed 0x00
[  177.456387] rt3050-esw 10110000.esw: link changed 0x01
[  183.011920] rt3050-esw 10110000.esw: link changed 0x00
[  184.688642] rt3050-esw 10110000.esw: link changed 0x01
[  186.550942] rt3050-esw 10110000.esw: link changed 0x00
[  188.177666] rt3050-esw 10110000.esw: link changed 0x01
[  193.751104] rt3050-esw 10110000.esw: link changed 0x00
[  195.499010] rt3050-esw 10110000.esw: link changed 0x01
[  197.430469] rt3050-esw 10110000.esw: link changed 0x00
[  199.079938] rt3050-esw 10110000.esw: link changed 0x01
[  201.110562] rt3050-esw 10110000.esw: link changed 0x00
[  202.792198] rt3050-esw 10110000.esw: link changed 0x01
[  206.031663] rt3050-esw 10110000.esw: link changed 0x00
[  207.764226] rt3050-esw 10110000.esw: link changed 0x01
[  209.509680] rt3050-esw 10110000.esw: link changed 0x00
[  211.232257] rt3050-esw 10110000.esw: link changed 0x01
[  221.511510] rt3050-esw 10110000.esw: link changed 0x00
[  223.154178] rt3050-esw 10110000.esw: link changed 0x01
[  229.909426] rt3050-esw 10110000.esw: link changed 0x00
[  231.542531] rt3050-esw 10110000.esw: link changed 0x01
[  235.910141] rt3050-esw 10110000.esw: link changed 0x00
[  237.608193] rt3050-esw 10110000.esw: link changed 0x01
[  241.909826] rt3050-esw 10110000.esw: link changed 0x00
[  243.621121] rt3050-esw 10110000.esw: link changed 0x01
[  249.253093] rt3050-esw 10110000.esw: link changed 0x00
[  250.937601] rt3050-esw 10110000.esw: link changed 0x01
[  256.512139] rt3050-esw 10110000.esw: link changed 0x00
[  258.186497] rt3050-esw 10110000.esw: link changed 0x01
[  265.989637] rt3050-esw 10110000.esw: link changed 0x00
[  267.611905] rt3050-esw 10110000.esw: link changed 0x01
[  272.050328] rt3050-esw 10110000.esw: link changed 0x00
[  273.784065] rt3050-esw 10110000.esw: link changed 0x01
[  276.851311] rt3050-esw 10110000.esw: link changed 0x00
[  278.519041] rt3050-esw 10110000.esw: link changed 0x01
[  282.850908] rt3050-esw 10110000.esw: link changed 0x00
[  284.509185] rt3050-esw 10110000.esw: link changed 0x01
[  286.530020] rt3050-esw 10110000.esw: link changed 0x00
[  288.236545] rt3050-esw 10110000.esw: link changed 0x01
[  294.932281] rt3050-esw 10110000.esw: link changed 0x00
[  296.551425] rt3050-esw 10110000.esw: link changed 0x01
[  300.869999] rt3050-esw 10110000.esw: link changed 0x00
[  302.562303] rt3050-esw 10110000.esw: link changed 0x01
[  304.470081] rt3050-esw 10110000.esw: link changed 0x00
[  306.205953] rt3050-esw 10110000.esw: link changed 0x01
[  308.232381] rt3050-esw 10110000.esw: link changed 0x00
[  309.888768] rt3050-esw 10110000.esw: link changed 0x01
[  316.632028] rt3050-esw 10110000.esw: link changed 0x00
[  318.332160] rt3050-esw 10110000.esw: link changed 0x01
[  320.293319] rt3050-esw 10110000.esw: link changed 0x00
[  322.004740] rt3050-esw 10110000.esw: link changed 0x01
[  327.429644] rt3050-esw 10110000.esw: link changed 0x00
[  329.116415] rt3050-esw 10110000.esw: link changed 0x01
[  333.509120] rt3050-esw 10110000.esw: link changed 0x00
[  335.266050] rt3050-esw 10110000.esw: link changed 0x01
[  335.908999] rt3050-esw 10110000.esw: link changed 0x00
[  337.779967] rt3050-esw 10110000.esw: link changed 0x01
[  343.250208] rt3050-esw 10110000.esw: link changed 0x00
[  344.907008] rt3050-esw 10110000.esw: link changed 0x01
[  350.389884] rt3050-esw 10110000.esw: link changed 0x00
[  352.034558] rt3050-esw 10110000.esw: link changed 0x01
[  363.589221] rt3050-esw 10110000.esw: link changed 0x00
[  365.269759] rt3050-esw 10110000.esw: link changed 0x01
[  386.390194] rt3050-esw 10110000.esw: link changed 0x00
[  388.085759] rt3050-esw 10110000.esw: link changed 0x01
[  390.069350] rt3050-esw 10110000.esw: link changed 0x00
[  391.766271] rt3050-esw 10110000.esw: link changed 0x01
[  400.931109] rt3050-esw 10110000.esw: link changed 0x00
[  402.597631] rt3050-esw 10110000.esw: link changed 0x01
[  404.472289] rt3050-esw 10110000.esw: link changed 0x00
[  406.120705] rt3050-esw 10110000.esw: link changed 0x01
[  409.269767] rt3050-esw 10110000.esw: link changed 0x00
[  411.000062] rt3050-esw 10110000.esw: link changed 0x01
[  418.870686] rt3050-esw 10110000.esw: link changed 0x00
[  420.603389] rt3050-esw 10110000.esw: link changed 0x01
[  424.930367] rt3050-esw 10110000.esw: link changed 0x00
[  426.606334] rt3050-esw 10110000.esw: link changed 0x01
[  452.592698] rt3050-esw 10110000.esw: link changed 0x00
[  454.305790] rt3050-esw 10110000.esw: link changed 0x01
[  476.592548] rt3050-esw 10110000.esw: link changed 0x00
[  478.289150] rt3050-esw 10110000.esw: link changed 0x01
[  532.871458] rt3050-esw 10110000.esw: link changed 0x00
[  534.599688] rt3050-esw 10110000.esw: link changed 0x01
[  554.469436] rt3050-esw 10110000.esw: link changed 0x00
[  556.212220] rt3050-esw 10110000.esw: link changed 0x01
[  568.999919] rt3050-esw 10110000.esw: link changed 0x00
[  570.629372] rt3050-esw 10110000.esw: link changed 0x01
[  587.074235] rt3050-esw 10110000.esw: link changed 0x00
[  588.934139] rt3050-esw 10110000.esw: link changed 0x01
[  597.751919] rt3050-esw 10110000.esw: link changed 0x00
[  599.403894] rt3050-esw 10110000.esw: link changed 0x01
[  649.688227] rt3050-esw 10110000.esw: link changed 0x00
[  651.308539] rt3050-esw 10110000.esw: link changed 0x01
[  651.777300] rt3050-esw 10110000.esw: link changed 0x00
[  653.827579] rt3050-esw 10110000.esw: link changed 0x01
[  655.590367] rt3050-esw 10110000.esw: link changed 0x00
[  657.245691] rt3050-esw 10110000.esw: link changed 0x01
[  657.608407] rt3050-esw 10110000.esw: link changed 0x00
[  661.904635] rt3050-esw 10110000.esw: link changed 0x01
[  664.833070] rt3050-esw 10110000.esw: link changed 0x00
[  666.656251] rt3050-esw 10110000.esw: link changed 0x01
[  667.136687] rt3050-esw 10110000.esw: link changed 0x00
[  668.829179] rt3050-esw 10110000.esw: link changed 0x01
[  669.280610] rt3050-esw 10110000.esw: link changed 0x00
[  671.083514] rt3050-esw 10110000.esw: link changed 0x01
[  671.552645] rt3050-esw 10110000.esw: link changed 0x00
[  673.201659] rt3050-esw 10110000.esw: link changed 0x01
[  691.472310] rt3050-esw 10110000.esw: link changed 0x00
[  693.330685] rt3050-esw 10110000.esw: link changed 0x01
[  884.151848] rt3050-esw 10110000.esw: link changed 0x00

Configuration looks fine to me. There isn't much to go wrong, as long as the IP and the mac address are different. One thing to verify is that the mac address is indeed the one you have configured. You can see that if you check arp on the router or on some other lan host which has previously pinged them.

I am a bit confused with the mac addresses. I have a mac address for eth0, and another one (that I manually set myself for eth0.1 which is really the ethernet interface.

root@OpenWrt:~# cat /sys/class/net/eth0/address
b8:d8:12:65:d5:f5
root@OpenWrt:~# cat /sys/class/net/eth0.1/address
b8:d8:12:62:ae:cf
root@OpenWrt:~#     

The MAC address for eth0.1 is random, I just pick them different between them.

Should they be the same?

Reading the arp table after pinging it it shows the MAC that I manually set:

192.168.0.207         b8-d8-12-62-ae-cf     dynamic

Actually I just deleted the line that sets the mac address manually. I checked in the arp table that I get different mac addresses for all my devices.

        option macaddr 'b8:d8:12:62:ae:cf'

Still having intermittent comms after a couple of minutes running. If I use a different switch it works 100% for hours and days, no intermittent problems whatsoever.

I really don't know what to think at this point. Could it be something related with the MTU...? Why does it work connected to a router and not to an unmanaged switch? Any suggestion is welcomed.

Why don't you keep the good switch then and you are looking for issues on OpenWrt?

Definitely not.

If I were to guess, I'd say that the interface is constantly flapping. Bad switch, bad cables, bad interfaces... You can only rule out suspects by trying different combinations. And it seems to me that you have already found a working combination.

Because this is for a robot, and the unmanaged switch is part of the design. It's my own design in a single PCB, I cannot just change the switch. The router that works if only for troubleshooting.

The unmanaged switch has been thouroughly tested (vibration, temperature... while doing bandwidth stress tests for weeks) and works fine. Actually when my openwrt devices fail everything else is still working fine.

What can a router filter that an unmanaged switch will pass and cause problems (in a local network)?

Have you tried with another switch?

Yep, I tried at least 5 of my custom switches and all behave the same. I also checked the wiring and connectors and all is good (the wires are cat6 and very short, less than 5cm).

I did several tests with firewall rules (in case something was flooding the network), MTU size etc.

Any suggestion of anyone more familiar than me in networking will be welcomed.Again, what could cause the constant flapping in a unmanaged switch after a couple of minutes and not in a commercial router?

Firewall rules typically will not affect L2 connections.

Have you tried any regular, non-custom, commercial router?

1 Like

Yes, and it always works with a commercial switch. I also checked the design of my switch and all the circuitry for my OpenWrt device and everything seems fine.

There might be something in the design of the switch that makes it less tolerant to something (possibly clock shifting with temperature, but I don't have the equipment to see this at the moment).

After 4 days of tests I think this is more a signal integrity / clock problem than configuration in OpenWrt.