我的 KVM 主机(Ubuntu 16.04)出现故障。
我配置了一些虚拟机,br0
因此它们在 LAN 上显示为具有自己 IP 的独立机器。
他们通过 DHCP 从路由器获取 IP。一切顺利。
但它当然停止工作了,我不明白为什么。br0
仍然存在,但机器永远无法获得 DHCP 租约。主机仍然具有连接性。如果我将机器切换到 NAT,它们就可以访问网络。但不是br0
。
/etc/network/interfaces
主机上的情况如下:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
# auto enp4s0
# iface enp4s0 inet manual
# VMs bridge
auto br0
iface br0 inet dhcp
bridge_ports enp4s0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
$ IP地址:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
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: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
link/ether 00:1d:09:0b:87:6d brd ff:ff:ff:ff:ff:ff
inet6 fe80::21d:9ff:fe0b:876d/64 scope link
valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:1d:09:0b:87:6d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.129/24 brd 192.168.1.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::21d:9ff:fe0b:876d/64 scope link
valid_lft forever preferred_lft forever
4: br-0e57a29cd0f7: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:2b:9a:39:d6 brd ff:ff:ff:ff:ff:ff
inet 172.18.0.1/16 scope global br-0e57a29cd0f7
valid_lft forever preferred_lft forever
5: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ed:8f:cb:c1 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:edff:fe8f:cbc1/64 scope link
valid_lft forever preferred_lft forever
7: veth44c7e80@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
link/ether 3e:61:3e:be:b2:8e brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet6 fe80::3c61:3eff:febe:b28e/64 scope link
valid_lft forever preferred_lft forever
8: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:41:79:0f 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
9: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:41:79:0f brd ff:ff:ff:ff:ff:ff
$ brctl 显示
bridge name bridge id STP enabled interfaces
br-0e57a29cd0f7 8000.02422b9a39d6 no
br0 8000.001d090b876d no enp4s0
docker0 8000.0242ed8fcbc1 no veth44c7e80
virbr0 8000.52540041790f yes virbr0-nic
$ IP 路由列表
default via 192.168.1.1 dev br0
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.18.0.0/16 dev br-0e57a29cd0f7 proto kernel scope link src 172.18.0.1 linkdown
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.129
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
brctl show 虚拟机已启动:
bridge name bridge id STP enabled interfaces
br-0e57a29cd0f7 8000.02422b9a39d6 no
br0 8000.001d090b876d no enp4s0
vnet0
docker0 8000.0242ed8fcbc1 no veth44c7e80
virbr0 8000.52540041790f yes virbr0-nic
$ ip 地址显示 dev vnet0
13: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:81:08:d0 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe81:8d0/64 scope link
valid_lft forever preferred_lft forever
我不知道现在该做什么。我尝试删除并重新安装 kvm + qemu、删除并重新创建桥接、在 br0 上创建新 VM... 完全没有变化。