Proxmox VE with Open vSwitch

pve_and_ovs

By default, Proxmox networking uses the Linux bridge. There is no issue with the Linux bridges and it actually works really well. I have been using my PVE for two years now with Linux bridges. I recently switched to OVS for several reasons.

  • OVS can be configured as layer 2 or layer 3 bridges. Linux bridge, as far as I know, is just layer 2
  • I want to simplify my bridge setup. With OVS, I only have one bridge and use the VLAN tag. With Linux bridge, I would have one bridge per VLAN
  • OVS supports more protocols such as VxLAN, GRE, STT, LLDP, etc. Linux bridge, on the other hand, does support some protocols, but not as much as OVS
  • As a network guy and in my personal opinion, I think, OVS has a cleaner logic than the Linux bridge

Figure 1 shows the Network settings when creating a VM.

Figure 1

Somehow the Open vSwitch is not installed by default at least from Proxmox version 6 and below. I kind of hope it would come with it already. To install the Open vSwitch, use the web UI shell or SSH into the Proxmox server. In the web UI, there are a couple of ways to get to the shell. See Figure 2 as a reference.

  • Click on the PVE node then click on the Shell button on the upper right corner right below the Create VM button
  • navigate to PVE node > Shell
Figure 2

If we don’t install the openvswitch-switch, the system will get an error message Open VSwitch is not installed (need package 'openvswitch-switch') (500). Therefore, once access to the shell has been established, enter the command below to install Open vSwitch:

apt install -y openvswitch-switch

Don’t forget to make a backup of the current interfaces just in case something goes wrong. While you are in the shell, enter the command below to backup the original config file.

cp /etc/network/interfaces /etc/network/interfaces.bak

After installing the Open vSwitch and making a backup of the /etc/network/interfaces, we would need to delete the default Linux bridge. To do so, navigate to :

  • Data Center > PVE Node > System > Network
    1. Select the vmbr0
    2. Click on Remove
Figure 3

Once the Linux bridge vmbr0 has been removed, we need to create OVS bridge

  • Data Center > PVE Node > System > Network
    1. Click on Create
    2. Select the OVS Bridge
      1. Enter the physical interface name in the Bridge ports field
      2. Click Create
Figure 4

After creating a bridge, we would need to create an in-band interface to access the Proxmox VE server. We could have also done this while creating the OVS bridge by filling out the IPv4/CIDR and Gateway (IPv4). However, I wanted to make my config clean for me, so in my case, I am going to create an OVS IntPort for in-band management.

  • Data Center > PVE Node > System > Network
    1. Click on Create
    2. Select OVS IntPort
      1. Enter a name for this inband IntPort in the Name field
      2. Enter the IP address and prefix in the IPv4/CIDR field
      3. Enter the gateway address in the Gateway field
      4. Click on Create
Figure 5

For VLAN tags, create another OVS IntPort for each VLAN ID.

  • Data Center > PVE Node > System > Network
    1. Click on Create
    2. Select OVS IntPort
      1. Enter a name for this IntPort in the Name field
      2. Enter the VLAN ID in the VLAN Tag field
      3. Click on Create
  • Repeat steps 1 through 2.3 for each VLAN
Figure 6

In addition, every OVS IntPort we create will be automatically be added to the OVS Bridge. Once done, reboot the Proxmox server for the network changes to become active. Now, that all the VLAN tags are active, assigning the VM or LXC to specific VLAN can be easily done by just specifying the VLAN ID in the Networking tab in VM or LXC during their creation as shown in Figure 1

When creating a VM or LXC, entering a VLAN ID in the VLAN Tag field the OVS will behave like an access port. Leaving the VLAN Tag field empty, OVS will behave like a trunk port; therefore, the guest VM can be configured VLAN tagging within the VM itself. In addition to leaving the VLAN Tag empty, if the guest VM is not tagging its interface, it would use the untagged or native VLAN.

I hope you will this helpful. Cheers!

Leave a Comment

Your email address will not be published. Required fields are marked *

10 × 1 =

WordPress Appliance - Powered by TurnKey Linux