Open Virtual Switch

  • Install package
# apt-get install openvswitch-switch
  • Use em2 for VM network
# nano -w /etc/network/interfaces

+ auto em2
+ iface em2 inet manual
+         up ifconfig $IFACE up
+         down ifconfig $IFACE down

Reboot or to enable em2 without rebooting

# ifconfig em2 up
  • Configure virtual bridge
# ovs-vsctl add-br br0
# ovs-vsctl add-port br0 em2
  • Disable default KVM network
# virsh net-destroy default
# virsh net-deactivate default
# virsh net-undefine default
  • Define OVS networks for KVM

I.e. em2 network has untagged and tagged VLANs and we need one network for untagged VLAN and one network for tag 33 VLAN

# nano -w ovs-network-V0.xml
  <forward mode='bridge'/>
  <bridge name='br0'/>
  <virtualport type='openvswitch'/>
# nano -w ovs-network-V33.xml
  <forward mode='bridge'/>
  <bridge name='br0'/>
  <virtualport type='openvswitch'/>
      <tag id='33'/>
  • Enable networks for KVM VMs
# virsh net-define ovs-network-V0.xml
# virsh net-start ovs-network-V0
# virsh net-autostart ovs-network-V0

# virsh net-define ovs-network-V33.xml
# virsh net-start ovs-network-V33
# virsh net-autostart ovs-network-V33
# virsh net-list

 Name                 State      Autostart     Persistent
 ovs-network-V0       active     yes           yes
 ovs-network-V33      active     yes           yes

You can use these networks in VM configuration from “Virtual Machine Manager” GUI.

hypervisor/ovs1404.txt · Last modified: 2015/09/17 11:48 by giancarlo

Developers: CNR IRCrES IT Office and Library
Giancarlo Birello (giancarlo.birello _@_ and Anna Perin (anna.perin _@_
DigiBess is licensed under: Creative Commons License
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki
Drupal Garland Theme for Dokuwiki