Reference
http://networkstatic.net/install-open-vswitch-networking-red-hat-fedora-20
http://www.mylinuxplace.com/create-taptun-device-centos-7/
install openvswitch via yum and start the OVS.
# yum install openvswitch
# systemctl status openvsiwtch.service
* openvsiwtch.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
# systemctl start openvswitch.service
# systemctl status openvswitch.service
* openvswitch.service - Open vSwitch
Loaded: loaded (/usr/lib/systemd/system/openvswitch.service; disabled)
Active: active (exited) since Wed 2015-01-14 01:20:45 JST; 1min 57s ago
Process: 11536 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 11536 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/openvswitch.service
# systemctl enable openvswitch.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openvswitch.service to /usr/lib/systemd/system/openvswitch.service.
# ovs-vsctl show
575eac37-000f-4925-988d-8cb40a48c021
ovs_version: "2.3.1"
|
add a bridge
# ovs-vsctl add-br ovsbr0
# ovs-vsctl show
575eac37-000f-4925-988d-8cb40a48c021
Bridge "ovsbr0"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
ovs_version: "2.3.1"
|
add an interface to VMs.
virsh edit <VM>
<interface type='bridge'>
<source bridge='ovsbr0'/>
<virtualport type='openvswitch'>
</virtualport>
</interface>
|
start VMs.
# virsh start ubuntu1404-vm2
Domain ubuntu1404-vm2 started
# virsh start ubuntu1404-vm3
Domain ubuntu1404-vm3 started
|
# ovs-vsctl show
575eac37-000f-4925-988d-8cb40a48c021
Bridge "ovsbr0"
Port "ovsbr0"
Interface "ovsbr0"
type: internal
Port "vnet10"
Interface "vnet10"
Port "vnet7"
Interface "vnet7"
ovs_version: "2.3.1"
|
VM1 (10.0.0.100 ) -- OVS -- VM2 (10.0.0.200)
confirm that each VM can communicate with the other.
send ping to VM2 from VM1.
# ping 10.0.0.200 -c 1
PING 10.0.0.200 (10.0.0.200) 56(84) bytes of data.
64 bytes from 10.0.0.200: icmp_seq=1 ttl=64 time=1.01 ms
--- 10.0.0.200 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.011/1.011/1.011/0.000 ms
|
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.