Can’t create the macvlan ports by modify /etc/config/network

Hello,
I want to create the macvlan Ethernet ports as follow:

Add this to /etc/config/network:

config device 'veth0'
	option name 'veth0'
	option type 'macvlan'
	option ifname 'eth1'

config device 'veth1'
	option name 'veth1'
	option type 'macvlan'
	option ifname 'eth1'

using uci:

uci set network.veth0=device
uci set network.veth0.name=veth0
uci set network.veth0.type=macvlan
uci set network.veth0.ifname=eth1

uci set network.veth1=device
uci set network.veth1.name=veth1
uci set network.veth1.type=macvlan
uci set network.veth1.ifname=eth1

And run /etc/init.d/network restart

But the macvlan ports were not created successfully.

Is there a way to create them ?

You must also create interfaces.

config device 'veth0'
	option name 'veth0'
	option type 'macvlan'
	option ifname 'eth1'

config interface 'virt0'
    option ifname 'veth0'
    option proto ...
1 Like

Thanks, works great!

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