自从我重新启动运行 CentOS 7 的 KVM 主机后,遇到了一个奇怪的问题。
我有一个运行良好的网桥,我可以访问我的 KVM 主机和客户机,但自从重新启动后,我无法访问主机。我可以 ping 它,并从虚拟机访问它,但不能从我的物理网络访问它,这意味着我无法从我的机器上使用 virt-manager 通过 ssh 访问它。关闭防火墙没有帮助。
以下是我的一些配置:
/etc/sysconfig/网络脚本/ifcg-enp2s0:
HWADDR="xx:xx:xx:xx:xx:xx"
TYPE="ethernet"
BOOTPROTO="none"
NAME="enp2s0"
ONBOOT="yes"
NM_CONTROLLED="no"
BRIDGE="br0"
在 /etc/sysconfig/network/ifcg-br0 中:
DEVICE="br0"
BOOTPROTO="static"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="bridge"
IPADDR=192.168.4.10
STP=on
NETMASK=255.255.255.0
DELAY="0"
在 /etc/sysconfig/网络:
GATEWAY=192.168.4.1
GATEWAYDEV="br0"
brctl 显示:
br0 8000.90e6ba2e63fd yes enp2s0
vnet0
vnet1
virbr0 8000.000000000000 yes
ifconfig 命令:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.4.10 netmask 255.255.255.0 broadcast 192.168.4.255
inet6 fe80::92e6:baff:fe2e:63fd prefixlen 64 scopeid 0x20<link>
ether 90:e6:ba:2e:63:fd txqueuelen 0 (Ethernet)
RX packets 508 bytes 97333 (95.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 519 bytes 38241 (37.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::92e6:baff:fe2e:63fd prefixlen 64 scopeid 0x20<link>
ether 90:e6:ba:2e:63:fd txqueuelen 1000 (Ethernet)
RX packets 1165 bytes 476382 (465.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1393 bytes 131697 (128.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp3s5: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:26:5a:f0:3c:29 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Boucle locale)
RX packets 6 bytes 352 (352.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6 bytes 352 (352.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 6a:11:26:70:d7:3b txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 90 (90.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::fc54:ff:fe4d:946c prefixlen 64 scopeid 0x20<link>
ether fe:54:00:4d:94:6c txqueuelen 500 (Ethernet)
RX packets 58 bytes 7174 (7.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 134 bytes 15618 (15.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::fc54:ff:fe56:7ed4 prefixlen 64 scopeid 0x20<link>
ether fe:54:00:56:7e:d4 txqueuelen 500 (Ethernet)
RX packets 774 bytes 83968 (82.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 867 bytes 397448 (388.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
谢谢你的帮助,我真的迷路了。
答案1
正如@dyasny 所说,这是一个 IP 冲突,因此问题解决了!