Both "eth0" and "wan" exist - What does that mean?

I'm using a redmi AC2100 and was attempting to configure it to utilize multiple IPs provided by the ISP. In the process I discovered two Ethernet adapter "eth0" and "wan". The tutorials suggest setting up a virtual adapter and link it to "eth0"(My understanding of the magic words "ip link add link wan name vwan1 type macvlan", correct me if I'm wrong)
It appears that instead of "eth0", I should link it to "wan". Now just out of curiosity, I want to know why there exist two Ethernet adapters.

eth0 is the physical interface name. wan and lan are the uci interfaces. Also wan, lan1, lan2, and lan3 are the port names.
Can you post the uci export network ; swconfig dev eth0 show ?

2 Likes


config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option packet_steering '1'
option ula_prefix 'fd8b:9f09:10dc::/48'

config interface 'lan'
option type 'bridge'
option ifname 'lan1 lan2 lan3'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.31.1'

config interface 'wan'
option proto 'static'
option ipaddr ''
option netmask '
'
option gateway ''
list dns '
'
list dns ''
option macaddr '
'
option ifname 'wan'

config interface 'wan6'
option ifname 'wan'
option proto 'dhcpv6'

swconfig...doesn't exist on my router?

Try this one and use wan for ifname.

1 Like

May I ask what is to be expected? I can't carry it out right now.

To create the virtual interfaces of course.

2 Likes

Um...Pardon my ignorance, what's the difference with the ip command?

ip link add link wan name vwan1 type macvlan

It's the same, but it is resilient after router reboots or interface bumps.

2 Likes

And why must I use wan instead of eth0?

Because it won't work with eth0.

2 Likes

Ubus network.interface does not update if IP is manually set

1 Like