• Network bridge vs. MAC address question

    From Nicolas Kovacs@3:633/10 to All on Wednesday, January 14, 2026 13:30:01
    Hi everybody,

    This post is more or less a follow-up to yesterday's post about creating
    a bridge for KVM, which has brought up an interesting problem. I think
    this deserves a distinct post on its own.

    This morning I tried a little experiment. I installed a minimal
    AlmaLinux 9.7 on a sandbox PC. And then I created a network bridge using nmtui, because RHEL and clones default to NetworkManager, even on
    minimal systems. So here's what I get:

    # ip addr
    ...
    2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
    link/ether b0:83:fe:90:4d:64 brd ff:ff:ff:ff:ff:ff
    3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
    link/ether b0:83:fe:90:4d:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.3/24 brd 192.168.2.255 scope global dynamic
    noprefixroute br0
    valid_lft 86379sec preferred_lft 86379sec
    inet6 fe80::b283:feff:fe90:4d64/64 scope link
    valid_lft forever preferred_lft forever

    Notice how enp3s0 and br0 *have the same MAC address* ? <== IMPORTANT

    I tried this again with AlmaLinux 10.1, with exactly the same result.
    Same MAC address for enp3s0 and br0. Which is sort of the expected
    behaviour. <== IMPORTANT

    Now I installed a minimal Debian system on this same PC. Here's the
    default /etc/network/interfaces as configured by the installer:

    allow-hotplug enp3s0
    iface enp3s0 inet dhcp

    I created a bridge by replacing the above stanza with this:

    auto enp3s0
    iface enp3s0 inet manual

    auto br0
    iface br0 inet dhcp
    bridge_ports enp3s0

    I rebooted and had a bridge OK, but with a different IP address, since
    now the br0 MAC address IS DISTINCT from the enp3s0 MAC address:

    # ip addr
    2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
    link/ether b0:83:fe:90:4d:64 brd ff:ff:ff:ff:ff:ff
    altname enxb083fe904d64
    3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
    link/ether f2:5c:e4:0b:e7:30 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.191/24 brd 192.168.2.255 scope global dynamic noprefixroute br0
    valid_lft 86242sec preferred_lft 75442sec
    inet6 fe80::9a0d:650b:e751:6e37/64 scope link
    valid_lft forever preferred_lft forever

    So here's my question. I'd like my br0 to have the same MAC address as
    my enp3s0 without having to jump through burning loops.

    Any suggestions ?

    Niki

    --
    Microlinux - Solutions informatiques durables
    7, place de l'‚glise - 30730 Montpezat
    Site : https://www.microlinux.fr
    Blog : https://www.microlinux.fr/blog
    Mail : info@microlinux.fr
    T‚l. : 04 66 63 10 32
    Mob. : 06 51 80 12 12

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Wednesday, January 14, 2026 14:00:01
    Hi,

    On Wed, Jan 14, 2026 at 01:21:39PM +0100, Nicolas Kovacs wrote:
    So here's my question. I'd like my br0 to have the same MAC address as my enp3s0 without having to jump through burning loops.

    Any suggestions ?

    It is more correct to have the bridge use a random MAC address (or,
    really, unique on the system as that is the goal). The main reason that
    N-M clones the MAC address is it makes the setup simpler and doesn't
    alter your DHCP lease, but if the network is more complicated then it
    can lead to some issues.

    Basically if you can tolerate the DHCP-assigned address being different
    then I'd stick with the distinct MAC address. If it's that you don't
    like that it's a random MAC every boot, I'd set the distinct MAC - you
    can also set that MAC to statically get the same IP address in DHCP if
    you want.

    If none of that appeals and you really want to replicate N-M behaviour
    then it;'s quite simple: either use ifupdown's "hwaddress" directive, or directly set with "ip link set br0 address" in a pre-up.

    auto br0
    iface br0 inet dhcp
    bridge_ports eth0
    hwaddress ether b0:83:fe:90:4d:64

    or:

    auto br0
    iface br0 inet dhcp
    bridge_ports eth0
    pre-up ip link set $IFACE address b0:83:fe:90:4d:64

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Wednesday, January 14, 2026 14:10:01
    On Wed, Jan 14, 2026 at 12:57:56PM +0000, Andy Smith wrote:
    It is more correct to have the bridge use a random MAC address (or,
    really, unique on the system as that is the goal).

    Mean tto say

    "unique on the layer 2 network?"

    of course.

    Thanks,
    Andy

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nicolas Kovacs@3:633/10 to All on Wednesday, January 14, 2026 14:40:01
    Le 14/01/2026 … 13:57, Andy Smith a ‚crit˙:
    auto br0
    iface br0 inet dhcp
    bridge_ports eth0
    hwaddress ether b0:83:fe:90:4d:64

    That did the trick !

    Thank you very (very) much !

    Cheers from South France,

    Niki

    --
    Microlinux - Solutions informatiques durables
    7, place de l'‚glise - 30730 Montpezat
    Site : https://www.microlinux.fr
    Blog : https://www.microlinux.fr/blog
    Mail : info@microlinux.fr
    T‚l. : 04 66 63 10 32
    Mob. : 06 51 80 12 12

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nicolas Kovacs@3:633/10 to All on Wednesday, January 14, 2026 17:30:02
    Le 14/01/2026 … 13:57, Andy Smith a ‚crit˙:
    auto br0
    iface br0 inet dhcp
    bridge_ports eth0
    hwaddress ether b0:83:fe:90:4d:64

    Now here's a follow-up question:

    Is there any way I could get the exact same result as with the
    configuration above, except I'd be using nmtui instead of putting the
    stuff in /etc/network/interfaces ?

    Here's why: with the above configuration on a workstation, br0 and
    enp3s0 don't get handled by NetworkManager anymore... and then when KDE
    starts up, I get a (wrong) notification about limited connectivity and
    not being able to connect to the Internet.

    Plus, sometimes I like to use ProtonVPN, which I use via NetworkManager.

    I don't know if nmtui offers the equivalent of the following line
    especially:

    hwaddress ether b0:83:fe:90:4d:64

    I looked around, but I haven't managed to find it yet.

    Any suggestions ?

    Niki

    --
    Microlinux - Solutions informatiques durables
    7, place de l'‚glise - 30730 Montpezat
    Site : https://www.microlinux.fr
    Blog : https://www.microlinux.fr/blog
    Mail : info@microlinux.fr
    T‚l. : 04 66 63 10 32
    Mob. : 06 51 80 12 12

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Wednesday, January 14, 2026 22:30:01
    Hi,

    On Wed, Jan 14, 2026 at 05:26:52PM +0100, Nicolas Kovacs wrote:
    Le 14/01/2026 ? 13:57, Andy Smith a ?crit?:
    auto br0
    iface br0 inet dhcp
    bridge_ports eth0
    hwaddress ether b0:83:fe:90:4d:64

    Now here's a follow-up question:

    Is there any way I could get the exact same result as with the configuration above, except I'd be using nmtui instead of putting the stuff in /etc/network/interfaces ?

    I thought you said that when you configured a bridge in NetworkManager
    it already cloned the MAC address of the first port? That has been my experience. If that's what you are looking for, doesn't it just do it?

    Or are you actually trying to do something else?

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)