Name convention for wan interface?

Hi,

are there any guidelines how the wan interface should appear in the configuration?

As I used for many years different ramips (mt7621) devices in all of them it was assigned with a label "wan".

My new GL MT6000 comes with no label and so it's using the default eth name, in this case eth1.

I prepared a patch for this device based how it's handled at the Zyxel WSM20 ramips but there I could see that many devices are not using labels for the wan port.

I think adding a label will break configurations - at least if VLANs or other port specific settings are used. The GL-MT6000 is still not included in an official release so for this device it shouldn't be a bigger issue to change it now.

Maybe it should be mandatory for new devices to add labels for the ethernet ports in the dts file?

Are you talking about the physical interface or the logical network interface?

The latter is by default wanall lowercase. This is already configured in the wan firewall zone and should ‘just work’

The former depends on your device - if it is a dsa device, typically the port name should match the physical printing on the device itself. If it is swconfig based, then it might be eth0 or eth1 if it is an individually routed port, or ethx.y where x is the cpu port (eth0 or eth1), and y is the vlan id as configured in swconfig (usually vlan2 by default).

2 Likes

Both devices are at dsa.

WSM20:

MT6000:

So it seems many devices with dsa are still have a ethXYZ name for some ports. For me it doesn't matter, but maybee it should be corrected - especially for new users of OpenWRT. But as I mentioned, I'm not sure if such a change will break the configuration for users, so I will not create a PR for this topic.

The WSM20 DSA port names surely follow with the physical markings on the device.

With the MT6000, I would imagine that the lan ports follow as well... but what is marked on the physical product for the port that shows as eth1? Does it say "eth1" or something else?

(keep in mind that eth markings are not entirely unusual to see in DSA syntax -- especially if the product markings use that -- for example, the EdgeRouter X has physical labels for eth0-eth4).

Yes, the WSM20 has a printed "wan/lan" on the wan port, as well as the MT6000. Also the Asus devices at the mediatek tree have a printed "wan" at the case but no label in the dts file - for me it seems it's maybe different depending under which architecture a device is.

And I don't want to be the "bad guy" who is breaking the configuration by changing a single device from a sub-tree for an (in my eyes) not really important change.

I don't think that's the case here... you've asked a legit question.

So, this would suggest that there may be a reason to change the naming in OpenWrt for the wan port.

I could guess that there could be a reason that it is called eth1 -- this could make sense in the case where the wan port is not part of the switch. But, you'd still sort of expect it to be called out by name. So I don't really know the answer.

Hopefully a dev who is familiar with the inner workings of DSA can chime in here.

1 Like