LuCI Port Status on x86 router

I use a mini x86 PC as my router, and I've just upgraded from 21.02 to 23.05 RC3. I now have a new Port Status section on the LuCI status page, but it only shows two of the four ports:

Does anyone know what's going on here? Is there something I need to do to tell OpenWrt which ports to show on this page? I noticed that the file /tmp/board.json appears to describe the two ports that are shown:

{
        "model": {
                "id": "intel-corporation-q3xxg4-p",
                "name": "INTEL Corporation Q3XXG4-P"
        },
        "network": {
                "lan": {
                        "device": "eth0",
                        "protocol": "static"
                },
                "wan": {
                        "device": "eth1",
                        "protocol": "dhcp"
                }
        }
}

The information there is also wrong - eth0 is my WAN, and eth1 is currently unused.

Move the cable, and add the additional ports as new interfaces ?

There's also Ethernet port order and status on X86

1 Like

The other ports are actually already associated with interfaces - eth3 is the main LAN, and eth2 is the guest LAN.

I have looked into the code and it includes only ports listed in /etc/board.json. The only way I managed to "fix" this is to change the file to include other ports - like this:

	"network": {
		"lan": {
			"ports": [
				"eth0",
				"eth1",
				"eth2"
			],
			"protocol": "static"
		},
		"wan": {
			"device": "eth3",
			"protocol": "dhcp"
		}
	},

It doesn't matter whether a port is listed in "lan" or "wan", but has needs to be listed somewhere.

3 Likes

I did read that thread, but the port order in /sys/class/net and elsewhere in LuCI (e.g. Network->Interfaces) is fine.

I couldn't see anything in that thread that looked related to the new Port Status section on the LuCI status page, but maybe I'm missing something?

Check what the other dude said. That's the way. Edit your board.json.
Mine looks like this:

"network": {
                "lan": {
                        "ports": [
                                "eth1",
                                "eth2",
                                "eth3"
                        ],
                        "protocol": "static"
                },
                "wan": {
                        "device": "eth0",
                        "protocol": "pppoe"
                }
        }

Yeah, that works. Didn't even need to reboot.

Another thing to fix in my post-upgrade script I guess :+1:

2 Likes

After looking into the code some more, additional ports should be shown but only if all ports are using the same "device/subsystem" - for example if all the devices are PCI(e) ones...

It will only show USB devices if eth0 is USB, or only show PCI(e) in eth0 is PCI(e), also if eth0 is virtio, then it won't show any PCI or USB devices not listed in board.json.

Once you get it working, be sure to post a follow-up here so others can benefit. :+1: (I've been lazy and just keeping a copy of board.json in backup and copying it onto the router after upgrades.)

I'm doing something very similar. I have a nest of folders on my router that I have included in my sysupgrade backup by adding the path to /etc/sysupgrade.conf, so I've placed a copy of my "fixed" board.json file in there.

I already have a script to run after an upgrade to reinstall packages etc., so I just added a couple of lines to that script to backup /etc/board.json before copying my version across.

I don't know if there's a better way. It's still not really clear to me how OpenWrt decides what to list in board.json.

I think all my hardware network devices are PCI:

# ls -l /sys/class/net
lrwxrwxrwx    1 root     root             0 Sep 18 14:58 eth0 -> ../../devices/pci0000:00/0000:00:1c.0/0000:01:00.0/net/eth0
lrwxrwxrwx    1 root     root             0 Sep 18 14:58 eth1 -> ../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/net/eth1
lrwxrwxrwx    1 root     root             0 Sep 18 14:58 eth2 -> ../../devices/pci0000:00/0000:00:1c.2/0000:03:00.0/net/eth2
lrwxrwxrwx    1 root     root             0 Sep 18 14:58 eth3 -> ../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/net/eth3
lrwxrwxrwx    1 root     root             0 Sep 18 16:05 ifb4eth0 -> ../../devices/virtual/net/ifb4eth0
lrwxrwxrwx    1 root     root             0 Sep 18 14:58 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Sep 18 14:59 tun0 -> ../../devices/virtual/net/tun0

hy, i made the customizition on /etc/board.json and see the interfaces, but the have no link

{
   "model":{
      "id":"qemu-standard-pc-i440fx-piix-1996",
      "name":"OpenWrt on Proxmox)"
   },
"network": {
                "lan": {
                        "ports": [
                                "eth0",
                                "eth2",
                                "eth3",
                                "eth4",
                                "eth5"
                        ],
                        "protocol": "static"
                },
                "wan": {
                        "device": "eth1",
                        "protocol": "dhcp"
                }
        }
}

any idea? it is an vm on proxmox7

Ha, that's interesting "no link" but still has throughput stats...

Try this and see what it shows:

for dev in $(seq 0 5) ; do
    echo "eth$dev"
    ubus call network.device status '{"name":"eth'$dev'"}' | grep speed
done

Here's what I get with cables in two of my four ports that do show connections (eth0 and 3), while eth1 and 2 show the "no link" on the status display.

eth0
        "speed": "2500F",
eth1
eth2
eth3
        "speed": "10F",

More generically, just do this to see everything on one of the devices, maybe there's a clue there.

ubus call network.device status '{"name":"eth0"}'

Take a look in /etc/board.d/02_network for the default port configurations for various x86 devices.

It seems to me that a config section with some overrides would be nice, maybe /etc/config/network could have custom device assignments, which could carry over across upgrades...

1 Like
eth0
        "speed": "-1F",
eth1
        "speed": "-1F",
eth2
        "speed": "-1F",
eth3
        "speed": "-1F",
eth4
        "speed": "-1F",
eth5
        "speed": "-1F",
ubus call network.device status '{"name":"eth0"}'
{
        "external": false,
        "present": true,
        "type": "Network device",
        "up": true,
        "carrier": true,
        "auth_status": false,
        "link-advertising": [

        ],
        "link-partner-advertising": [

        ],
        "link-supported": [

        ],
        "speed": "-1F",
        "autoneg": false,
        "hw-tc-offload": false,
        "devtype": "ethernet",
        "mtu": 1500,
        "mtu6": 1500,
        "macaddr": "6a:af:86:58:e7:f9",
        "txqueuelen": 1000,
        "ipv6": false,
        "ip6segmentrouting": false,
        "promisc": false,
        "rpfilter": 0,
        "acceptlocal": false,
        "igmpversion": 0,
        "mldversion": 0,
        "neigh4reachabletime": 30000,
        "neigh6reachabletime": 30000,
        "neigh4gcstaletime": 60,
        "neigh6gcstaletime": 60,
        "neigh4locktime": 100,
        "dadtransmits": 1,
        "multicast": true,
        "sendredirects": true,
        "drop_v4_unicast_in_l2_multicast": false,
        "drop_v6_unicast_in_l2_multicast": false,
        "drop_gratuitous_arp": false,
        "drop_unsolicited_na": false,
        "arp_accept": false,
        "statistics": {
                "collisions": 0,
                "rx_frame_errors": 0,
                "tx_compressed": 0,
                "multicast": 0,
                "rx_length_errors": 0,
                "tx_dropped": 0,
                "rx_bytes": 2623573381,
                "rx_missed_errors": 0,
                "tx_errors": 0,
                "rx_compressed": 0,
                "rx_over_errors": 0,
                "tx_fifo_errors": 0,
                "rx_crc_errors": 0,
                "rx_packets": 3794413,
                "tx_heartbeat_errors": 0,
                "rx_dropped": 0,
                "tx_aborted_errors": 0,
                "tx_packets": 5586834,
                "rx_errors": 0,
                "tx_bytes": 9434849170,
                "tx_window_errors": 0,
                "rx_fifo_errors": 0,
                "tx_carrier_errors": 0
        }
}

no speed here also

Sounds like proxmox is doing something weird. On a hyper-v VM instance I get speeds of 2.5G (eth0 = the physical interface connection) and 10G (eth1 = the virtual switch to the router's subnet).

$ for s in $(find /sys/devices/ -name speed) ; do echo "$s $(cat $s)" ; done
cat: read error: Invalid argument
/sys/devices/virtual/net/lo/speed
/sys/devices/virtual/net/br-lan/speed 10000
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/29cdd938-c13d-4c2e-85dd-0ff3b32b3bfa/net/eth0/speed 2500
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/27fef405-8312-4a77-93ff-83dded2a77ef/net/eth1/speed 10000

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