The lxcnet daemon (specifically the lxc-net.service) is a networking component installed alongside LXC (Linux Containers) on Ubuntu. Its sole purpose is to create and manage the lxcbr0 network bridge, assign it a private IP subnet (usually 10.0.3.0/24), and manage the dnsmasq instance that provides DHCP and DNS resolution to any LXC containers attached to that bridge. If your Ubuntu Server is strictly functioning as a bare-metal application server, a database node, or if you exclusively use Docker (which manages its own docker0 bridge) instead of LXC, the lxcnet daemon is completely unnecessary and clutters your network routing tables.
This guide explains how to completely disable the lxcnet daemon in Ubuntu Server to remove the unused virtual bridge interface.
Stop and Disable the LXC Network Daemon
To permanently remove the lxcbr0 bridge and halt the associated DHCP server, we must stop the service and mask it via systemd.
- Log into your Ubuntu Server via SSH or local console using an account with
sudoprivileges. - First, stop the active service to tear down the bridge immediately:
sudo systemctl stop lxc-net.service - Next, disable the service so it does not attempt to reconstruct the bridge on the next boot:
sudo systemctl disable lxc-net.service - To guarantee that no other dependent LXC services can accidentally invoke the networking daemon, mask the unit:
sudo systemctl mask lxc-net.service
Verify the Deactivation
By masking the service, you have effectively severed the container networking daemon from the operating system without needing to uninstall the core LXC binaries.
To verify the lockdown is successful, run the following command to check the status of the unit:
systemctl status lxc-net.service
The output will clearly state that the service is masked (symlinked to /dev/null) and the Active state will read inactive (dead). More importantly, execute the ip a or ifconfig command. You will see that the lxcbr0 virtual interface has completely vanished from your network stack, leaving your routing tables clean and strictly dedicated to your physical (or primary virtual) network adapters.