El problema
No se puede hacer que la red se inicie de manera confiable en un servidor cuando se usa DHCP:
# sudo /etc/init.d/network restart Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. [FAILED]
# journalctl -xe Nov 29 18:57:42 hostaname.domain.com dhclient[37653]: exiting. Nov 29 18:57:42 hostaname.domain.com network[37498]: [FAILED] Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com network[37498]: RTNETLINK answers: File Nov 29 18:57:42 hostaname.domain.com systemd[1]: network.service: control pr Nov 29 18:57:42 hostaname.domain.com systemd[1]: Failed to start LSB: Bring -- Subject: Unit network.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit network.service has failed. -- -- The result is failed. Nov 29 18:57:42 hostaname.domain.com systemd[1]: Unit network.service entere Nov 29 18:57:42 hostaname.domain.com systemd[1]: network.service failed. Nov 29 18:57:42 hostaname.domain.com polkitd[36998]: Unregistered Authentica
# sudo systemctl status -l 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 Mon 2016-12-12 12:48:04 EST; 28s ago Docs: man:systemd-sysv-generator(8) Process: 17797 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS) Process: 18067 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE) Dec 12 12:47:58 hostname.domain.com network[18067]: [FAILED] Dec 12 12:47:58 hostname.domain.com network[18067]: Bringing up interface eth1: Dec 12 12:48:04 hostname.domain.com network[18067]: Determining IP information for eth1... failed; no link present. Check cable? Dec 12 12:48:04 hostname.domain.com network[18067]: [FAILED] Dec 12 12:48:04 hostname.domain.com network[18067]: /etc/rc.d/init.d/network: line 88: ifcfg-eth0:DEVICE=eth0: command not found Dec 12 12:48:04 hostname.domain.com network[18067]: /etc/rc.d/init.d/network: line 89: ifcfg-eth0:TYPE=Ethernet: command not found Dec 12 12:48:04 hostname.domain.com systemd[1]: network.service: control process exited, code=exited status=1 Dec 12 12:48:04 hostname.domain.com systemd[1]: Failed to start LSB: Bring up/down networking. Dec 12 12:48:04 hostname.domain.com systemd[1]: Unit network.service entered failed state. Dec 12 12:48:04 hostname.domain.com systemd[1]: network.service failed.
archivo de configuración de red:
# less /etc/sysconfig/network-scripts/ifcfg-eth0 # Generated by parse-kickstart IPV6INIT=yes BOOTPROTO=dhcp DEVICE=eth0 ONBOOT=yes UUID=ccb107d4-4be6-453b-80f2-f803acc5f897 TYPE=Ethernet DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME="System eth0" PEERDNS=yes PEERROUTES=yes DHCP_HOSTNAME=IPV6_PEERDNS=yes IPV6_PEERROUTES=yes
La solución
Un sistema CentOS/RHEL configurado para redes DHCP no logra adquirir una dirección IP mientras reinicia el servicio de red. Agregando el parámetro PERSISTENT_DHCLIENT al archivo de configuración de la interfaz de red garantiza que el cliente DHCP de Oracle Linux (dhclient) solicite constantemente una concesión de dirección IP del servidor DHCP.
1. Agregue PERSISTENT_DHCLIENT directiva en /etc/sysconfig/network archivo de la siguiente manera:
# vi /etc/sysconfig/network NETWORKING=yes PERSISTENT_DHCLIENT=yes
2.Reiniciar servicios de red:
# /sbin/service network restart ## For CentOS/RHEL 5/6 # /usr/bin/systemctl restart network ## For CentOS/RHEL 7/8