Network scripts are deprecated in Red Hat Enterprise Linux 8 and they are no longer provided by default. In Red Hat Enterprise Linux 8, to run the ifup
and the ifdown
scripts, NetworkManager
must be running. By default if you try to use legacy network.service unit file is not available with RHEL 8.
[root@rhel-8 ~]# systemctl restart network Failed to restart network.service: Unit network.service not found.
You can use "NetworkManager.service
" as the default networking service in RHEL 8. Red Hat Enterprise Linux 8 uses the default networking service, NetworkManager
, which is a dynamic network control and configuration daemon to keep network devices and connections up and active when they are available.
Starting Network Service with NetworkManager
To start NetworkManager
:
[root@rhel-8 ~]# systemctl start NetworkManager
To enable NetworkManager
automatically at boot time:
[root@rhel-8 ~]# systemctl enable NetworkManager
Start Network Service without NetworkManager
If you use NM_CONTROLLED=no
in ifcfg file then you will be unable to bring up interfaces with 'ifup
' command.
The basic installation of RHEL 8 provides a new version of the ifup
and ifdown
scripts which call the NetworkManager
service through the nmcli tool.
/sbin/ifup-local
, ifdown-pre-local
and ifdown-local
scripts are not executed.
How to fix "Failed to restart network.service: Unit network.service not found" in RHEL 8
If any of these scripts are required, the installation of the deprecated network scripts in the system is still possible with the following command:
[root@rhel-8 ~]# yum install network-scripts
In RHEL 7 /etc/rc.d/init.d/network
was owned by initscripts
but with RHEL 8 this tool is part of network-scripts
rpm
Next you can check the content of network-scripts
rpm
[root@rhel-8 ~]# rpm -ql network-scripts-10.00.1-1.el8.x86_64 | grep "/etc/rc.d/init.d/network" /etc/rc.d/init.d/network
The ifup
and ifdown
scripts link will be installed with legacy network scripts.
Calling the legacy network scripts shows a warning about their deprecation.
[root@rhel-8 ~]# ifup eth0 WARN : [ifup] You are using 'ifup' script provided by 'network-scripts', which are now deprecated. WARN : [ifup] 'network-scripts' will be removed in one of the next major releases of RHEL. WARN : [ifup] It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well. Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/6)
Now you can use systemctl
to restart the network service
[root@rhel-8 ~]# systemctl restart network [root@rhel-8 ~]# systemctl is-active network active
Lastly I hope the steps from the article to fix "Failed to restart network.service: Unit network.service not found" in RHEL 8 Linux was helpful. So, let me know your suggestions and feedback using the comment section.
Job for network.service failed because the control process exited with error code.
See “systemctl status network.service” and “journalctl -xe” for details.
I am on RHEL8.
You will have to check the logs to get more details on the cause of failure
I got error Failed to restart NetworkManager.service: Unit Networkmanager.service not found
On reboot or re-power both my network ports are NOT enabled. I must issue ifup eno1 and ifup eno2 each time. I have ONBOOT=yes in my ifcfg-en01 and ifcfg-eno2 files. I still must manually bring up the ports each time. I am on RHEL8.
have you checked is the network.service is enabled?
solved by just starting the network manager
SOLVED, the problem was the parameter order in the ifcfg-ens2f0 file. Now works well.
systemctl enable NetworkManager command works!!
Can i use the same procedures to solve same issue in Kali Linux 2020?
I am afraid I have not validated on Kali Linux
It is crucial to be clear on the solution one provides where every step towards resolution matters.. I referred to your solution and it helped me resolve the issue which I think would have taken hours otherwise. Thank you!
I know this might be old but I resolved the issue by setting:
dhcp=dhclient
in the /etc/NetworkManager/NetworkManager.conf file
Once done, restart the Network Manager:
systemctl restart NetworkManager
the default workstation install sets ONBOOT to no, there’s ur problem! so look at your /etc/sysconfig/network-scripts/ifcfg-ens33 or w/e name it used and change ONBOOT to yes then reboot.
This will only happen if you do not activate the NIC card during installation stage. One cannot definitely reboot the system every time he/she has to restart the network 🙂