lost and found ( for me ? )

openvswitch: create vLANs

Reference


# tail -1 /etc/lsb-release ; uname -ri
DISTRIB_DESCRIPTION="Ubuntu 13.10"
3.11.0-17-generic x86_64


# dpkg -l openvswitch-switch
ii  openvswitch-sw 1.10.2-0ubun amd64        Open vSwitch switch implementatio


create a VLAN 100 and add
# ovs-vsctl add-br br100
# ovs-vsctl add-port br100 tap100 tag=100


# ovs-vsctl show
edd6498d-3035-4358-b564-68fc594184ff
   Bridge "br100"
       Port "br100"
           Interface "br100"
               type: internal
       Port "tap100"
           tag: 100
           Interface "tap100"
       Port "vnet1"
           tag: 100
           Interface "vnet1"
       Port "vnet3"
           tag: 100
           Interface "vnet3"
   Bridge "br0"
       Port "p5p1"
           Interface "p5p1"
       Port "vnet2"
           Interface "vnet2"
       Port "br0"
           Interface "br0"
               type: internal
       Port "vnet0"
           Interface "vnet0"
   ovs_version: "1.10.2"


edit VM’s xml file
# virsh edit <vm name>
  </interface>
   <interface type='bridge'>
     <mac address='52:54:00:da:80:55'/>
     <source bridge='br100'/>
     <vlan>
       <tag id='100'/>
     </vlan>
     <virtualport type='openvswitch'>
</virtualport>
     <model type='virtio'/>


start the VM and assign IP addresses to those VMs
# virsh start vm1
# virsh start vm2


from VM1 to VM2
# ping 192.168.40.11 -c 1
PING 192.168.40.11 (192.168.40.11) 56(84) bytes of data.
64 bytes from 192.168.40.11: icmp_req=1 ttl=64 time=0.820 ms


--- 192.168.40.11 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.820/0.820/0.820/0.000 ms

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.