Multiple OVS switches within single host - OverFlowJAMK/General GitHub Wiki
First create virtual ethernet interfaces (veth)
# sudo ip link add veth0 type veth peer name veth1
<- Here we create 2 interfaces and link them together with endpoint names veth0 and veth1
For the next step you'll probably want to bring them up:
# sudo ifconfig veth0 up && sudo ifconfig veth1 up
<- nothing to explain here, but remember to do this anyway
Second you'll need to create a new bridge (to connect to)
# sudo ovs-vsctl add-br br1
<- here you create a new bridge named "br1"
Third you connect our newly created veth-interfaces to new(br1) and old(br0) bridges
# sudo ovs-vsctl add-port br0 veth0 && sudo ovs-vsctl add-port br1 veth1
optional: Move physical interface from old bridge to a new one
# sudo ovs-vsctl del-port br0 eth1
<- in our example the old interface is eth1
# sudo ovs-vsctl add-port br1 eth1
<- add the old interface to a new bridge
Add controller to a new bridge
# sudo ovs-vsctl set-controller br1 tcp:10.0.0.1:6633
<- this may vary based on your network settings
You can also create a bash script
# sudo vim scriptname.sh
<- you can also use nano or other text editors of your choice
#Basically you add all the needed lines in the file
sudo ip link add veth0 type veth peer name veth1
sudo ifconfig veth0 up && sudo ifconfig veth1 up
sudo ovs-vsctl add-br br1
sudo ovs-vsctl add-port br0 veth0 && sudo ovs-vsctl add-port br1 veth1
#sudo ovs-vsctl del-port br0 eth1 #optional
#sudo ovs-vsctl add-port br1 eth1 #optional
sudo ovs-vsctl set-controller br1 tcp:10.0.0.1:6633