[How to fix] Job for network.service failed pada CentOS 7

Baru saja saya mendapatkan masalah dari salah satu vps sever yang menggunakan centOS 7 tidak bisa direstart netowknya. Nah berikut ini cara mengatasi network centOS 7 yang tidak bisa di restart.

Berikut keterangan error ketika tidak bisa melakukan restart network pada centOS 7.

# systemctl restart network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

Kemudian bisa cek menggunakan perintah yang diinformasikan systemctl status network.service

# systemctl status network.service
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Sen 2018-07-23 23:27:20 EDT; 8min ago
Docs: man:systemd-sysv-generator(8)
Process: 2609 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Jul 23 23:27:20 vps.srv.usr network[2609]: RTNETLINK answers: File exists
Jul 23 23:27:20 vps.srv.usr network[2609]: RTNETLINK answers: File exists
Jul 23 23:27:20 vps.srv.usr network[2609]: RTNETLINK answers: File exists
Jul 23 23:27:20 vps.srv.usr network[2609]: RTNETLINK answers: File exists
Jul 23 23:27:20 vps.srv.usr network[2609]: RTNETLINK answers: File exists
Jul 23 23:27:20 vps.srv.usr network[2609]: RTNETLINK answers: File exists
Jul 23 23:27:20 vps.srv.usr systemd[1]: network.service: control process exited, code=exited status=1
Jul 23 23:27:20 vps.srv.usr systemd[1]: Failed to start LSB: Bring up/down networking.
Jul 23 23:27:20 vps.srv.usr systemd[1]: Unit network.service entered failed state.
Jul 23 23:27:20 vps.srv.usr systemd[1]: network.service failed.

Langkah selanjutnya lakukan stop dan matikan network menggunakan perintah berikut

# systemctl stop network
# systemctl disable network

Jika sudah aktifkan NetworkManager menggunakan perintah berikut

# systemctl enable NetworkManager
# systemctl start NetworkManager

Lalu cek status networknya menggunakan dengan perintah berikut

# systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Sen 2018-07-23 23:14:28 EDT; 30min ago
Docs: man:NetworkManager(8)
Main PID: 496 (NetworkManager)
CGroup: /system.slice/NetworkManager.service
├─496 /usr/sbin/NetworkManager --no-daemon
└─677 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-ens3.pid -lf /var/lib/NetworkManager/dhclient-b5a3102f-dd4c-377c-99a1-efb1f9487c5...

Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2080] device (ens3): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2087] device (ens3): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2122] device (ens3): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2124] manager: NetworkManager state is now CONNECTED_LOCAL
Jul 23 23:14:29 vps.srv.usr dhclient[677]: bound to 103.23.201.7 -- renewal in 8779963 seconds.
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2424] manager: NetworkManager state is now CONNECTED_SITE
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2428] policy: set 'Wired connection 1' (ens3) as default for IPv4 routing and DNS
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2772] device (ens3): Activation: successful, device activated.
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2779] manager: startup complete
Jul 23 23:14:29 vps.srv.usr NetworkManager[496]: <info> [1532402069.2783] manager: NetworkManager state is now CONNECTED_GLOBAL

Nah saat ini network pada server sudah jalan kembali, mudah bukan ? Sekian semoga bermanfaat 😀

Comments

comments