What is Open vSwitch?
Open vSwitch, abbreviated OVS, is open source software, designed to be used as a virtual switch in virtualized server environments. It is responsible for forwarding traffic between different virtual machines (VMs) on the same physical host and also forwarding traffic between virtual machines and the physical network.
We install dependencies:
Bash
apt-get install build-essential module-assistant linux-headers-`uname -r` fakeroot gccWe install Open vSwitch
From repositories:
Bash
apt-get install openvswitch-common openvswitch-switchWe configure the database.
text
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschemaFrom source
We download, unzip and access the folder.
Bash
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz
tar xvf openvswitch-2.3.1.tar.gz
cd openvswitch-2.3.1We install Open vSwitch
Bash
./boot.sh
./configure –prefix=/usr –with-linux=/lib/modules/`uname -r`/build
make && make install
make modules_install
depmod -a
mkdir -p /usr/local/etc/openvswitchWe configure the database.
text
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
ovsdb-server -v –remote=punix:/usr/local/var/run/openvswitch/db.sock \
–remote=db:Open_vSwitch,Open_vSwitch,manager_options \
–private-key=db:Open_vSwitch,SSL,private_key \
–certificate=db:Open_vSwitch,SSL,certificate \
–pidfile –detach –log-fileWe start the service
Bash
root@docker:~# /etc/init.d/openvswitch-switch start
Starting ovsdb-server.
Configuring Open vSwitch system IDs.
Starting ovs-vswitchd.
Enabling remote OVSDB managers.We create a bridge interface br0
text
ovs-vsctl add-br br0We incorporate an ethernet port.
text
ovs-vsctl add-port br0 eth0We configure the br0 interface
text
auto br0
allow-ovs br0
iface br0 inet static
address 192.168.1.80
netmask 255.255.255.0
gateway 192.168.1.1
# bridge info
ovs_type OVSBridge
ovs_ports eth0
bridge-ports eth0
bridge-maxwait 1Regards, rokitoh
:wq!
Comments