Sei sulla pagina 1di 4

blo g.phe no barbit al.

inf o

http://blo g.pheno barbital.info /2013/07/debian-co nfiguracio n-o penvswitch/

[openvswitch] Configuracin rpida en Debian GNU/Linux

Openvswitch, la inf raestructura de switch virtual, ahora est estable en Debian Wheezy, y como indiqu en el artculo anterior sobre Xen XCP, ahora openvswitch es la conf iguracin de red por def ecto para Xen XCP-XAPI en Debian, por ello ac les comento una gua rpida de conf iguracin|migracin a openvswitch.

Pasos previos: si se cuenta con un bridge:


Si contamos con un bridge (construdo por bridge-utils) debemos desactivarlo: Shell 1 if down br0

Y eliminarlo: Shell 1 brctl delbr br0

Y remover el mdulo bridge: Shell 1 modprobe -r bridge

Ahora, procedemos a instalar openvswitch.

Instalacin de openvswitch
- instalamos los paquetes principales: Shell 1 aptitude install openvswitch-switch openvswitch-common

Luego, el mdulo del kernel: Shell 1 aptitude install openvswitch-datapath-dkms

Y cargamos el mdulo: Shell 1 modprobe openvswitch_mod

Conf iguracin de openvswitch


Aunque el instalador de openvswitch para Debian crea la base de datos de OVS, con este comando podemos re-crearla: Shell 1 ovsdb-tool create /var/lib/openvswitch/conf .db /usr/share/openvswitch/vswitch.ovsschema

- Reiniciamos OVS: Shell 1 /etc/init.d/openvswitch-switch restart

[ ok ] ovs-brcompatd is not running. [ ok ] ovs-vswitchd is not running. [ ok ] ovsdb-server is not running. [ ok ] Starting ovsdb-server. [ ok ] Configuring Open vSwitch system IDs. [ ok ] Starting ovs-vswitchd. - Inicializamos por primera vez el controlador de OVS: Shell 1 ovs-vsctl --no-wait init

- Y creamos nuestro primer bridge: Shell

ovs-vsctl add-br br0

Y le incorporamos un puerto (la eth0): Shell 1 ovs-vsctl add-port br0 eth0

Si consultamos, el bridge se ve as: Shell 1 ovs-vsctl show

17b4cffb-bac9-46e6-ade6-d86367fcc885 Bridge br0 Port br0 Interface br0 type: internal Port eth0 Interface eth0 ovs_version: 1.4.2 Y conf iguramos (a la manera usual) Shell 1 if up br0

Waiting for br0 to get ready (MAXWAIT is 1 seconds) De esta manera, el bridge OVS es tambin observado (y gestionado) por bridge-tools: Shell 1 brctl show name bridge id 0000.f0def1919e43 STP no enabled interfaces eth0

bridge br0

Y listo!, pueden consultar la tabla del bridge con: Shell 1 port 0 ovs-appctl f db/show br0 VLAN 0 MAC f 0:de:f 1:91:9e:43 Age 50

Nota: Si se va a usar KVM+libvirt es recomendable instalar openvswitch-brcompat, sin embargo, si se va a usar Xen Xen-XCP, usaremos openvswitch de manera nativa. Nota 2: en la ltima versin (no est en Wheezy, pero si en Ubuntu 12.10) de libvirt, ya se cuenta con soporte para openvswitch, por lo que el paquete brcompat es innecesario.

Conclusiones
Openvswitch nos permite construir VLANs, conectar un puerto a openf low, incluso port-mirror o GREtunnels, es la inf raestructura de red por def ecto de OpenStack, OpenNebula, Proxmox-VE y otra serie de plataf ormas de virtualizacin; asi que veremos muchos ms artculos como este por aqu. Happy Hacking! Categora: Blogueando!, GNU/Linux, Los trucos de la abuela!, Planetalinux, Sof tware Libre Etiquetas: bridge, Debian, linux, openvswitch, ovs, virtual switch

Potrebbero piacerti anche