[systemd-devel] Inherit MAC address for bridge from physical device
Andrei Borzenkov
arvidjaar at gmail.com
Thu May 9 14:30:17 UTC 2019
09.05.2019 12:49, Olaf Hering пишет:
> 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.
Could you be more specific where exactly it is required? Example in
manual page does not set any MAC; do you imply that this example is
non-functioning?
Example 3. A bridge with two enslaved links
# /etc/systemd/network/25-bridge-static.network
[Match]
Name=bridge0
[Network]
Address=192.168.0.15/24
Gateway=192.168.0.1
DNS=192.168.0.1
# /etc/systemd/network/25-bridge-slave-interface-1.network
[Match]
Name=enp2s0
[Network]
Bridge=bridge0
# /etc/systemd/network/25-bridge-slave-interface-2.network
[Match]
Name=wlp3s0
[Network]
Bridge=bridge0
This creates a bridge and attaches devices "enp2s0" and "wlp3s0"
to it. The bridge
will have the specified static address and network assigned, and
a default route via
the specified gateway will be added. The specified DNS server
will be added to the
global list of DNS resolvers.
> As a result, such configuration is per host and not generic anymore. Is there a knob I overlooked so that the bridge uses the MAC from the physical interface? If not, are there plans to fix that?
>
> Olaf
>
> ==> /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
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190509/6b0a1af6/attachment.sig>
More information about the systemd-devel
mailing list