Openvswitch - Mise en route

Auteur : Vince Nadus
Date de publication : 9 juin 2021
linux cisco réseau openvswitch

Description du fichier :

1 seule carte réseau physique(enp1s0 –> vmbr0) avec deux cartes réseaux virtuelles (vmbr1 et vmbr2)

apt-get install openvswitch-switch

/etc/network/interfaces

auto lo
iface lo inet loopback

allow-vmbr0 eno1
iface eno1 inet manual
 ovs_type OVSPort
 ovs_bridge vmbr0

auto vmbr0
iface vmbr0 inet dhcp
address 192.168.50.189
netmask 255.255.255.0
gateway 192.168.50.1
ovs_type OVSBridge
ovs_ports eno1 vlan99 vlan100 vlan5

allow-vmbr0 vlan99
iface vlan99 inet dhcp
 address 10.168.50.189
 netmask 255.255.255.0
 gateway 10.168.50.1
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=99

allow-vmbr0 vlan100
iface vlan100 inet dhcp
 address 192.168.50.189
 netmask 255.255.255.0
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=100

allow-vmbr0 vlan5
iface vlan5 inet manual
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=5

Configuration OpenvSwitch pour aggregation de lien (Bond actif-backup)

Conf OVS

auto lo
iface lo inet loopback

auto enp3s0f0
iface enp3s0f0 inet manual

auto enps0f1
iface enp3s0f1 inet manual

allow-vmbr0 bond0
iface bond0 inet manual
 ovs_type OVSBond
 ovs_bridge vmbr0
 ovs_bonds enp3s0f0 enp3s0f1
 ovs_options bond_mode=active-backup

auto vmbr0
iface vmbr0 inet manual
 ovs_type OVSBridge
 ovs_ports bond0 vlan5 vlan99

 allow-vmbr0 vlan5
iface vlan5 inet manual
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=5

allow-vmbr0 vlan99
iface vlan99 inet static
 address X.X.X.X
 netmask 255.255.255.0
 gateway X.X.X.X
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=99

Conf Cisco

interface FastEthernet0/22
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 1,5,99,100
 switchport mode trunk
!
interface FastEthernet0/23
 description trunk vers openvswitch
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 1,5,99,100
 switchport mode trunk

Configuration OpenvSwitch pour aggregation de lien (Bond LACP balance-tcp)

Conf OVS

auto lo
iface lo inet loopback

auto enp3s0f0
iface enp3s0f0 inet manual

auto enps0f1
iface enp3s0f1 inet manual

allow-vmbr0 bond0
iface bond0 inet manual
 ovs_type OVSBond
 ovs_bridge vmbr0
 ovs_bonds enp3s0f0 enp3s0f1
 ovs_options bond_mode=balance-tcp lacp=active other_config:lacp-time=fast

auto vmbr0
iface vmbr0 inet manual
 ovs_type OVSBridge
 ovs_ports bond0 vlan5 vlan99

 allow-vmbr0 vlan5
iface vlan5 inet manual
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=5

allow-vmbr0 vlan99
iface vlan99 inet static
 address 10.168.50.197
 netmask 255.255.255.0
 gateway 10.168.50.1
 ovs_type OVSIntPort
 ovs_bridge vmbr0
 ovs_options tag=99

Conf Cisco

interface Port-channel1
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 5,95,99,100,102
 switchport mode trunk
!
interface FastEthernet0/11
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 5,95,99,100,102
 switchport mode trunk
 channel-protocol lacp
 channel-group 1 mode active
!
interface FastEthernet0/12
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 5,95,99,100,102
 switchport mode trunk
 channel-protocol lacp
 channel-group 1 mode active
!

Vérifier le status d’OVS

Visualiser les bond

ovs-appctl bond/list

Détail d’un bond

ovs-appctl bond/show bond0

Détail LACP d'un bond

ovs-appctl lacp/show bond0