centos 创建ifcfg-eth 1时网络没有合适的设备

7vhp5slm  于 2023-11-18  发布在  其他
关注(0)|答案(2)|浏览(180)

我需要你的帮助与一些奇怪的问题我们正试图创建一个ifcfg-eth 1网络设备在我们的centos 7服务器。
我们在ifcfg-eth 1文件中使用以下信息:

TYPE=Ethernet
BOOTPROTO=static
DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.101.61
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
DNS1=8.8.8.8
DNS2=8.8.4.4

字符串
ifcfg-eth0可以正常工作,但是当我们创建ifcfg-eth 1时,我们得到以下错误:

No suitable device found for this connection.


/var/log/messages的完整输出

Oct  5 10:38:09 switch-onpremis1 network: ループバックインターフェイスを呼び込み中 [  OK  ]
Oct  5 10:38:09 switch-onpremis1 network: インターフェース enp029f2u1 を活性化中:  [  OK  ]
Oct  5 10:38:10 switch-onpremis1 network: インターフェース eth0 を活性化中:  [  OK  ]
Oct  5 10:38:10 switch-onpremis1 NetworkManager[665]: <info>  [1538703490.1107] audit: op="connection-activate" uuid="9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04" name="System eth1" result="fail" reason="No suitable device found for this connection."
Oct  5 10:38:10 switch-onpremis1 network: インターフェース eth1 を活性化中:  エラー: 接続のアクティベーションに失敗: No suitable device found for this connection.
Oct  5 10:38:10 switch-onpremis1 network: [失敗]
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 network: RTNETLINK answers: File exists
Oct  5 10:38:10 switch-onpremis1 systemd: network.service: control process exited, code=exited status=1
Oct  5 10:38:10 switch-onpremis1 systemd: Failed to start LSB: Bring up/down networking.
Oct  5 10:38:10 switch-onpremis1 systemd: Unit network.service entered failed state.
Oct  5 10:38:10 switch-onpremis1 systemd: network.service failed.


这会是什么问题呢?是不是和我们的网卡有关?或者是别的什么地方出了问题?
ifcfg-eth0的设置是:

TYPE=Ethernet
PROXY_METHOD=static
BROWSER_ONLY=no
BOOTPROTO=static
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=eth0
UUID=f3d98d60-6062-4b70-a14c-7ac4040bd403
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.100.60
PREFIX=24
GATEWAY=192.168.100.1
DNS1=8.8.8.8


谢谢你的建议。非常感谢你的帮助。
过去三天我们一直在为同样的问题而斗争。

vd2z7a6w

vd2z7a6w1#

CentOS 7.x改变了网络,请查看以下内容:
读取3. And what if I want the old naming back?
查看7. What have you done with ifconfig/netstat?
https://wiki.centos.org/FAQ/CentOS7

xqkwcwgp

xqkwcwgp2#

我查了一下:

journalctl -u network.service

字符串
对我来说是

Bringing up interface enp2s0f0:  Error: Connection activation failed: No suitable device found for this connection (device eth0 not available because profile is not compatible with device (permanent MAC address doesn't match)).


然后去

/etc/sysconfig/network-scripts


在我的情况下,我注意到一些文件,如ifcfg-*,我删除了它们,只留下ifcg-eth0 -为我工作
所以检查journalctl -xe日志(journalctl -u network.service)帮助我找出了错误原因。
该错误是由于:

  • 错误器械=eth0
  • 存在一些文件,如ifcfg-*

相关问题