0

As per the Title really. I can't work out if there's a way to do this or not. The only mention of ports in the docs are "patch ports" as pairs of ports. The example shows the use of these patch ports, but it's still not clear at all if you can 'define' these ports in a way that can receive configuration on them.

Basically trying to create the equivalent configuration from Proxmox Open vSwitch, Example 3:

# Loopback interface
auto lo
iface lo inet loopback

Bond eth0 and eth1 together

allow-vmbr0 bond0 iface bond0 inet manual ovs_bridge vmbr0 ovs_type OVSBond ovs_bonds eth0 eth1 ovs_options bond_mode=balance-slb vlan_mode=native-untagged

Bridge for our bond and vlan virtual interfaces (our VMs will

also attach to this bridge)

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

Virtual interface to take advantage of originally untagged traffic

allow-vmbr0 vlan1 iface vlan1 inet static ovs_type OVSIntPort ovs_bridge vmbr0 ovs_options vlan_mode=access address 192.168.3.5 netmask 255.255.255.0 gateway 192.168.3.254

I can achieve the vmbr0 and bond0 interfaces with the following netplan config, but don't know how to create the internal port (named vlan1).

---
network:
  version: 2

ethernets: eth0: {} eth1: {}

bonds: bond0: interfaces: - eth0 - eth1 openvswitch: {}

bridges: vmbr0: interfaces: - bond0 openvswitch: {}

I am aware I can add layer 3 configuration directly to vmbr0, but I believe I need an internal port as I want this interface to handle VLANs in the same way other ports for containers/VMs will. Answers explaining how this assumption is wrong also appreciated!

I am also constrained to using Open vSwitch as libvirt doesn't support "standard linux bridges".

muru
  • 207,970

2 Answers2

1

Netplan does not currently support to explicitly define arbitrary OVS internal ports (as of v0.102).

What you can do, though, is defining a VLAN on a given OVS bridge like this:

  vlans:
    #implicitly handled by OVS because of its link
    vlan1:
      id: 100
      link: vmbr0

This will create a "type=internal" Port/Interface for you on the OVS bridge defined by the "link" setting, as can be seen in this test scenario: https://github.com/canonical/netplan/blob/master/tests/integration/ovs.py#L184 That port can then receive arbitrary configuration (via netplan or ovs-vsctl).

Slyon
  • 462
0

I came accross the same issue, base on @Lukas Maerdian suggestion and bug report here, here is the work around i manage to get it working

---
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0: {}
    eth1: {}
  bonds:
    bond0:
      interfaces:
        - eth0
        - eth1
      parameters:
        mode: balance-slb
      # by default the vlan is already untagged, no extra option needed here.
      openvswitch: {}
  bridges:
    vmbr0:
      interfaces:
        - bond0
      openvswitch: {}
  vlans:
    #implicitly handled by OVS because of its link
    # For Untag VLAN
    vlan1:
      id: 0
      link: vmbr0
      addresses: [192.168.3.5/24]
      gateway4: 192.168.3.254
      openvswitch: {}
    # For VLAN 10
    vm10:
      id: 10
      link: vmbr0
      openvswitch: {}

Also notice the the ordering of the vlans, it need to be at the last step according to that bug report.

Puthi
  • 1
  • 1