linux – KVMLibvirt桥接路由网络不适用于较新的来宾内核

linux – KVMLibvirt桥接路由网络不适用于较新的来宾内核,第1张

概述我有一个运行Debian 6的专用服务器,包含Libvirt(0.9.11.3)和Qemu-KVM(qemu-kvm-1.0 dfsg-11,Debian). 我在使用较新的内核(> 2.6.38)在KVM来宾中使用桥接/路由网络时遇到问题. NATted网络工作正常. 较旧的内核也可以很好地工作. 主机内核的版本是3.2.0-2-amd64,问题也出现在较旧的主机内核上. 主机的/ etc / 我有一个运行Debian 6的专用服务器,包含libvirt(0.9.11.3)和Qemu-KVM(qemu-kvm-1.0 dfsg-11,Debian).
我在使用较新的内核(> 2.6.38)在KVM来宾中使用桥接/路由网络时遇到问题. NATted网络工作正常.
较旧的内核也可以很好地工作.
主机内核的版本是3.2.0-2-amd64,问题也出现在较旧的主机内核上.
主机的/ etc / network / interfaces的内容(删除了ip):
# Loopback device:auto loiface lo inet loopback# brIDgeauto br0iface br0 inet static  address   176.9.xx.xx  broadcast 176.9.xx.xx  netmask   255.255.255.224  gateway   176.9.xx.xx  pointopoint   176.9.xx.xx  brIDge_ports eth0  brIDge_stp off  brIDge_maxwait 0  brIDge_fd 0  up route add -host 176.9.xx.xx dev br0 # VM IP  post-up mii-tool -F 100baseTx-FD br0# default route to access subnetup route add -net 176.9.xx.xx netmask 255.255.255.224 gw 176.9.xx.xx br0

主机上ifconfig -a的输出:

br0       link encap:Ethernet  HWaddr 54:04:a6:8a:66:13            inet addr:176.9.xx.xx  Bcast:176.9.xx.xx  Mask:255.255.255.224          inet6 addr: fe80::5604:a6ff:fe8a:6613/64 Scope:link          UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1          RX packets:20216729 errors:0 dropped:0 overruns:0 frame:0          TX packets:19962220 errors:0 dropped:0 overruns:0 carrIEr:0          collisions:0 txqueuelen:0           RX bytes:14144528601 (13.1 GiB)  TX bytes:7990702656 (7.4 GiB)eth0      link encap:Ethernet  HWaddr 54:04:a6:8a:66:13            UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1          RX packets:26991788 errors:0 dropped:12066 overruns:0 frame:0          TX packets:19737261 errors:270082 dropped:0 overruns:0 carrIEr:270082          collisions:1686317 txqueuelen:1000           RX bytes:15459970915 (14.3 GiB)  TX bytes:6661808415 (6.2 GiB)          Interrupt:17 Memory:fe500000-fe520000 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:16436  Metric:1          RX packets:6240133 errors:0 dropped:0 overruns:0 frame:0          TX packets:6240133 errors:0 dropped:0 overruns:0 carrIEr:0          collisions:0 txqueuelen:0           RX bytes:6081956230 (5.6 GiB)  TX bytes:6081956230 (5.6 GiB)virbr0    link encap:Ethernet  HWaddr 52:54:00:79:e4:5a                                                                                                                                                                                                                                  inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0                                                                                                                                                                                                             UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1                                                                                                                                                                                                                             RX packets:225016 errors:0 dropped:0 overruns:0 frame:0                                                                                                                                                                                                                        TX packets:412958 errors:0 dropped:0 overruns:0 carrIEr:0                                                                                                                                                                                                                      collisions:0 txqueuelen:0                                                                                                                                                                                                                                                      RX bytes:16284276 (15.5 MiB)  TX bytes:687827984 (655.9 MiB)                                                                                                                                                                                                         virbr0-nic link encap:Ethernet  HWaddr 52:54:00:79:e4:5a                                                                                                                                                                                                                                 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:500                                                                                                                                                                                                                                                    RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)                                                                                                                                                                                                                               vnet0     link encap:Ethernet  HWaddr fe:54:00:93:4e:68                                                                                                                                                                                                                                  inet6 addr: fe80::fc54:ff:fe93:4e68/64 Scope:link                                                                                                                                                                                                                              UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1                                                                                                                                                                                                                             RX packets:607670 errors:0 dropped:0 overruns:0 frame:0                                                                                                                                                                                                                        TX packets:5932089 errors:0 dropped:0 overruns:0 carrIEr:0                                                                                                                                                                                                                     collisions:0 txqueuelen:500                                                                                                                                                                                                                                                    RX bytes:83574773 (79.7 MiB)  TX bytes:1092482370 (1.0 GiB)                                                                                                                                                                                                          vnet1     link encap:Ethernet  HWaddr fe:54:00:ed:6a:43                                                                                                                                                                                                                                  inet6 addr: fe80::fc54:ff:Feed:6a43/64 Scope:link                                                                                                                                                                                                                              UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1                                                                                                                                                                                                                             RX packets:922132 errors:0 dropped:0 overruns:0 frame:0                                                                                                                                                                                                                        TX packets:6342375 errors:0 dropped:0 overruns:0 carrIEr:0                                                                                                                                                                                                                     collisions:0 txqueuelen:500           RX bytes:251091242 (239.4 MiB)  TX bytes:1629079567 (1.5 GiB)vnet2     link encap:Ethernet  HWaddr fe:54:00:0d:cb:3d            inet6 addr: fe80::fc54:ff:fe0d:cb3d/64 Scope:link          UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1          RX packets:9461 errors:0 dropped:0 overruns:0 frame:0          TX packets:665189 errors:0 dropped:0 overruns:0 carrIEr:0          collisions:0 txqueuelen:500           RX bytes:4990275 (4.7 MiB)  TX bytes:49229647 (46.9 MiB)vnet3     link encap:Ethernet  HWaddr fe:54:cd:83:eb:aa            inet6 addr: fe80::fc54:cdff:fe83:ebaa/64 Scope:link          UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1          RX packets:1649 errors:0 dropped:0 overruns:0 frame:0          TX packets:12177 errors:0 dropped:0 overruns:0 carrIEr:0          collisions:0 txqueuelen:500           RX bytes:77233 (75.4 KiB)  TX bytes:2127934 (2.0 MiB)

guest虚拟机的/ etc / network / interfaces,在这种情况下运行Ubuntu 12.04(删除了ip):

# This file describes the network interfaces available on your system# and how to activate them. For more information,see interfaces(5).# The loopback network interfaceauto loiface lo inet loopbackauto eth0iface eth0 inet static        address 176.9.xx.xx        netmask 255.255.255.248        gateway 176.9.xx.xx                # Host IP        pointopoint 176.9.xx.xx            # Host IP        dns-nameservers 8.8.8.8 8.8.4.4

guest虚拟机上ifconfig -a的输出:

eth0      link encap:Ethernet  HWaddr 52:54:cd:83:eb:aa            inet addr:176.9.xx.xx  Bcast:0.0.0.0  Mask:255.255.255.255          inet6 addr: fe80::5054:cdff:fe83:ebaa/64 Scope:link          UP broADCAST RUNNING MulTICAST  MTU:1500  Metric:1          RX packets:14190 errors:0 dropped:0 overruns:0 frame:0          TX packets:1768 errors:0 dropped:0 overruns:0 carrIEr:0          collisions:0 txqueuelen:1000           RX bytes:2614642 (2.6 MB)  TX bytes:82700 (82.7 KB)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:16436  Metric:1          RX packets:954 errors:0 dropped:0 overruns:0 frame:0          TX packets:954 errors:0 dropped:0 overruns:0 carrIEr:0          collisions:0 txqueuelen:0           RX bytes:176679 (176.6 KB)  TX bytes:176679 (176.6 KB)

在guest上输出Ping -c4:

Ping Google.nl (173.194.35.151) 56(84) bytes of data.64 bytes from muc03s01-in-f23.1e100.net (173.194.35.151): icmp_req=1 ttl=55 time=14.7 msFrom static.174.82.xx.xx.clIEnts.your-server.de (176.9.xx.xx): icmp_seq=2 Redirect Host(New nexthop: static.161.82.9.176.clIEnts.your-server.de (176.9.82.161))64 bytes from muc03s01-in-f23.1e100.net (173.194.35.151): icmp_req=2 ttl=55 time=15.1 msFrom static.198.170.9.176.clIEnts.your-server.de (176.9.170.198) icmp_seq=3 Destination Host UnreachableFrom static.198.170.9.176.clIEnts.your-server.de (176.9.170.198) icmp_seq=4 Destination Host Unreachable--- Google.nl Ping statistics ---4 packets transmitted,2 received,+2 errors,50% packet loss,time 3002msrtt min/avg/max/mdev = 14.797/14.983/15.170/0.223 ms,pipe 2

static.174.82.xx.xx.clIEnts.your-server.de(176.9.xx.xx)是主机的IP.
我遇到过这个问题,我试过的每个客户 *** 作系统都是Fedora,Ubuntu(服务器/桌面)和Debian,升级内核.我也试过自己编译来宾内核,但没有用.
我重新编译内核没有问题,尽管主机无法承受任何停机时间.
关于这个问题的任何想法都非常受欢迎.

编辑:我可以从访客内部Ping主机.

解决方法 好的,我自己找到了解决方案.显然,the Hetzner wiki上的文章并不完整.重定向仍然被发送,导致Hetzner(我们有我们的服务器)阻止流量.我不确定它与客户运行的内核版本有什么关系,如果有人可以解释我非常想听到它.

您可以通过执行以下命令找出是否遇到同样的问题:

for file in `find /proc/ -iname send_redirects`; do echo $file; cat $file; done

输出如下:

/proc/sys/net/ipv4/conf/all/send_redirects0/proc/sys/net/ipv4/conf/default/send_redirects1/proc/sys/net/ipv4/conf/lo/send_redirects1/proc/sys/net/ipv4/conf/eth0/send_redirects0/proc/sys/net/ipv4/conf/br0/send_redirects1/proc/sys/net/ipv4/conf/vnet1/send_redirects1/proc/sys/net/ipv4/conf/vnet0/send_redirects1/proc/sys/net/ipv4/conf/virbr0/send_redirects1/proc/sys/net/ipv4/conf/virbr0-nic/send_redirects1/proc/sys/net/ipv4/conf/vnet2/send_redirects1/proc/sys/net/ipv4/conf/vnet3/send_redirects1

我不得不承认我不知道哪些应该或不应该是0,但我已将它们全部设置为0,现在它工作正常,所以我会留下它.

for file in `find /proc/ -iname send_redirects`; do echo 0 > $file; done
总结

以上是内存溢出为你收集整理的linux – KVM / Libvirt桥接/路由网络不适用于较新的来宾内核全部内容,希望文章能够帮你解决linux – KVM / Libvirt桥接/路由网络不适用于较新的来宾内核所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1034085.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存