DHCP on macvlan interface

Hello,

I need multiple IP-addresses. They have to be fetched from a router using dhcp.
I tried to accomplish this using the RockPiS board running armbian legacy / latest and debian buster.

If i create a single new interface with eg:
ip link add name veth0 address 06:4e:a6:27:01:17 link eth0 type macvlan
and run a dhclient after this no address will be assigned

Creating two interfaces with
ip link add name veth0 address 06:4e:a6:27:01:17 link eth0 type macvlan
ip link add name veth1 address 06:4e:a6:27:01:18 link eth0 type macvlan
and running an dhclient after this will bind a new IP on both interfaces.

The same happens using dhcpcd instead if isc-dhclient.

If i run a tcpdump (to switch the interface in promiscouse mode) it works on a single veth0 too.
Running tcpdump -p (to prevent promiscouse mode) will end like the first try – no ip assigned.

Could this be a driver issue? Sure the “solution” is create more the on veth but im still interressted in the cause of this.

/greetings rockytux

Legacy kernel is identical to stock, where such problems are expected … its old kernel.

Did you try with a modern 5.9.y kernel build?

I tried it with the latest armbian trunk from to night too.

Welcome to Armbian 20.11.0-trunk.41 Buster with Linux 5.9.10-rockchip64
uname -a
Linux rockpi-s 5.9.10-rockchip64 #trunk.39 SMP PREEMPT Sun Nov 22 10:36:59 CET 2020 aarch64 GNU/Linux

with the same results.

There are some other things. After assigning an ip to the macvlan devices to system stopped responding.

I used to UBS->TTL interface and compared the /proc/sys/net tree with a working linux but can’t find anything.

Finally i found out the the system do not respond to arp request anymore as soon as an macvlan device was created.

Putting the interface into promiscous mode solved the problem.
“ifconfig eth0 promisc”
dhclient is working and all issues are gone.

Can you give me a hint why it’s necessary to do this? Is this a kernel setting or interfacedriver related.

No idea … try to narrow the scope of the problem down - perhaps try the same with some USB based adaptor for start.

I bought an usb device to verify this.
As soon as i start dhclient the interface will be set into promiscouse mode.
Deleting the veth will bring it back to normal.

[ 4487.937423] ax88179_178a 2-1.1:1.0 eth1: register ‘ax88179_178a’ at usb-ff440000.usb-1.1, ASIX AX88179 USB 3.0 Gigabit Ethernet, 00:0a:cd:37:50:e4
[ 4487.965043] ax88179_178a 2-1.1:1.0 enx000acd3750e4: renamed from eth1

root@rockpis:~# ip link add name veth1 address 06:4e:a6:27:02:27 link enx000acd3750e4 type macvlan
root@rockpis:~# dhclient

[ 4557.888194] device enx000acd3750e4 entered promiscuous mode

root@rockpis:~# ip link delete dev veth1

[ 4567.731422] device enx000acd3750e4 left promiscuous mode

root@rockpis:~#