What is the easy way to move from Linux Bridge to ovs

kcallis

Active Member
Apr 5, 2018
48
2
28
56
I have been running the default linux bridge, but would like to switch over to ovs. I have apt-get openvswitch and now to need to understand how to install?
 
Herewith before and after network configuration files that may help you.

eth0 and eth1 are untagged members of VLAN 1 (Management), eth2 and eth3 are untagged members of VLAN 33 (Ceph).

NB: VM's network configuration should generally be unchanged, except that you would leave the tag undefined when wanting to attach it to vmbr0's network (VLAN 1 in the example above), when using the Linux Bridge. When using OVS you must always define the VLAN ID, so you would set the tag as 1, when converting.

PS: We use active/backup bond interfaces and you may need to reduce the MTU from 9216 to 9000, if you have Dell servers or other NICs. You can test with 'ifconfig eth2 mtu 9216' to find the largest accepted value.


/etc/network/interfaces (Linux Bridge):
Code:
auto lo
iface lo inet loopback

auto bond0
iface bond0 inet manual
        slaves eth0,eth1
        bond_miimon 100
        bond_mode active-backup
        mtu 9216

auto bond1
iface bond1 inet static
        address 10.254.1.3
        netmask  255.255.255.0
        slaves eth2,eth3
        bond_miimon 100
        bond_mode active-backup
        mtu 9216

auto eth0
iface eth0 inet manual
        bond-master bond0
        bond-primary eth0
        mtu 9216

auto eth1
iface eth1 inet manual
        bond-master bond0
        mtu 9216

auto eth2
iface eth2 inet manual
        bond-master bond1
        mtu 9216

auto eth3
iface eth3 inet manual
        bond-master bond1
        bond-primary eth3
        mtu 9216

auto vmbr0
iface vmbr0 inet static
        address 198.19.17.67
        netmask 255.255.255.224
        gateway 198.19.17.65
        bridge_ports bond0
        bridge_stp off
        bridge_fd 0
        mtu 9216

/etc/network/interfaces (open v switch):
Code:
auto lo
iface lo inet loopback

allow-vmbr0 bond0
iface bond0 inet manual
        ovs_bridge vmbr0
        ovs_type OVSBond
        ovs_bonds eth0 eth1
        pre-up ( ifconfig eth0 mtu 9216 && ifconfig eth1 mtu 9216 )
        ovs_options bond_mode=active-backup tag=1 vlan_mode=native-untagged
        mtu 9216

auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan1
        mtu 9216

allow-vmbr0 vlan1
iface vlan1 inet static
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options tag=1
        ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
        address 198.19.17.67
        netmask 255.255.255.224
        gateway 198.19.17.65
        mtu 1500


allow-vmbr1 bond1
iface bond1 inet manual
        ovs_bridge vmbr1
        ovs_type OVSBond
        ovs_bonds eth2 eth3
        pre-up ( ifconfig eth2 mtu 9216 && ifconfig eth3 mtu 9216 )
        ovs_options bond_mode=active-backup tag=33 vlan_mode=native-untagged
        mtu 9216

auto vmbr1
allow-ovs vmbr1
iface vmbr1 inet manual
        ovs_type OVSBridge
        ovs_ports bond1 vlan33
        mtu 9216

allow-vmbr1 vlan33
iface vlan33 inet static
        ovs_type OVSIntPort
        ovs_bridge vmbr1
        ovs_options tag=33
        ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
        address 10.254.1.3
        netmask  255.255.255.0
        mtu 9216
 
Herewith another simpler example where eth0 and eth1 are LACP members and the LAG is an untagged member of VLAN 1 with other VLANs trunked through:

/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

allow-vmbr0 bond0
iface bond0 inet manual
        ovs_bridge vmbr0
        ovs_type OVSBond
        ovs_bonds eth0 eth1
        pre-up ( ifconfig eth0 mtu 9000 && ifconfig eth1 mtu 9000 )
        ovs_options bond_mode=balance-tcp lacp=active other_config:lacp-time=fast tag=1 vlan_mo
de=native-untagged
        mtu 9000

auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan1
        mtu 9000

allow-vmbr0 vlan1
iface vlan1 inet static
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options tag=1
        ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
        address 192.168.1.26
        netmask 255.255.255.0
        gateway 192.168.1.1
        mtu 1500

auto eth2
iface eth2 inet manual

auto eth3
iface eth3 inet manual
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!