이 문제가 있는데 인터넷에서 해결책을 찾을 수 없습니다. cpanel과 whm이 포함된 centos 7 서버가 있습니다. NetworkManager를 제거하고 network.service를 열고 싶습니다. 그러면 항상 다음 오류가 발생합니다.
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
[root@b1ca0 ~]# 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 Thu 2019-01-31 10:34:31 EST; 8s ago
Docs: man:systemd-sysv-generator(8)
Process: 13807 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: network.service: control process exited, code=exited status=1
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: Failed to start LSB: Bring up/down networking.
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: Unit network.service entered failed state.
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: network.service failed.
[root@b1ca0 ~]# journalctl -u network
-- Logs begin at Thu 2019-01-31 10:30:42 EST, end at Thu 2019-01-31 10:43:29 EST. --
Jan 31 10:30:52 b1ca0.k.dedikuoti.lt systemd[1]: Starting LSB: Bring up/down networking...
Jan 31 10:30:53 b1ca0.k.dedikuoti.lt network[2894]: Bringing up loopback interface: [ OK ]
Jan 31 10:30:57 b1ca0.k.dedikuoti.lt network[2894]: Bringing up interface eth0: INFO : [ipv6_wait_tentative] Waiting for interface eth0 IPv6 address(es) to leave the 'tentative' state
Jan 31 10:30:57 b1ca0.k.dedikuoti.lt ipv6_wait_tentative[3335]: Waiting for interface eth0 IPv6 address(es) to leave the 'tentative' state
Jan 31 10:30:58 b1ca0.k.dedikuoti.lt network[2894]: INFO : [ipv6_wait_tentative] Waiting for interface eth0 IPv6 address(es) to leave the 'tentative' state
Jan 31 10:30:58 b1ca0.k.dedikuoti.lt ipv6_wait_tentative[3340]: Waiting for interface eth0 IPv6 address(es) to leave the 'tentative' state
Jan 31 10:30:59 b1ca0.k.dedikuoti.lt network[2894]: Error: inet prefix is expected rather than "2A02:7B40:5928:BA7::1/64".
Jan 31 10:30:59 b1ca0.k.dedikuoti.lt network[2894]: [ OK ]
Jan 31 10:31:00 b1ca0.k.dedikuoti.lt network[2894]: Bringing up interface prl_nettool-nm-eth0:
Jan 31 10:31:00 b1ca0.k.dedikuoti.lt dhclient[3406]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 (xid=0x5f0efd47)
Jan 31 10:31:07 b1ca0.k.dedikuoti.lt dhclient[3406]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11 (xid=0x5f0efd47)
Jan 31 10:31:18 b1ca0.k.dedikuoti.lt dhclient[3406]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11 (xid=0x5f0efd47)
Jan 31 10:31:29 b1ca0.k.dedikuoti.lt dhclient[3406]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14 (xid=0x5f0efd47)
Jan 31 10:31:43 b1ca0.k.dedikuoti.lt dhclient[3406]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18 (xid=0x5f0efd47)
Jan 31 10:32:01 b1ca0.k.dedikuoti.lt network[2894]: Determining IP information for eth0... failed.
Jan 31 10:32:01 b1ca0.k.dedikuoti.lt network[2894]: [FAILED]
Jan 31 10:32:01 b1ca0.k.dedikuoti.lt systemd[1]: network.service: control process exited, code=exited status=1
Jan 31 10:32:01 b1ca0.k.dedikuoti.lt systemd[1]: Failed to start LSB: Bring up/down networking.
Jan 31 10:32:01 b1ca0.k.dedikuoti.lt systemd[1]: Unit network.service entered failed state.
Jan 31 10:32:01 b1ca0.k.dedikuoti.lt systemd[1]: network.service failed.
Jan 31 10:33:29 b1ca0.k.dedikuoti.lt systemd[1]: Starting LSB: Bring up/down networking...
Jan 31 10:33:30 b1ca0.k.dedikuoti.lt network[13807]: Bringing up loopback interface: [ OK ]
Jan 31 10:33:30 b1ca0.k.dedikuoti.lt network[13807]: Bringing up interface eth0: RTNETLINK answers: File exists
Jan 31 10:33:30 b1ca0.k.dedikuoti.lt network[13807]: Error: inet prefix is expected rather than "2A02:7B40:5928:BA7::1/64".
Jan 31 10:33:30 b1ca0.k.dedikuoti.lt network[13807]: [ OK ]
Jan 31 10:33:30 b1ca0.k.dedikuoti.lt network[13807]: Bringing up interface prl_nettool-nm-eth0:
Jan 31 10:33:30 b1ca0.k.dedikuoti.lt dhclient[14056]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 (xid=0x612ef43c)
Jan 31 10:33:37 b1ca0.k.dedikuoti.lt dhclient[14056]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13 (xid=0x612ef43c)
Jan 31 10:33:50 b1ca0.k.dedikuoti.lt dhclient[14056]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14 (xid=0x612ef43c)
Jan 31 10:34:04 b1ca0.k.dedikuoti.lt dhclient[14056]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14 (xid=0x612ef43c)
Jan 31 10:34:19 b1ca0.k.dedikuoti.lt dhclient[14056]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9 (xid=0x612ef43c)
Jan 31 10:34:28 b1ca0.k.dedikuoti.lt dhclient[14056]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0x612ef43c)
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: Determining IP information for eth0... failed.
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: [FAILED]
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt network[13807]: RTNETLINK answers: File exists
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: network.service: control process exited, code=exited status=1
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: Failed to start LSB: Bring up/down networking.
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: Unit network.service entered failed state.
Jan 31 10:34:31 b1ca0.k.dedikuoti.lt systemd[1]: network.service failed.
DEVICE="eth0"
ONBOOT="yes"
BOOTPROTO="none"
HWADDR="00:00:59:28:0b:a7"
IPADDR="89.40.11.167"
NETMASK="255.255.255.255"
DHCPV6C="no"
IPV6_AUTOCONF="no"
IPV6INIT="yes"
IPV6ADDR="2A02:7B40:5928:BA7::1/64"
GATEWAY="169.254.0.1"
IPV6_DEFAULTGW="fe80::ffff:1:1"
[root@b1ca0 network-scripts]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:00:59:28:0b:a7 brd ff:ff:ff:ff:ff:ff
inet 89.40.11.167/32 brd 89.40.11.167 scope global eth0
valid_lft forever preferred_lft forever
inet6 2a02:7b40:5928:ba7::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::200:59ff:fe28:ba7/64 scope link
valid_lft forever preferred_lft forever
답변1
NetworkManager가 실제로 비활성화되어 있는지 확인할 수 있습니다.
# nmcli device status
# systemctl list-unit-files | grep NetworkManager
그런 다음 해당 파일을 편집하여 인터페이스에서 NM 매개변수를 확인해야 합니다.
Centos는 네트워크 장치의 일관된 이름 지정을 사용하므로 ethX가 표시되지 않더라도 놀라지 마십시오.
구성 파일 입력
# /etc/sysconfig/network-scripts/ifcfg-enpXsX
그리고 다음을 입력하세요:
NM_CONTROLLED="no"
DHCP를 사용하려고 하시는 것으로 확인되었습니다. 고정 IP 주소를 사용해 보시기 바랍니다.
예:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens160
UUID=666666666645664654654654
DEVICE=ens160
ONBOOT=yes
IPADDR=192.168.125.10
PREFIX=24
GATEWAY=192.168.125.1
DNS1=192.168.125.48
DNS2=8.8.8.8
IPV6_PRIVACY=no
NM_CONTROLLED=no
DNS를 설정하려면 /etc/resolv.conf 파일을 수정해야 합니다.
그런 다음 네트워크 서비스를 다시 시작하고 활성화해 보십시오.
systemctl restart network
systemctl enable network