Skip to content

Inherit MAC address for bridge from physical device #12558

Closed
@olafhering

Description

@olafhering

With ifcfg or NetworkManager it is possible to have generic config files for every system to configure a bridge on the one and only physical network interface. See the examples below how such configuration looks like.

With systemd-networkd it is apparently required to specify the MAC in the configuration. As a result, such configuration is per host and not generic anymore:

==> /etc/systemd/network/br0.netdev <==
[NetDev]
Name=br0
Kind=bridge
==> /etc/systemd/network/br0.network <==
[Match]
Name=br0
[Link]
MACAddress=b8:ac:6f:a3:7d:0a
[Network]
DHCP=ipv4
==> /etc/systemd/network/em1.network <==
[Match]
MACAddress=b8:ac:6f:a3:7d:0a
[Network]
Bridge=br0

Here the physical link b8:ac:6f:a3:7d:0a should be part of bridge br0. Without [Link] MACAddress=b8:ac:6f:a3:7d:0a in br0.network the assigned MAC will be random. If there is just one single interface for the bridge, the MAC should be inherited. With more physical interfaces, like in the examples provided by systemd.network(5), the decision what MAC should be assigned to br0 is not straight forward.

==> /etc/sysconfig/network/ifcfg-br0 <==  
BOOTPROTO='dhcp'
BRIDGE='yes'
BRIDGE_PORTS='eth0'
BRIDGE_STP='off'
STARTMODE='auto'
==> /etc/sysconfig/network/ifcfg-eth0 <==  
BOOTPROTO='none'
STARTMODE='auto'

==> /etc/NetworkManager/system-connections/eth <==  
[connection]
id=eth
uuid=11111111-1111-1111-1111-111111111111
type=ethernet
interface-name=eth0
master=br0
permissions=
slave-type=bridge
[ethernet]
mac-address-blacklist=
==> /etc/NetworkManager/system-connections/br <==  
[connection]
autoconnect-slaves=1
id=br
interface-name=br0
permissions=
type=bridge
uuid=22222222-2222-2222-2222-222222222222
[bridge]
stp=false
[ipv4]
dhcp-timeout=2147483647
dns-search=
method=auto
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=auto

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestnetwork

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions