Fedora 30 – How to Restart Network Service

fedoralinux-networking

On previous versions on RHEL/Fedora, the network service could be controlled via init scripts and (later) via systemctl. After updating DNS settings, I want to restart the network service to bounce the interface and pickup the new DNS settings (and force NetworkManager to rewrite /etc/resolve.conf).

Using systemctl, I'm getting:

# systemctl restart network
Failed to restart network.service: Unit network.service not found.

Where'd the network service go and how do I restart the interface to pickup changes?

Best Answer

Instead of systemctl, use NetworkManager, either via the GUI interface or the nmcli command-line.

Command Line

  1. List the network interfaces on the system (as root):
# nmcli device
DEVICE      TYPE      STATE      CONNECTION         
eno1        ethernet  connected  Wired connection 1     
lo          loopback  unmanaged  --

Note the device name that you want to restart.

  1. Then force the connection to reload:
# nmcli con reload eno1

(Substitute your device name for "eno1")

GUI

  1. Open the 'Settings' application in Fedora.
  2. In the left column, scroll down to 'Network'
  3. Toggle the blue switch off and back on again for the connection to want to restart.