Inicio Linux & Systems Networks & Infrastructure Cybersecurity Cloud & DevOps SIEM & Monitoring DFIR & Threat Intel Development & Other Todas las categorias Herramientas

Instalar y configurar Open vSwitch

Instalar y configurar Open vSwitch

Tabla de contenidos

¿Que es Open vSwitch?

Open vSwitch, abreviado OVS, es un software de código abierto, diseñado para ser utilizado como un switch virtual en entornos de servidores virtualizados. Es el encargado de reenviar el tráfico entre diferentes máquinas virtuales (VMs) en el mismo host físico y también reenviar el tráfico entre las máquinas virtuales y la red física.

Instalamos dependencias:

bash
apt-get install build-essential module-assistant  linux-headers-`uname -r` fakeroot gcc

 Instalamos  Open vSwitch

Desde repositorios:

bash
apt-get install openvswitch-common openvswitch-switch

Configuramos la base de datos.

text
ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

Desde source

Descargamos, descomprimimos y accedemos a la carpeta.

bash
wget http://openvswitch.org/releases/openvswitch-2.3.1.tar.gz

tar xvf openvswitch-2.3.1.tar.gz

cd openvswitch-2.3.1

Instalamos 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/openvswitch

Configuramos la base de datos.

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-file

Iniciamos el servicio

bash
root@docker:~# /etc/init.d/openvswitch-switch start

Starting ovsdb-server.

Configuring Open vSwitch system IDs.

Starting ovs-vswitchd.

Enabling remote OVSDB managers.

Creamos una interfaz bridge br0

text
ovs-vsctl add-br br0

Incorporamos a un puerto ethernet.

text
ovs-vsctl add-port br0 eth0

Configuramos la interfaz br0

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 1

Un saludo, rokitoh

:wq!

Comentarios