Allow KVM Guest to assign own vlans

marotori

Member
Jun 17, 2009
161
1
16
Hi All

I am working on a solution where it would be advantages to allow a guest machine to have the ability to assign its own vlans.

Essentially I will have a vyos/vyatta box running as a virtual router. Ideally the virtual router will be able to setup a new vlan on the fly.

So I guess what I am after is some sort of guidance on how if possible you can pass raw traffic to a vm, then allow the guest to assign its own vlans.

Any ideas?

Rob
 
Ok...

So what you are saying is that if I take a virtual server - and internally in the guest assign a: eth0.10 device.

The eth0.10 will magically pass through vmbr0 on the host - and see the network?

I was under the impression that the bridge would drop vlan traffic?
 
I think that what you are referring too is the method by which you 'hot plug' an ethernet device.

This is not what I am after.

Please re-check the original post I made.
 
But you can do that inside the guest. Unless you assigned a tag to the guest's interface via the GUI, or assigned 'trunks' via the commandline / config files, or have some other special filter in between.
 
But you can do that inside the guest. Unless you assigned a tag to the guest's interface via the GUI, or assigned 'trunks' via the commandline / config files, or have some other special filter in between.

Ok...

So on my default setup I have the following in the interfaces file:

---
auto vmbr0
iface vmbr0 inet static
address 192.168.21.100
netmask 255.255.255.0
gateway 192.168.21.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
---

So what we are saying is that if I being the virtual server too vmbr0 as eth1

I should be able to see eth1.10 / eth1.10 with no further setup from within the vm?

Rob
 
Are you expecting to see 'eth1.10' on the *host*? Then no. The host doesn't care what the guest does. And why would it, after all it wouldn't know what to do with it either.
The host will simply bridge the network packets to the physical interface. If you want to listen to them you can create a vmbr0.10.
 
This is essentially what I wanted to know.

I was hoping for a way to allow the guest machine to determine its own vlan connectivity.

This is advantages when running a virtual router.
 
Ok...

I have found a solution using this:

https://travelingpacket.com/2015/02/03/hot-add-nic-into-vyatta-no-reboot-required/

Essentially I need to force a rescan of the pci bus from the vyos node.
---
configure
sudo chmod 0777 /sys/bus/pci/rescan
sudo echo 1 > /sys/bus/pci/rescan
sudo chmod 0220 /sys/bus/pci/rescan
---

This then allows the vyos box to detect the new card and continue working.

Downside is loads of ethernet cards to be added to the system - 1 per vlan.

Is there any limit on the number of cards that can be assigned to a guest?

Rob
 

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!