The Daemon Reinitialization Vector
When you manually modify the core `/etc/netplan/*.yaml` configuration files on an Ubuntu server to assign a static IP address, or if the active network interface card (NIC) enters a mathematically corrupted state and drops the external connection, the server does not autonomously detect these issues. The `systemd-networkd` or `NetworkManager` daemon continues operating on the legacy parameters loaded into active RAM. You must execute a precise administrative interrupt, forcing the Linux kernel to terminate the networking daemon and immediately respawn it, thereby injecting the fresh routing data into the silicon.
How to Restart Network in Ubuntu
The exact execution command depends entirely on whether you are operating a headless Ubuntu Server (which uses Netplan) or a graphical Ubuntu Desktop (which relies on NetworkManager).
1. Open your terminal application or connect to the server via a secondary console (if SSH is down).
2. Method 1: The Modern Server Protocol (Netplan):
* If you are on Ubuntu Server 18.04 LTS or newer, the networking architecture is governed by Netplan.
* Once you have modified your `.yaml` configuration file, you do not use `systemctl` to restart the service. You use the dedicated Netplan utility to parse and apply the logic.
* Type exactly:
sudo netplan apply
* Press Enter and supply your root password.
* The kernel instantly translates the YAML syntax into backend configurations and restarts the necessary interfaces. If there is a syntax error in your YAML file, this command will fail and output the exact line number of the error.
3. Method 2: The Desktop Protocol (NetworkManager):
* If you are running the Ubuntu Desktop GUI, the networking is managed by the `NetworkManager` daemon.
* To force a hard restart of this service, you must interface with `systemd`.
* Type exactly:
sudo systemctl restart NetworkManager
* Press Enter. Note the capital ‘N’ and ‘M’.
* The command prompt will return silently, but your graphical Wi-Fi icon will temporarily disconnect and reconnect as the daemon respawns.
4. The Diagnostic Verification Protocol:
* After executing either command, you must mathematically verify the NIC has successfully acquired the new routing parameters.
* Type exactly: ip a
* Press Enter and verify that your target interface (e.g., `eth0` or `enp3s0`) is displaying the correct IPv4 address.