How to Make NetworkManager Auto-Bring Up OVS Bridge Interface After Reboot


2 views

When working with Open vSwitch (OVS) bridges on Ubuntu systems using NetworkManager, I've encountered a frustrating behavior where manually created OVS bridges don't automatically come up after system reboot, despite having NetworkManager connections configured for them.

The root cause lies in the service initialization order. The OVS service (openvswitch-switch) typically starts after NetworkManager during system boot. When NetworkManager attempts to activate the connection, the OVS bridge interface doesn't exist yet.

# Check service startup order
$ systemd-analyze critical-chain openvswitch-switch.service
$ systemd-analyze critical-chain NetworkManager.service

Here are three effective approaches I've tested on Ubuntu 16.04 through 22.04:

Method 1: Create OVS Bridge via NetworkManager

Instead of using ovs-vsctl, let NetworkManager handle the bridge creation:

# nmcli connection add type ovs-bridge \
    con-name br-int \
    autoconnect yes \
    ifname br-int \
    ipv4.method manual \
    ipv4.addresses 1.1.1.1/24

Method 2: Use systemd Service Dependencies

Create a custom systemd override to ensure proper ordering:

# /etc/systemd/system/NetworkManager.service.d/10-wait-ovs.conf
[Unit]
After=openvswitch-switch.service
Wants=openvswitch-switch.service

Then reload systemd:

sudo systemctl daemon-reload

Method 3: nmcli Connection Modification

For existing connections, modify the connection properties:

# nmcli connection modify br-int \
    connection.autoconnect-retries 10 \
    connection.autoconnect-slaves 1

After implementing any solution, verify with:

# Simulate reboot
sudo systemctl restart NetworkManager
# Check connection status
nmcli connection show --active
nmcli device status

For those who prefer lower-level control, consider creating a udev rule:

# /etc/udev/rules.d/99-ovs-bridge.rules
ACTION=="add", SUBSYSTEM=="net", ENV{ID_NET_DRIVER}=="openvswitch", RUN+="/usr/bin/nmcli connection up $name"

Remember to test thoroughly in your environment before deploying to production systems.


When working with Open vSwitch (OVS) bridges on Ubuntu, many administrators face an annoying behavior where NetworkManager won't automatically bring up the bridge interface after system reboot, despite having created a persistent connection.

Here's what typically happens in sequence:

1. OVS creates br-int bridge at boot (via systemd/init)
2. NetworkManager starts and loads connections
3. The generic connection exists but won't activate automatically
4. Manual intervention required via nmcli

The key is to properly inform NetworkManager about the interface's management requirements. Here are two working approaches:

Method 1: Set Interface as Managed

First, check current status:

nmcli dev status | grep br-int

Then explicitly set it as managed:

nmcli dev set br-int managed yes

Method 2: Create Proper OVS Bridge Connection

A more robust solution using the OVS connection type:

nmcli connection add type ovs-bridge \
    con-name br-int \
    ifname br-int \
    autoconnect yes \
    ipv4.method manual \
    ipv4.addresses 1.1.1.1/24

After applying either method, test the persistence:

systemctl restart NetworkManager
nmcli con show br-int
nmcli dev show br-int
  • Timing issues between OVS and NetworkManager startup
  • Incorrect connection type (generic vs ovs-bridge)
  • Missing autoconnect or managed flags

For production systems, consider adding a systemd service dependency:

[Unit]
Description=NetworkManager OVS Bridge Wait
After=network.target openvswitch.service
Before=NetworkManager.service

[Service]
Type=oneshot
ExecStart=/bin/sleep 2
ExecStart=/usr/bin/nmcli dev set br-int managed yes

[Install]
WantedBy=multi-user.target