![Ubuntu 16.04 kvm 桥接器不工作](https://linux22.com/image/1091053/Ubuntu%2016.04%20kvm%20%E6%A1%A5%E6%8E%A5%E5%99%A8%E4%B8%8D%E5%B7%A5%E4%BD%9C.png)
我有一台在 kvm 上运行的 Windows 2008 服务器虚拟机,它有一个 rtl 网卡。我在虚拟机上安装了补丁,在主机上进行了“dist-upgrade”,现在网桥似乎没有转发数据包!主机有多个网卡,并且都是静态分配的。brDMZ 是我感兴趣的网桥,它被分配了 192.168.4.4,我可以从另一个(物理)主机 ping 通它。我试过回滚到 4.4.0-98,但没有成功。有什么建议吗?!?以下是一些输出:
uname -a
Linux vmhost-01 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
brctl show
bridge name bridge id STP enabled interfaces
brCSS 8000.001e0b480aba yes eth0
brDMZ 8000.d485644f4aee yes eth3
docker0 8000.0242823a37ed no
virbr0 8000.525400cf415c yes virbr0-nic
sudo ifconfig brDMZ
brDMZ Link encap:Ethernet HWaddr d4:85:64:4f:4a:ee
inet addr:192.168.4.4 Bcast:192.168.4.255 Mask:255.255.255.0
inet6 addr: fe80::d685:64ff:fe4f:4aee/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:168 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9004 (9.0 KB) TX bytes:648 (648.0 B)
brctl showstp brDMZ
brDMZ
bridge id 8000.d485644f4aee
designated root 8000.d485644f4aee
root port 0 path cost 0
max age 20.00 bridge max age 20.00
hello time 2.00 bridge hello time 2.00
forward delay 2.00 bridge forward delay 2.00
ageing time 300.00
hello timer 0.52 tcn timer 0.00
topology change timer 0.00 gc timer 171.35
flags
eth3 (1)
port id 8001 state forwarding
designated root 8000.d485644f4aee path cost 4
designated bridge 8000.d485644f4aee message age timer 0.00
designated port 8001 forward delay timer 0.00
designated cost 0 hold timer 0.00
flags
brctl showmacs brDMZ
port no mac addr is local? ageing timer
1 00:06:5b:f6:8b:dc no 179.48
1 00:0c:29:04:87:83 no 157.46
1 00:0c:29:f1:90:8e no 52.99
1 00:14:5e:77:f7:d7 no 59.09
1 d4:85:64:4f:4a:ee yes 0.00
1 d4:85:64:4f:4a:ee yes 0.00
sudo ebtables -t filter -L
Bridge table: filter
Bridge chain: INPUT, entries: 0, policy: ACCEPT
Bridge chain: FORWARD, entries: 0, policy: ACCEPT
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
答案1
运行 tcpdump(在多个地方)给了我解决这个问题的线索。我注意到 arp 流量出现在 vm 和主机的转储中,但传出和传入流量只会出现在主机上,而不会出现在 vm 上。ufw 正在运行但未设置任何内容(据我所知,对此并不了解),但我注意到 iptables -L 显示 FORWARD 链的策略是 DENY!我将其与我拥有的另一个 ubuntu 安装进行了比较,它的默认策略是 ACCEPT,因此 - 果然 - 将策略更改为 ACCEPT,一切正常!
我感觉安装 docker.io 会对 iptables 进行一些更改,但我不能确定,只是很高兴这个问题已经解决了!
希望它能帮助别人