During experimentations with a BananaPi_R3 as an embedded vyos system, i'm working with some interface names hardcoded into the hardware ARM DTB files that is not easy changeable.
On default board DTB config, the board have these interfaces:
eth0 - 2,5G CPU to DSA switch ic interconnect eth1 - 2,5G CPU sfp interface wan - 1G DSA rj45 interface 1 lan1 - 1G DSA rj45 interface 2 lan2 - 1G DSA rj45 interface 3 lan3 - 1G DSA rj45 interface 4 lan4 - 1G DSA rj45 interface 5 sfp2 - 2,5G DSA sfp interface 6
Most of these ports are connected to a MediaTek MT7531 DSA switch IC that takes care of the port multiplexing on this board.
using wanX* and lanX* interfaces i find quite normal for these embedded systems, and they also do not always have a number after the prefix. eg. a device with just one interface of a given type can be called just lan or wan
using sfpX i've not seen before this system, but it makes sense as they are not normal RJ45 interfaces. there are also references to these interface names in eg. /sys/devices/platform/sfp-[12]/
The two ethX interfaces are normal kernel enumerated interfaces, and all other interface names are hardcoded into the kernel DTB file for this platform.
The eth1 interface should also be named sfp1, and this should be fixable with a udev rule on this system eg.
the same with eth0 as it could be named dsa or something like that (the interface should not be directly configured, but provides statistics for the internal switch to cpu interface
eg:
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="mtk_soc_eth", ENV{OF_FULLNAME}=="/soc/ethernet@15100000/mac@0", NAME="dsa" ACTION=="add", SUBSYSTEM=="net", DRIVERS=="mtk_soc_eth", ENV{OF_FULLNAME}=="/soc/ethernet@15100000/mac@1", NAME="sfp1"
But then to the issue:
With the default vyos configuration i'm unable to configure other interfaces than ethX and lanX. wan and sfp2 is not able to be configured and will result in an error:
vyos@vyos# set int eth sfp2 desc test Invalid Ethernet interface name Value validation failed Set failed
solving this part could be made by modify the syntax:expression regex in /opt/vyatta/share/vyatta-cfg/templates/interfaces/ethernet/node.def (i've done this in my temporary image)
But i still will not get the interfaces listed inside show int so there are also other places this needs to be updated to show the interfaces everywhere.
There are also references to nic names inside here: https://github.com/vyos/vyos-utils/blob/master/src/iface/list_interfaces.ml#L20-L43
Is it possible to make support for these types of interfaces names upstream in VyOS?
And get all references to these names visible everywhere in the cli?