免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1582 | 回复: 0
打印 上一主题 下一主题

KVM / Libvirtd -> bridge does not work [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-31 09:25 |只看该作者 |倒序浏览
I am trying to get a virtual machine running with bridged networking.  I am using KVM with libvirtd.
kvm/jaunty-updates uptodate 1:84+dfsg-0ubuntu12.3
libvirt-bin/jaunty-updates uptodate 0.6.1-0ubuntu5.1
qemu/jaunty uptodate 0.10.0-1ubuntu1
My host network configuration looks like this :
        Code:
        auto lo
iface lo inet loopback
auto br0
iface br0 inet static
        address 192.168.1.100
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        bridge_ports eth0
        bridge_stp off
        bridge_maxwait 5
        bridge_hello 2
        bridge_fd 9
        bridge_maxage 12
That results in :
        Code:
        br0       Link encap:Ethernet  HWaddr 00:24:1d:22:97:39  
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::224:1dff:fe22:9739/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         
eth0      Link encap:Ethernet  HWaddr 00:24:1d:22:97:39  
          inet6 addr: fe80::224:1dff:fe22:9739/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         
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
         
virbr0    Link encap:Ethernet  HWaddr d6:e1:ee:be:c1:cb  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          inet6 addr: fe80::d4e1:eeff:febe:c1cb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
Abbreviated of course...
And just for completeness, brctl show
        Code:
        bridge name        bridge id                STP enabled        interfaces
br0                8000.00241d229739        no                eth0
pan0                8000.000000000000        no               
virbr0                8000.000000000000        yes
With this configuration, networking is fine, else I would not be typing here

Now, my VM instance has the following bit in it's configuration :
        Code:
            
      
      
   
However, the VM can not ping the outer host, nor the gateway. I
am unsure if this is relevant, but under the hardware tab -> NIC it
shows "Source device" as "-". Should this not show br0 ?
Iptables in the VM is off, and iptables on my host looks like this:
        Code:
        Chain INPUT (policy ACCEPT 14021 packets, 18M bytes)
pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     udp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           udp dpt:53
    0     0 ACCEPT     tcp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           tcp dpt:53
    0     0 ACCEPT     udp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           udp dpt:67
    0     0 ACCEPT     tcp  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           tcp dpt:67
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  *      virbr0  0.0.0.0/0            192.168.122.0/24    state RELATED,ESTABLISHED
    0     0 ACCEPT     all  --  virbr0 *       192.168.122.0/24     0.0.0.0/0           
    0     0 ACCEPT     all  --  virbr0 virbr0  0.0.0.0/0            0.0.0.0/0           
    0     0 REJECT     all  --  *      virbr0  0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable
    0     0 REJECT     all  --  virbr0 *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT 13739 packets, 15M bytes)
pkts bytes target     prot opt in     out     source               destination
Those rules looks like it deals with the standard NAT.
Any help would be appreciated.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/70049/showart_2136044.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP