How to Restart Network in Ubuntu

The Daemon Reinitialization Vector

When you manually modify the core routing tables on an Ubuntu server—such as changing the DNS parameters in the `/etc/netplan/` YAML files, or shifting from DHCP to a hard-coded static IP address—the active networking daemon does not autonomously parse the new logic. The server continues to operate on the obsolete cryptographic routing data loaded in its RAM. To force the hardware to sever all existing connections, ingest the new configuration, and re-establish the TCP/IP handshake with the local router, you must execute a targeted administrative interrupt.

How to Restart Network in Ubuntu

The execution pathway for restarting the network has fundamentally shifted across different Ubuntu architectures. Legacy systems (16.04) relied on `/etc/init.d/`, while modern distributions (20.04 and newer) utilize `systemd` or the advanced `netplan` utility.

1. Open your terminal application or connect to the server via SSH.
* Absolute Warning: If you are connected via SSH and you execute a network restart command that contains flawed routing logic, your SSH session will instantly permanently drop, and you will be mathematically locked out of the server until you secure physical console access.
2. Method 1: The Modern Netplan Architecture (Ubuntu 18.04, 20.04, 22.04+):
* If you have just modified your YAML files inside `/etc/netplan/`, you do not restart the generic networking service; you must command the Netplan utility to parse and apply the specific changes to the active kernel.
* Type exactly:
sudo netplan apply
* Press Enter and supply your root password. If the YAML syntax is mathematically perfect, the terminal will silently return to a prompt. If there is a spacing error, it will immediately output a crash log.
3. Method 2: The NetworkManager Daemon (Desktop and Wi-Fi environments):
* If you are running an Ubuntu Desktop environment (with a GUI) or relying on the NetworkManager daemon to handle volatile Wi-Fi connections.
* Type exactly:
sudo systemctl restart NetworkManager
* Press Enter. This physically kills the daemon and restarts it, forcing a re-authentication with all local wireless access points.
4. Method 3: The Legacy Systemd Protocol (Ubuntu 16.04 / systemd-networkd):
* If you are operating on a specific server build that relies on the older `systemd-networkd` architecture instead of Netplan.
* Type exactly:
sudo systemctl restart systemd-networkd
* Press Enter.
5. The Verification Protocol:
* You must mathematically verify the network interface successfully reinitialized and acquired the target IP address.
* Type exactly: ip a
* Press Enter. Verify that your primary interface (e.g., `eth0`) is displaying the correct `inet` (IPv4) address.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.