この問題がありますが、インターネット上で解決策が見つかりません。 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