KVM Bridge 奇怪之处 - 界面上没有 IPADDR,但在“if ADDR”中显示,并且运行 virt-install 时 ssh 访问松散

KVM Bridge 奇怪之处 - 界面上没有 IPADDR,但在“if ADDR”中显示,并且运行 virt-install 时 ssh 访问松散

这很奇怪,主接口 (enp7s0) 有一个 IP 地址。ifcfg-enp7s0 中没有 IP 地址,它在 ifcfg-br0 中。一切似乎都正常,但是当我在测试服务器上设置它时,我没有在主接口上获得 IP。有什么想法吗?

更新:实际上几乎所有功能均正常运行。 当我执行 virt-install 时,我失去了对服务器的 ssh 访问权限。通过 ssh 连接的现有终端仍然有效,但新终端无法连接,22 超时错误。如果我终止 virt-install,我可以在新终端上 ssh 连接。

ifcfg-enp7s0

DEVICE="enp7s0"
NM_CONTROLLED="no"
ONBOOT=yes
#HWADDR=2c:4d:54:43:92:df
TYPE=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System enp7s0"
BRIDGE=br0

ifcfg-br0

DEVICE="br0"
NM_CONTROLLED="no"
ONBOOT=yes
#HWADDR=2c:4d:54:43:92:df
TYPE=Bridge
BOOTPROTO=static
IPADDR=xxx.171.204.107
NETMASK=255.255.252.0
IPV4_FAILURE_FATAL=yes
IPV6INIT=no

路由-br0

xxx.171.204.1 dev br0
default via xxx.171.204.1

IP 地址

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: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
    inet xxx.171.204.107/22 brd 213.171.207.255 scope global enp7s0
       valid_lft forever preferred_lft forever
    inet6 fe80::2e4d:54ff:fe43:92df/64 scope link
       valid_lft forever preferred_lft forever
3: enp8s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 2c:4d:54:43:92:e0 brd ff:ff:ff:ff:ff:ff
5: br-369501bb177f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:22:7c:d4:52 brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-369501bb177f
       valid_lft forever preferred_lft forever
    inet6 fe80::42:22ff:fe7c:d452/64 scope link
       valid_lft forever preferred_lft forever
32: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:56:31:0e brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
33: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:56:31:0e brd ff:ff:ff:ff:ff:ff
36: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 2c:4d:54:43:92:df brd ff:ff:ff:ff:ff:ff
    inet xxx.171.204.107/22 brd 213.171.207.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::2e4d:54ff:fe43:92df/64 scope link
       valid_lft forever preferred_lft forever

答案1

好的,解决了。我忘记在之前的尝试中删除 ifconfg-enp8s0(结果发现 Fasthosts 实际上没有连接第二个 NIC)。而且我愚蠢地留下了 DEVICE="enp7s0"。删除文件后一切正常。

相关内容