Skip to content

Instantly share code, notes, and snippets.

@Bigbear325
Forked from zarzen/ovs-example.md
Last active March 7, 2017 14:13
Show Gist options
  • Save Bigbear325/77d8ac3ee43d8cb5501db373dcea5259 to your computer and use it in GitHub Desktop.
Save Bigbear325/77d8ac3ee43d8cb5501db373dcea5259 to your computer and use it in GitHub Desktop.
KVM+OVS installation and example

Openvswitch installation on Ubuntu 16.04

# make sure all tools are installed.
sudo apt-get install openvswitch-common openvswitch-switch-dpdk openvswitch-dbg openvswitch-pki openvswitch-ipsec openvswitch-switch openvswitch-switch-dpdk openvswitch-ipsec openvswitch-test openvswitch-testcontroller openvswitch-vtep

KVM installation



Network configuration

# add bridge
sudo ovs-vsctl add-br br1
# create virtual nic
sudo ip tuntap add mode tap vnet0
# 
sudo ip link set vnet0 up
# add virtual nic to bridge
sudo ovs-vsctl add-port br1 vnet0
# start up bridge
sudo ifconfig br1 up

# confirm status
sudo ip link
ifconfig
# check bridge status

# config virtual switch ip
sudo ifconfig br1 172.16.1.1 netmask 255.255.255.0 up

# setup virtual machine:
Network -> Bridged Adapter -> vnet0 

# setup the ip address inside virtual machine
sudo ifconfig <interface-name> 172.16.1.2 netmask 255.255.255.0 up

# more than one virtual machine
# select the same bridged adapater as previously did.
Network -> Bridge Adapter -> vnet0
# but setup different ip address inside virtual machine
sudo ifconfig <interface-name> 172.16.1.3 netmask 255.255.255.0 up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment