lost and found ( for me ? )

openvswitch: create vLANs


# tail -1 /etc/lsb-release ; uname -ri
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
   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 type='bridge'>
     <mac address='52:54:00:da:80:55'/>
     <source bridge='br100'/>
       <tag id='100'/>
     <virtualport type='openvswitch'>
     <model type='virtio'/>

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

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

--- 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.