nmtui edit
我使用(编辑的有线连接 1)为我的 CentOS 7 服务器设置了一个静态 IP :
现在网络服务 ( systemctl restart network
) 不再启动。
日志输出:
-- Unit network.service has begun starting up.
May 03 21:52:09 NIXSERVER NetworkManager[1010]: <info> [1588557129.6050] ifcfg-rh: update /etc/sysconfig/network-scripts/ifcfg-Wired_connection_1 (d8fac711-9114-32c9-a759-05fdeed28a6f,"Wired connection 1")
May 03 21:52:09 NIXSERVER NetworkManager[1010]: <warn> [1588557129.6094] ifcfg-rh: loading "/etc/sysconfig/network-scripts/ifcfg-eth0" fails: File '/etc/sysconfig/network-scripts/ifcfg-eth0' had neither TYPE nor DEVICE keys.
May 03 21:52:10 NIXSERVER network[12774]: Bringing up loopback interface: [ OK ]
May 03 21:52:10 NIXSERVER network[12774]: Bringing up interface Wired_connection_1: [ OK ]
May 03 21:52:10 NIXSERVER NetworkManager[1010]: <info> [1588557130.9329] audit: op="connection-activate" uuid="08e23dbd-9817-4247-98f3-4a149eecd390" name="enp0s25" result="fail" reason="No suitable device found for this connection."
May 03 21:52:10 NIXSERVER network[12774]: Bringing up interface enp0s25: Error: Connection activation failed: No suitable device found for this connection.
May 03 21:52:10 NIXSERVER network[12774]: [FAILED]
May 03 21:52:11 NIXSERVER NetworkManager[1010]: <warn> [1588557131.1644] ifcfg-rh: loading "/etc/sysconfig/network-scripts/ifcfg-eth0" fails: File '/etc/sysconfig/network-scripts/ifcfg-eth0' had neither TYPE nor DEVICE keys.
May 03 21:52:11 NIXSERVER network[12774]: Bringing up interface eth0: Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0'
May 03 21:52:11 NIXSERVER NetworkManager[1010]: <warn> [1588557131.3840] ifcfg-rh: loading "/etc/sysconfig/network-scripts/ifcfg-eth0" fails: File '/etc/sysconfig/network-scripts/ifcfg-eth0' had neither TYPE nor DEVICE keys.
May 03 21:52:11 NIXSERVER network[12774]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-eth0'
May 03 21:52:11 NIXSERVER network[12774]: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device does not seem to be present, delaying initialization.
May 03 21:52:11 NIXSERVER /etc/sysconfig/network-scripts/ifup-eth[13057]: Device does not seem to be present, delaying initialization.
May 03 21:52:11 NIXSERVER network[12774]: [FAILED]
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER network[12774]: RTNETLINK answers: File exists
May 03 21:52:11 NIXSERVER systemd[1]: network.service: control process exited, code=exited status=1
May 03 21:52:11 NIXSERVER systemd[1]: Failed to start LSB: Bring up/down networking.
-- Subject: Unit network.service has failed
有什么我想念的吗?该硬件只有一个连接到它的以太网。
命令输出nmcli -p dev
:
nmcli -p dev
====================================================
Status of devices
====================================================
DEVICE TYPE STATE CONNECTION
----------------------------------------------------
docker0 bridge connected docker0
enp12s0 ethernet connected Wired connection 1
enp11s0 ethernet unavailable --
lo loopback unmanaged --
日志显示 enp0s25 和 eth0,它们都不会显示在您的 nmcli 列表中。你确定你编辑的连接是正确的吗?
我不会搞乱编辑内核参数,而是会追查并修复名称错误的原因。
/etc/sysconfig/network-scripts 文件的名称和内容是否正确?名称应与您的接口相对应:ifcfg-enp12s0 和 DEVICE=enp12s0。如果没有其他东西看起来不合适
systemctl restart NetworkManager
并检查。在我的 Centos 7 服务器文件名上,DEVICE=、nmcli 和 nmtui 都显示相同的内容 - 你不应该只有一个网卡有 3 个条目。我会删除 2 并修复一个。也许您更改了导致 Centos 重命名的网卡或 bios 设置。其他 2 个通用条目可能是无意中添加的。
看起来您正在尝试启动
eth0
,但您的设备名称是enp12s0
。您可以
biosdevname=0 net.ifnames=0
在内核命令行上设置旧的 NIC 名称。