switch access to trunk mode configuration

KayserFranz

Member
Nov 11, 2022
5
0
6
Hi all,

I'm no expert in this, so please bear with me.

I have external partner that is managing the switch configuration, and the four ports for bond0 is configured in access mode.
But to be able to get access to more VLAN's from my host, the ports should be configured in trunk mode.

So question is, will the bellow config on my Proxmox host allow me to access my host on IP 192.168.1.1?

auto bond0
iface bond0 inet manual
bond-slaves eno1 eno2 eno3 eno4
bond-miimon 100
bond-xmit-hash-policy layer2+3
bond-mode 802.3ad

auto vmbr0
iface vmbr0 inet manual
bridge-ports bond0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4092

auto vmbr0.3182
iface vmbr0.3182 inet static
address 192.168.1.1/27
gateway 192.168.1.30
 
Perfect thanks @spirit
So if I want to add an additional two VLAN's I guess config should look like this?

auto bond0
iface bond0 inet manual
bond-slaves eno1 eno2 eno3 eno4
bond-miimon 100
bond-xmit-hash-policy layer2+3
bond-mode 802.3ad

auto vmbr0
iface vmbr0 inet manual
bridge-ports bond0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4092

auto vmbr0.3182
iface vmbr0.3182 inet static
address 192.168.1.1/27
gateway 192.168.1.30

auto vmbr0.2308
iface vmbr0.2308 inet static
address 192.168.1.32/27
gateway 192.168.1.62

auto vmbr0.2195
iface vmbr0.2195 inet static
address 192.168.1.65/27
gateway 192.168.1.94
 
The vlan in /etc/network/interfaces are only for proxmox node management, not the vm.

(do you really need 3 ips in 3 vlans, in same subnet ?)

also you can't use multiple default gw.

Generally, you have differents vlans with different subnets, and 1 default gw on the main vlan (from which you access from outside)
 
  • Like
Reactions: KayserFranz
The vlan in /etc/network/interfaces are only for proxmox node management, not the vm.

(do you really need 3 ips in 3 vlans, in same subnet ?)

also you can't use multiple default gw.

Generally, you have differents vlans with different subnets, and 1 default gw on the main vlan (from which you access from outside)
@spirit thanks for your reply, I have an additional question :)

Ahh yes of course VLAN's should not have been in the config.
But I guess to configure a VM with a IP in VLAN2195 I guess the following should also be in the config?

auto vmbr0.2195
iface vmbr0.2195 inet static
address 192.168.1.65/27

Then I can configure a VM specify the VLAN and an IP within that subnet, and on the VM specify the Gateway for the subnet?

Regards
 
But I guess to configure a VM with a IP in VLAN2195 I guess the following should also be in the config?

auto vmbr0.2195
iface vmbr0.2195 inet static
address 192.168.1.65/27

Then I can configure a VM specify the VLAN and an IP within that subnet, and on the VM specify the Gateway for the subnet?
Those are just for the PVE host (for webUI, SSH and so on).
To set up a guest, set the IP and gateway inside the guestOS. To set the VLAN the VM should use, edit your VMs virtual NIC and set a "VLAN Tag" there.
 
  • Like
Reactions: KayserFranz
@Dunuin It's working like a charm. Thanks for your support :)

So it's only the configuration of the Proxmox host that is in the /etc/network/interfaces
I just need to add VLAN to the trunk ports and also add this VLAN in the VM config.
 
So it's only the configuration of the Proxmox host that is in the /etc/network/interfaces
Yes.

I just need to add VLAN to the trunk ports and also add this VLAN in the VM config.
There are two option.
A.) You either use multiple vlan-unaware bridges (one vlan interface + bridge bridged to the vlan interface), and then just add those virtual NICs to the bridge you want your VM to be part of a VLAN.
B.) You use a single vlan-aware bridge without VLAN interfaces and then directly set the "VLAN Tag" for each virtual NIC which then are all attached to the same vlan-aware bridge.

See here: https://pve.proxmox.com/wiki/Network_Configuration#sysadmin_network_vlan
 
Last edited:
  • Like
Reactions: KayserFranz
@Dunuin Thanks for your fast reply! :)

So I guess with the config I have here I'm working with option B?

auto bond0
iface bond0 inet manual
bond-slaves eno1 eno2 eno3 eno4
bond-miimon 100
bond-xmit-hash-policy layer2+3
bond-mode 802.3ad

auto vmbr0
iface vmbr0 inet manual
bridge-ports bond0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4092

auto vmbr0.3182
iface vmbr0.3182 inet static
address 10.10.10.2/27

gateway 10.10.10.1
 

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!