What is 'wan_eth0_2_dev'?

I have reset Archer C7 that has been reset, I was looking in Networks file and noticed this device 'wan_eth0_2_dev' which does not appear in Luci and I am trying to figure out what it is and whether it will matter if I delete it.

It sits between wan and wan6 in the networks file.

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'

config device 'wan_eth0_2_dev'
option name 'eth0.2'
option macaddr 'b0:12:34:56:78:9a'

config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'

Not in all cases the driver (via DTS definitions) can parse the MAC address of your interfaces (e.g. if the MAC addresses are derived from a u-boot environment variable), in those cases the MAC addresses are set that way via the configuration.

1 Like

Sorry, I changed the mac for privacy, what I am wondering is what is this device 'wan_eth0_2_dev'

That is an automatically generated section name for the L2 device which is assigned to the WAN interface and configured on first boot using a script like this one:

You can rename it to something more readable if you like:

uci rename network.wan_eth0_2_dev="wan_dev"
uci commit network

I can't see the text wan_eth0_2_dev in that code

Why does it not appear in other routers I have built with OpenWRT

What is wan_eth0_2_dev used for?

Why does it not show on Luci ?

Can I delete it as superfluous code?

The script actually depends on other functions.
Those derive the device section name from the logical and physical interface name.

Some devices don't need it depending on a specific target/device implementation.

The config section is required to configure the MAC address for the WAN interface.

To avoid confusing casual users.


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