4

I've created a virtual bridge bridge0:

bridge0.netdev:

[NetDev]
Name=bridge0
Kind=bridge

bridge0.network:

[Match]
Name=bridge0

[Network]
DHCP=yes

and attached my primary interface eth0 to it

eth0.network:

[Match]
Name=eth0

[Network]
Bridge=bridge0

But this changes the MAC address my computer uses for DHCP to be the random MAC address assigned to bridge0. Is there a way to keep the physical MAC address assigned to eth0?

dippynark
  • 233
  • 3
  • 13

1 Answers1

2

According to the manpage of systemd.netdev you can add a MAC address in the [NetDev] section.

[NetDev]
Name=bridge0
Kind=bridge
MACAddress=

Just insert the MAC address of eth0 there.

Thomas
  • 4,225
  • 5
  • 23
  • 28
  • This is what I did in the end, but is there any way to make this dynamic? (for example, not having to hard code the MAC address) and are there any problems with the eth0 port having the same MAC address address as the bridge0 port? – dippynark Nov 13 '17 at 09:22
  • I don't think it is a problem when you only have one physical interface connected to the bridge. As far as I know the default for `systemd.netdev` seems to derive the MAC address from the `machine-id`. Depending on your distribution you could use e.g. *old-school* style *ifcfg-br0* configuration files in RHEL based systems. Not sure about Debian based ones. – Thomas Nov 13 '17 at 10:52