I want to restart the network service on my centos 7 system, How to restart/start/stop network service using systemctl command under centos 7 operating system? If the system V init script still can be used to restart/start/stop network service in centos 7 or rhel7? this post will guide you how to restart/stop/start network service using “systemctl” command in centos 7.
CentOS 7 restart network service
In centos 7 or RHEL7, the network service name is changed to “network.service“, issue the following systemctl command to restart network service on your current system:
systemctl restart network.service
or
systemctl restart network
To check the status of network service, run the following command:
systemctl status network.service
Outputs:
[root@devops /]# systemctl status network.service network.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init.d/network) Active: active (exited) since Tue 2014-12-16 08:02:27 CET; 17s ago Process: 9491 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS) Process: 9649 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS) Dec 16 08:02:26 devops systemd[1]: Starting LSB: Bring up/down networking... Dec 16 08:02:27 devops network[9649]: Loopback-Schnittstelle hochfahren: D...en Dec 16 08:02:27 devops network[9649]: Datei »/etc/sysconfig/network-script...en Dec 16 08:02:27 devops network[9649]: Datei »/etc/sysconfig/network-script...en Dec 16 08:02:27 devops network[9649]: Datei »/etc/sysconfig/network-script...en Dec 16 08:02:27 devops network[9649]: [ OK ] Dec 16 08:02:27 devops systemd[1]: Started LSB: Bring up/down networking. Hint: Some lines were ellipsized, use -l to show in full.
Try to use “service” command to restart network service, type:
service network restart
outputs:
[root@devops Desktop]# service network restart Restarting network (via systemctl): [ OK ]
From the above output, you will see that service command will redirect to “systemctl“. so I advised that you’d better to use “systemctl” command to restart system service.
CentOS 7 start network service
To start network service on centos 7 system, issue the following command:
systemctl start network.service
or
systemctl start network
CentOS 7 stop Network service
To stop network service on your system, issue the following command:
systemctl stop network.service
or
systemctl stop network
Issue the following command to check the network status, type:
systemctl status network
Outputs:
[root@devops /]# systemctl status network network.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init.d/network) Active: inactive (dead) since Tue 2014-12-16 08:09:43 CET; 12s ago Process: 13236 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS) Process: 9649 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS) Dec 16 08:02:27 devops network[9649]: [ OK ] Dec 16 08:02:27 devops systemd[1]: Started LSB: Bring up/down networking. Dec 16 08:09:42 devops systemd[1]: Stopping LSB: Bring up/down networking... Dec 16 08:09:42 devops network[13236]: Schnittstelle enp0s3 beenden: [ OK ] Dec 16 08:09:42 devops network[13236]: Loopback-Schnittstelle beenden: Dat...en Dec 16 08:09:42 devops network[13236]: Datei »/etc/sysconfig/network-scrip...en Dec 16 08:09:42 devops network[13236]: Datei »/etc/sysconfig/network-scrip...en Dec 16 08:09:43 devops network[13236]: Datei »/etc/sysconfig/network-scrip...en Dec 16 08:09:43 devops network[13236]: [ OK ] Dec 16 08:09:43 devops systemd[1]: Stopped LSB: Bring up/down networking. Hint: Some lines were ellipsized, use -l to show in full.
Searching the Active line to check the status if it is “inactive(dead)”.
CentOS 7 reload network service
If you just want to reload your netowrk configuration file, just need to reload the network service, issue the following command, type:
systemctl reload network.service
or
systemctl reload network
done…