OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version openwrt-19.07
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Josua Mayer - 25.12.2019

FS#2694 - Clearfog Pro: Default LAN / WAN Interface assignment is wrong

On my Clearfog Pro Rev 2.0 the interfaces map as follows:

eth0: switch
eth1: SFP
eth2: standalone ethernet

This does not match the current description in /etc/board.d/02_network:

# eth0 is standalone ethernet
# eth1 is switch (-pro) or standalone ethernet (-base)
# eth2 is SFP
ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"

While I don’t agree with the lan/wan decision made here, at least the comment should match reality.
So I suggest changing it to:

# eth2 is standalone ethernet
# eth0 is switch (-pro) or standalone ethernet (-base)
# eth1 is SFP
ucidef_set_interfaces_lan_wan "eth0 eth1" "eth2"

Please also see the attached patch file, which also changes the switch configuration accordingly.

Josua Mayer commented on 26.12.2019 11:12

Created a proper patch-file that doesn't change thje lan/wan assignmenmt described in the code comments, but *does* update the ethY handles accordingly.

Wouter H commented on 29.12.2019 23:15

I can confirm this bug on my own clearfog pro device.
Using 18.06.1 everything still worked out of the box. On more recent versions (I tested 18.06.5 and a compiled master branch) the switch is bridged with the wan rj45 port.

Applying the patch above by Josua fixes the problem and openwrt behaves as expected again.

Simon commented on 11.01.2020 20:14

I can also confirm this behaviour on my clearfog pro.

it works on 18.06 branch (up to 18.06.6), but does not work on 19.07 as every available copper port is bridged to wan.

svfrd commented on 03.02.2020 12:43

I can also confirm this bug.

The interface numbering has been changed with 4.14 kernel and the former "ip name" workaround breaks the default network configuration.

[..]
[    0.890885] mvneta f1070000.ethernet eth0: Using device tree mac address ea:d1:29:18:cf:d2
[    0.900185] mvneta f1030000.ethernet eth1: Using device tree mac address 82:da:47:2b:88:2d
[    0.909479] mvneta f1034000.ethernet eth2: Using device tree mac address 9a:80:7f:c4:b0:f5
[..]
[    8.666435] init: - preinit -
[    8.853268] mvneta f1070000.ethernet tmp0: renamed from eth0
[    8.903286] mvneta f1030000.ethernet eth0: renamed from eth1
[    8.943257] mvneta f1034000.ethernet eth1: renamed from eth2
[    8.983232] mvneta f1070000.ethernet eth2: renamed from tmp0
[..]

This breaks the correct interface naming..

/lib/preinit/06_set_iface_mac:

(..)
	marvell,a385-db-ap|solidrun,clearfog*a1)
		# rename interfaces back to the way they were with 4.4
		case "$(readlink /sys/class/net/eth0)" in
			*f1070000*)
				ip link set eth0 name tmp0
				ip link set eth1 name eth0
				ip link set eth2 name eth1
				ip link set tmp0 name eth2
			;;
		esac
		;;
(..)

after interface renaming:

eth0 => standalone (base), switch (pro)
eth1 => sfp
eth2 => wan (standalone)

without interface renaming:

eth0 => wan (standalone)
eth1 => standalone (base), switch (pro)
eth2 => sfp

Without the interface renaming the default network configuration applies cleanly.

/etc/board.d/02_network:

(..)
solidrun,clearfog*a1)
    # eth0 is standalone ethernet
    # eth1 is switch (-pro) or standalone ethernet (-base)
    # eth2 is SFP
    ucidef_set_interfaces_lan_wan "eth1" "eth0 eth2"

    # if switch exists (clearfog-pro)
    # switch port 5 is connected to eth1
    swconfig list 2>&1 | grep -q switch0 && \
        ucidef_add_switch "switch0" \
            "0:lan:5" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5u@eth1" "6:lan:6"
    ;;
(..)

Also take a look on "mvebu: Clearfog Pro fix emmc boot without microSD card".
https://github.com/openwrt/openwrt/pull/2732

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing