VLAN aware example

Machi

New Member
Aug 2, 2018
14
1
1
50
Hello,

As I look VLAN aware like using single bridge to carry multi vlan together instead of create multi bridge with multi interface.

However, I could not find any example where how to implement with this method.

Does anyone can advise?

Thanks!
 
This can be done using Open vSwitch.

For example, below is my /etc/network/interfaces, which sets up two NICs as a LACP bond (bond0) that serves as a VLAN trunk. A single bridge (vmbr0) and single interface (vlan99) (solely for management of the host) are joined to the bond. All VMs and containers have their network interface connected to the bridge, and the desired VLAN tag is set at the guest's interface.

Code:
auto lo
iface lo inet loopback

iface eno1 inet manual
iface eno2 inet manual

auto vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan99

allow-vmbr0 bond0
iface bond0 inet manual
        ovs_bonds eno1 eno2
        ovs_type OVSBond
        ovs_bridge vmbr0
        ovs_options lacp=active bond_mode=balance-slb

allow-vmbr0 vlan99
iface vlan99 inet static
        address  192.168.99.10
        netmask  255.255.255.0
        gateway  192.168.99.1
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options tag=99
        #management vlan


If you're only working with a single NIC it should be simple enough to delete the bond info in the above and substitute in the NIC's ID instead.
 
Thanks, previously I am looking for traditional bridge vlan aware method. Open vSwitch method which I also in my plan to study later on.

> All VMs and containers have their network interface connected to the bridge, and the desired VLAN tag is set at the guest's interface.
I would like to know more details under VMs.

Which Network interface I should binding to according your example?
When adding Network interface for VM under GUI. Should I still identify VLAN Tag 99 as well?
Did you have example for traditional bridge vlan aware method?

Thanks!
 
Thanks, previously I am looking for traditional bridge vlan aware method. Open vSwitch method which I also in my plan to study later on.

> All VMs and containers have their network interface connected to the bridge, and the desired VLAN tag is set at the guest's interface.
I would like to know more details under VMs.

Which Network interface I should binding to according your example?
When adding Network interface for VM under GUI. Should I still identify VLAN Tag 99 as well?
Did you have example for traditional bridge vlan aware method?

Thanks!


The network interface you bind the bridge to depends on your hardware/setup. Mine just happens to be two NICs bonded via LACP.

Use whatever VLAN is appropriate for your network setup and the particular guest. Same goes for your management interface. The host's network connection serves as a trunk, so it should allow any VLAN properly configured on the switch it's connected to. VLAN99 just happens to be my management network. Most of my guest VMs and containers are on other VLANs.

Sorry, I don't have any other examples. I don't recall exactly why I went with Open vSwitch over the basic/standard config, but it does exactly what I wanted so I stuck with it.
 

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!