How to install open vswitch.
I posted how to install OVS before, but the following instructions are very easy to install OVS.
Reference
http://www.ainoniwa.net/pelican/2014/0524a.html
I prepared two hosts and these boxes have two interfaces.
I will use one(eth0) for managing hosts and the other(eth1) for open vswith.
- host1
eth0 : assign an IP for managemtn
eth1 : no IPs ( directly connected to host2’s eth1 )
- host2
eth0 : assign an IP for management
eth1 : no IPs ( directly connected to host1’s eth1 )
install openvswitch(OVS) on both hosts.
# apt-get update;apt-get install openvswitch-switch –y
# ovs-vsctl show
xxxxxxxx
ovs_version: "2.0.1
|
edit /etc/network/interfaces
# grep -v ^# /etc/network/interfaces
auto lo
iface lo inet loopback
auto em1
iface em1 inet static
address 192.168.10.100
netmask 255.255.255.0
network 192.168.10.0
gateway 192.168.10.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
dns-search localdomain
auto br0
auto eth1
allow-ovs br0
iface br0 inet manual
ovs_type OVSBridge
ovs_ports eth1
allow-br0 eth1
iface eth1 inet manual
ovs_bridge br0
ovs_type OVSPort
|
# ifup --allow=ovs ovsbr0
|
# ovs-vsctl show
xxxxxxxx
Bridge "ovsbr0"
Port "eth1"
Interface "eth1"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
ovs_version: "2.0.1"
# ip addr show ovsbr0
32: ovsbr0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
link/ether brd ff:ff:ff:ff:ff:ff
#
# ip addr show eth1
5: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000
link/ether brd ff:ff:ff:ff:ff:ff
|
I did the same things on the another host.
If you have not installed OVS, you will see following errors
# ifup --allow=ovs ovsbr0
Cannot find device "ovsbr0"
Failed to bring up ovsbr0.
# apt-get install -y openvswitch-switch
# ifup --allow=ovs ovsbr0
|
edit VM’s xml file to use OVS.
<interface type='bridge'>
<mac address='MAC address'/>
<source bridge='ovsbr0'/>
<virtualport type='openvswitch'>
|
start VMs on the both hosts and confirm that both VMs can communicate each other.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.