Thanks to Jesse. It is good now, I change the nic to netdev.
# kvm -name vm0 -m 384 -hda /images/1.img -vnc :0 \ -netdev tap,id=hostnet0,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown \ -device rtl8139,netdev=hostnet0,id=net0,mac=00:00:01:00:00:01,bus=pci.0,addr=0x3 \ -netdev tap,id=hostnet1,script=/etc/ovs-ifup1,downscript=/etc/ovs-ifdown1 \ -device rtl8139,netdev=hostnet1,id=net1,mac=00:00:02:00:00:01,bus=pci.0,addr=0x4 & ----- Original Message ----- From: "Jesse Gross" <[email protected]> To: "changlimin" <[email protected]> Cc: <[email protected]> Sent: Monday, August 08, 2011 10:15 AM Subject: Re: [ovs-discuss] Question about a vm connect to 2 bridges? > 2011/8/8 changlimin <[email protected]>: >> Hi, >> >> I start a ovs-vswitchd, then create 2 bridges: br0 and br1. >> >> Then I start a vm, which has 2 vnics, the mac is 00:00:01:00:00:01, >> 00:00:02:00:00:01, connect to br0 and br1 respective. >> >> # kvm -name vm0 -m 384 -hda /images/1.img -vnc :0 \ >> -net nic,macaddr=00:00:01:00:00:01 -net >> tap,script=/etc/ovs-ifup,downscript=/etc/ovs-ifdown \ >> -net nic,macaddr=00:00:02:00:00:01 -net >> tap,script=/etc/ovs-ifup1,downscript=/etc/ovs-ifdown1 & >> # cat /etc/ovs-ifup >> switch='br0' >> /sbin/ifconfig $1 0.0.0.0 up >> ovs-vsctl add-port ${switch} $1 tag=10 >> # cat /etc/ovs-ifup1 >> #!/bin/sh >> switch='br1' >> /sbin/ifconfig $1 0.0.0.0 up >> ovs-vsctl add-port ${switch} $1 tag=11 >> >> Then I find something strange: >> >> # ovs-appctl fdb/show br0 >> port VLAN MAC Age >> 1 10 7a:e0:56:ae:1d:c9 529 >> 1 10 00:00:02:00:00:01 182 The nic connect br1, why >> appear at br0 ? >> 1 10 00:00:01:00:00:01 182 >> # ovs-appctl fdb/show br1 >> port VLAN MAC Age >> 1 11 12:93:1d:8e:7d:74 536 >> 1 11 00:00:02:00:00:01 183 >> 1 11 00:00:01:00:00:01 183 The nic connect br0, why >> appear at br1 ? >> Does there is a implict cable connect br0 to br1 ? > > KVM has an internal set of "vlans" that by default are all the same. > Unless you assign interfaces to different vlans in KVM you will get > crosstalk. > _______________________________________________ discuss mailing list [email protected] http://openvswitch.org/mailman/listinfo/discuss
