15

On my Arch box, I had a network bridge. The goal was to remove the bridge and to only use the network adapter not bridged. In order to do so, I removed all the *.netdev and *.network configuration files under /etc/systemd/network and replaced them with one simple file:

/etc/systemd/network/lan.network
--------------------------------
[Match]
eno*

[Network]
DHCP=ipv4

I then restarted the network service using systemctl restart systemd-networkd, assuming this would leave me just with the lo and the eno* interface. Unfortunately, though, this had no effect. A quick look at ip link still showed the bridge interface up and active.

Because uptime in this particular case is not crucial, I just rebooted the machine which solved the problem. Still, I'd like to think that reboots should not be necessary for this kind of thing. What did I miss to do?

1
10

If your bridge master interface is still up then its bound slave interfaces will remain bound even if new configurations are discovered for them in the meanwhile. So just lose the bridge.

ip link set down br0
ip link del dev br0
systemctl restart systemd-networkd
5
  • 1
    Wouldn't I lose network access in the process?
    – vic
    Feb 13 '16 at 12:27
  • @vic - if your network access is routed through a bridge to which you've bound your nic then yes, i expect so. i cant think of a simple way to do otherwise, and the complicated ways i can think of are only half-baked and involve temporary hold-over virtual nics and in-kernel netfilter duping of all packets on the dev. ugly and silly. either that or time-travel. maybe theres another way, but you wont learn it of me. anyway, network is only lost following the first command and afterward restored following the third. probably less dt than a reboot.
    – user156350
    Feb 13 '16 at 12:44
  • 1
    @vic I know I'm late to the party, but one way could be to chain the commands together in a single line, such as ip link set down br0 && ip link del dev br0 && systemctl restart systemd-networkd. Your connection may drop, at least momentarily, but the host's networking service should be back online and you can always create a new SSH session as long as you know the IP address you'll be getting after restarting it.
    – code_dredd
    May 4 '18 at 21:37
  • 1
    Use a semicolon, not && to chain these commands. If one fails, it still may reconfigure the network connection in a usable way so you don't have to get up and visit the server... Oct 16 '19 at 14:39
  • For me ip link del dev enp129s0f0 says Operation not supported
    – Hi-Angel
    May 18 '20 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.