Systemd Networkd [Match] Rule Multiple Matches

networkingsystemd

If I have a static network configuration like this:

[Match]
Driver=mlx4_en

[Network]
Address=10.1.0.10/24
Gateway=10.1.0.1
DNS=8.8.8.8

and say I have a dual port NIC which uses the driver mlx4_en then I have obviously two matches. What is systemd network doing with the [Network] definition then? Obviously it is a bad idea to give both interfaces the same IP.

Best Answer

try matching with MACAddress then you will have two IP https://www.freedesktop.org/software/systemd/man/systemd.network.html