Linux reset network settings: to default, command line
Here is the command lines to use if you want to reset the network settings on Ubuntu and other Linux distributions. This will allow you to reset the network settings to the default settings.
Ubuntu/Debian
To reset the network settings on Ubuntu/Debian, make use of one of the following commands:
sudo /etc/init.d/networking restartor
After entering the above command, to check the network status, you can use the following command:
sudo systemctl status networking
For the changes to take effect, use this command:
netplan apply
AlmaLinux and Rocky Linux
In AlmaLinux, enter the following command:
systemctl restart NetworkManager
To check the network status, type:
systemctl status NetworkManager
CentOS 6 and CentOS
In CentOS 6 and 7, use this command in order to to restart the server networking service:
service network restart
After applying the above command, to check the network status, use the following command:
service network status
CentOS 8
In this distribution, use the following command in order to to restart the server networking service:
systemctl restart NetworkManager. service
To check the network status, use the following command:
systemctl status NetworkManager. service