I need to config two different MAC and IP addresses on the same physical device (eth1).

But when I configure a macvlan interface in the default/global namespace and configure a vlan on top of it. I can ping the vlan IP address directly from a external host, without tagging it (ping). But on the other side: tagged pings does not work. The same happens when I set up the network configuration in a non-global/non-default namespace.

ip addr add dev eth1
ip link set dev eth1 up
# ping # PING from external host is working: fine

ip link add macvlan link eth1 type macvlan mode bridge
ip addr add dev macvlan
ip link set dev macvlan up
# ping # PING from external host is working: fine

ip link add link macvlan name vlan2 type vlan id 2
ip addr add dev vlan2
ip link set dev vlan2 up
# ping # PING from external host works without vlan tag: FAIL
# ping -I VLAN2 # no PING response external host with vlan tag: FAIL

So how can I set up two virtual interfaces (different MAC+IP) on the same physical interface in its global/default namespace, which are acting like real devices?

Optional: If global is no option, namespaces are acceptable.

FYI: I tested it on UBUNTU 18.04 with kernel 5.4 and also an embedded buildroot system with kernel 4.9 (both times, same result).


1 Answer 1


After some tests and further research the problem is that I tried to place multiple IP addresses from the same network area to multiple network interfaces.

To make this work non-global namespaces are required.

So we can close this issue here. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.