[SOLVED] Proxmox VLAN config with 2 VLAN and 1 with DHCP

John4887

New Member
May 31, 2022
3
1
3
Hello everybody and merry Christmas!

I have a question regarding my Proxmox new setup and I struggle to configure VLANs.

On my pve, I have two NICs configured like this:

iface enp1s0 inet manual

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

auto vmbr0.10
iface vmbr0.10 inet static
address 192.168.48.6/24
gateway 192.168.48.254

auto vmbr0.30
iface vmbr0.30 inet dhcp

iface enp2s0 inet manual

auto vmbr1
iface vmbr1 inet manual
bridge-ports enp2s0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094

auto vmbr1.10
iface vmbr1.10 inet static
address 192.168.48.7/24
gateway 192.168.48.254

auto vmbr1.30
iface vmbr1.30 inet dhcp

enp1s0 is plugged on the port 3 on my switch which is tagged on VLAN 10 and 30, I have set the PVID on the port to 10 (without this, I just can't get a connection on the Proxmox interface)
enp2s0 is plugged on the port 4 on my switch which is also tagged on VLAN 10 and 30 with the PVID 10.

VLAN 30 is the VLAN with DHCP.

When I create a VM, I put the VM on the vmbr0 or 1, if I tag this VM 30 and I can't get any IP from DHCP.
If I remove the tag 30 on the VM, same result.

I can see the DHCP discover/offer for the VM on the DHCP logs but nothing happens.

My question is how to get multiple VLAN working for a VM and also, how to get the VLAN with DHCP working?

Thank you very much for your help!

John
 
many ways to go about this, BTW it appears you want redundancy so if your switch can handle it consider creating an LACP bond at switch port 3/4 and on proxmox host ports enp1s0/enp2s0 then use that bond# in vmbr0 making your /etc/network/interfaces file simpler (no need for any vmbr1 then). But following your current convention:

1. No need for the redundant dual listing of gateway 192.168.48.254. Also should not give proxmox host 2 IP's in the same subnet. Pick auto vmbr0.10 or auto vmbr1.10 and erase the entire other sect auto vmbr#.10 section including address and gateway lines.
2. No need for either auto vmbr0.30 and auto vmbr1.30 DHCP listing sections at this level. They only give Proxmox host another 2 DHCP adresses in the vlan 30 Subnet. When using vmbr0/vmbr1 in VM/LXC networks, vmbr0.30/vmbr1.30 serve no real purpose for VM/LXC getting dhcp in vlan30.
3. Continue using Vlan aware vmbr0 or vmbr1 for your vm/LXC and specify the vlan for them to use at the vm/LXC network interface level not the 'etc/network/interfaces level.
 
Last edited:
  • Like
Reactions: John4887
Hello vesalius and thank you very much for your answer!

My switch is LACP ready, I think this is a very good option and way to go but for the moment, as I don't totally understand everything on vmbr, I'm not ready for bound I think.

I simplified my /etc/network/interfaces following your tips and this is what I have now:

auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet manual

auto enp2s0
iface enp2s0 inet manual

auto vmbr0
iface vmbr0 inet static
bridge-ports enp1s0 enp2s0
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094

auto vmbr0.10
iface vmbr0.10 inet static
address 192.168.48.6/24
gateway 192.168.48.254

But I continue to not get IP from the DHCP for my test VM. In the firewall logs, the situation is always the same:

2022:12:25-20:31:06 fwgc01 dhcpd: DHCPDISCOVER from f2:a1:02:5c:09:fb via eth0.30
2022:12:25-20:31:06 fwgc01 dhcpd: DHCPOFFER on 192.168.50.3 to f2:a1:02:5c:09:fb via eth0.30

f2:a1:02:5c:09:fb totally matches the mac address of my VM. So Proxmox is able to discuss with the DHCP which discover the VM and offers an IP but nothing else. Proxmox is also able to ping the DHCP gateway (192.168.50.254) without any issue. There is something missing here but I can't get where.
 
Change the lines
Code:
iface vmbr0 inet static
bridge-ports enp1s0 enp2s0

to
Code:
iface vmbr0 inet manual
bridge-ports enp1s0

In the VMs network configuration set Bridge=vmbr0 and VLAN Tag=30

On the switch port connected to enp1s0 make sure that only tagged traffic is sent.
 
  • Like
Reactions: John4887
Hi mjtbrady, many thanks for your answer!

I gave your configuration proposal a try and it seems to work fine.

I will see to do better with a bond and LACP like vesalius explain now that I understand the bridge better.

Problem solved, thank you so much to both of you! I've learn a lot in a small time.
 
  • Like
Reactions: vesalius

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!