How to Restart Network Services in Ubuntu

The Protocol Reinitialization Vector

When you manually modify the core `/etc/netplan/` configuration files on an Ubuntu server to assign a static IP address or alter DNS routing tables, the operating system does not apply the changes dynamically. The kernel is still operating on the previous ruleset loaded in RAM. To enforce the new architecture, you must command the `systemd` daemon to brutally terminate all active networking processes, flush the routing tables, and rebuild the connection protocols from the newly modified configuration files.

How to Restart Network Services

Modern Ubuntu deployments (version 18.04 and later) rely exclusively on the `Netplan` utility to govern the underlying `systemd-networkd` or `NetworkManager` backends.

1. Open your terminal application or connect to the server via SSH.
2. The Netplan Apply Command: The legacy `/etc/init.d/networking restart` command is obsolete and will fail on modern Ubuntu systems. You must utilize the native Netplan syntax.
3. Type the following exact command. Because this action alters the kernel’s fundamental communication capabilities, it requires absolute superuser privileges (sudo):

sudo netplan apply

4. Press Enter. You will be prompted to provide your administrative password.
5. The Execution Reality (Critical Warning for SSH Users):
* If the command is successful, the terminal will return a completely blank prompt.
* If you are connected via SSH, the terminal session may freeze for approximately 3-5 seconds as the physical network interface card (NIC) is powered down and brought back online.
* The Catastrophic Failure State: If you made a syntax error in your `.yaml` configuration file (e.g., incorrect indentation), the `netplan apply` command will instantly drop your SSH connection, and the server will be permanently offline. You will have to physically plug a monitor into the server to fix the file. Therefore, you should always run sudo netplan try before running `apply`. This command tests the new configuration and automatically reverts to the old one after 120 seconds if you do not hit Enter to confirm it works.

Get the best tech tips delivered straight to your inbox.

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