Is it possible to have 2 nictype: macvlan on one container?

I need to use 2 Ip’s with container
Container netplan config

network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            dhcp4-overrides:
              route-metric: 100
            match:
              macaddress: 02:50:56:12:34:91
        eth1:
            dhcp4: true
            dhcp4-overrides:
              route-metric: 200
            match:
              macaddress: 01:50:56:11:60:A6

Now router set up right Ip’s based on macadress
but I can only ping one Ip from internet regarding what route-metric is lower
Setting
route-metric: 100
only one random IP works right

Is it possible to have 2 nictype: macvlan on one container?

regards

That’s not a LXD problem really, LXD is giving you two macvlan interfaces, the problem is that you can only have one route to a given address (in the most common cases).

So in this case, whichever interface has the lower metric is the one used for the egress traffic, receiving ingress on the other interface will cause a response through the wrong egress interface, never reaching the sender.

You can workaround some of that with source based routing and I believe netplan has some support for such rules, so that’s probably what you want to google about next :slight_smile: