Ubuntu KVM – 无法通过网桥访问networking,无DHCP,无法ping通

我有一台运行Ubuntu 16.04.3 LTSgraphics的笔记本电脑(安装了Network-Manager等)。 我想我已经正确安装了KVM和QEMU。 当试图从netinstall ISO设置Debian虚拟机时,它无法从DHCP获取地址。 我需要能够从我的笔记本电脑外部访问虚拟机,所以我不能使用NAT。

我试过以下的指示:
如何为虚拟机configuration桥接networking
KVM-客人不能通过桥 – 没有互联网连接
KVM客人无法访问互联网
但是还是没有运气。

笔记本电脑是戴尔XPS 13,没有板载网卡。 相反,我有一个TP-Link USB3.0千兆以太网适配器,根据规格页面是一个RTL8153芯片组。 以太网在主机上工作正常。 Wifi已禁用。

我曾尝试通过brctl在Virt-Manager GUI中configuration网桥,并在/ etc / network / interfaces中对其进行定义。 尽我所知,网桥已经正常运行,但是试图在虚拟机之外ping通导致失败。 有一次,我能够ping主机的笔记本电脑的IP,但没有更多的(我不记得我做了什么导致这一点,不再是这种情况,ping任何东西在同一个子网导致数据包消失,ping谷歌在Network is unreachable结果Network is unreachable ,我已经停止了ufw服务,并且另外刷新了iptables规则,但都没有成功,我在同一台机器上有Docker,但是我不知道这是否有什么不同。

主机:

使用ifconfig:

 root@DB0277:~# ifconfig br0 Link encap:Ethernet HWaddr d4:6e:0e:06:29:c1 inet addr:10.11.x.44 Bcast:10.11.x.255 Mask:255.255.255.0 inet6 addr: fe80::d66e:eff:fe06:29c1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:667579 errors:0 dropped:0 overruns:0 frame:0 TX packets:351430 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:907499432 (907.4 MB) TX bytes:21171832 (21.1 MB) docker0 Link encap:Ethernet HWaddr 02:42:54:45:ff:85 inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) enxd46e0e0629c1 Link encap:Ethernet HWaddr d4:6e:0e:06:29:c1 inet addr:10.11.x.44 Bcast:10.11.x.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:672999 errors:0 dropped:0 overruns:0 frame:0 TX packets:354674 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:909372154 (909.3 MB) TX bytes:21561645 (21.5 MB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:112607 errors:0 dropped:0 overruns:0 frame:0 TX packets:112607 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:143555055 (143.5 MB) TX bytes:143555055 (143.5 MB) vnet0 Link encap:Ethernet HWaddr fe:54:00:6d:02:e7 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2860 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:963296 (963.2 KB) TX bytes:0 (0.0 B) 

brctl:

 root@DB0277:~# brctl show bridge name bridge id STP enabled interfaces br0 8000.d46e0e0629c1 no enxd46e0e0629c1 docker0 8000.02425445ff85 no virbr0 8000.fe54006d02e7 yes vnet0 

的/ etc /networking/接口:

 auto lo iface lo inet loopback #auto br0 iface br0 inet dhcp bridge_ports enxd46e0e0629c1 bridge_stp off bridge_fd 0.0 

iptables的:

 root@DB0277:~# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere udp dpt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:domain ACCEPT udp -- anywhere anywhere udp dpt:bootps ACCEPT tcp -- anywhere anywhere tcp dpt:bootps Chain FORWARD (policy DROP) target prot opt source destination ACCEPT all -- anywhere 192.168.122.0/24 ctstate RELATED,ESTABLISHED ACCEPT all -- 192.168.122.0/24 anywhere ACCEPT all -- anywhere anywhere REJECT all -- anywhere anywhere reject-with icmp-port-unreachable REJECT all -- anywhere anywhere reject-with icmp-port-unreachable DOCKER-USER all -- anywhere anywhere DOCKER-ISOLATION all -- anywhere anywhere ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED DOCKER all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere udp dpt:bootpc Chain DOCKER (1 references) target prot opt source destination Chain DOCKER-ISOLATION (1 references) target prot opt source destination RETURN all -- anywhere anywhere Chain DOCKER-USER (1 references) target prot opt source destination RETURN all -- anywhere anywhere 

路线:

 root@DB0277:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 10.11.x.1 0.0.0.0 UG 0 0 0 br0 10.11.x.0 0.0.0.0 255.255.255.0 U 0 0 0 br0 10.11.y.21 10.11.x.1 255.255.255.255 UGH 100 0 0 enxd46e0e0629c1 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0 

客户操作系统是未经修改的Debian 9.0 netinstall。

在ServerFault中发布,因为我已经成功地设置了两台KVM主机而没有任何这些问题。 我忽略了什么?