Score:0

Netplan config to enable KVM guest to access multiple VLANs

aw flag

I am trying to duplicate a network setup that I currently use in VMware ESXi 6.5 in which I am able to create guest VMs, linux or Windows, and assign several virtual NICs from a VLAN trunk to each guest VM.

When I try to configure this scenario in Ubuntu 20.04.1 LTS using netplan with renderer: networkd I can successfully assign only 1 VLAN to any guest linux VM. The guest is Ubuntu 20.04.1 LTS. When I create a second NIC in virt.manager, the NIC is created, and the second VLAN is identified, but it never connects with the pfSense DHCP server to receive an IP address.

I modeled my netplan yaml after Jarad Downing's explanation from June 5, 2019. Need to add Vlans to my NetPlan Config with KVM Bridge and bonding

The Ubuntu host has 3 NICs.

eno1 is used for br0 to provide access from the LAN to the host and any guests that need LAN access. It works fine.

enp2s0fo is used as direct access to the iSCSI host, which is a QNAP host running iSCSI and nfs. All of the guest VMs are stored there, as well as the ISOs to build new VMs.

enp2s0f1 is being used to connect to the VLAN trunk from the Ubiquiti US-24 switch. There are 5 VLANs of interest on the trunk and sometimes I want to assign more than one VLAN to a guest VM that I spin up using QEMU/KVM. I am using the graphic Virtual Machine Manager to make and configure guest VMs.

Below is the yaml that I am using. I am new at this, so please give me links to examples, or give me examples that you know work from your own experience.

Thank you.

root@atlas:/etc/netplan# cat 02-networkd-vlan.yaml

network:
version: 2
renderer: networkd
ethernets:
enp2s0f1:
addresses: []
dhcp4: false
dhcp6: false
bridges:
br1:
interfaces: [ enp2s0f1 ]
dhcp4: false
dhcp6: false
br125:
interfaces: [ vlan.125 ]
dhcp4: false
dhcp6: false
addresses: []
br135:
interfaces: [ vlan.135 ]
dhcp4: false
dhcp6: false
addresses: []
br140:
interfaces: [ vlan.140 ]
dhcp4: false
dhcp6: false
addresses: []
br172:
interfaces: [ vlan.172 ]
dhcp4: false
dhcp6: false
addresses: []
br210:
interfaces: [ vlan.210 ]
dhcp4: false
dhcp6: false
addresses: []
vlans:
vlan.125:
id: 125
link: enp2s0f1
dhcp4: false
dhcp6: false
vlan.135:
id: 135
link: enp2s0f1
dhcp4: false
dhcp6: false
vlan.140:
id: 140
link: enp2s0f1
dhcp4: false
dhcp6: false
vlan.172:
id: 172
link: enp2s0f1
dhcp4: false
dhcp6: false
vlan.210:
id: 210
link: enp2s0f1
dhcp4: false
dhcp6: false
root@atlas:/etc/netplan#

GregBinSD avatar
aw flag
Obviously, I don't know how to paste my yaml code into the forum editor. Is it possible to just paste it in, or do I have to reformat it following some arcane rules? Sorry...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.