[SOLVED] VLAN - How to set VLAN ID for PVE host?

eduardoll

New Member
Feb 6, 2021
11
0
1
40
Hi!
I currently have the following config for Networks:

Code:
auto lo
iface lo inet loopback

iface enp3s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.10.20/24
        gateway 192.168.10.1
        bridge-ports enp3s0
        bridge-stp on
        bridge-fd 0
        bridge-vlan-aware yes
        bridge-vids 2-4094

If I set PVE Switch port as "trunk", VMs works successfuly in its desired VLANs, but I lose access to the PVE Server management gui.

What do I have to do to define VLAN ID for the PVE server itself?

Thanks in advance.
 
Is the 192.168.10.0/24 network general inside a VLAN or not?

Depending on your switch, you should be able to configure the port to have one network as untagged (usually the default VLAN 1) and then add all the VLAN tags that you need as tagged on that port. This way the PVE host will still stay in the default network and the VLAN tags for your VMs will be present on the switch side.
 
  • Like
Reactions: eduardoll
Is the 192.168.10.0/24 network general inside a VLAN or not?

Depending on your switch, you should be able to configure the port to have one network as untagged (usually the default VLAN 1) and then add all the VLAN tags that you need as tagged on that port. This way the PVE host will still stay in the default network and the VLAN tags for your VMs will be present on the switch side.
I have 2 vlans where I want to put my VMs
- Vlan 10 (192.168.10.0/24) is where I want to put PVE host and 1 VM
- Vlan 100 (192.168.100.0/24) is where I want to put another VM I have.

PVE Host can also stay in my local network (192.168.1.0/24) without Vlan. But I prefer it in Vlan 10

My switch is a unifi switch US-8-60W, configured as trunk ("All" vlans selected).

PVE server has only one network card.

Is there a place where I can set the PVE host Vlan Id?

Thanks
 
Remove the IP/gateway from vmbr0 and add something like this:
Code:
auto vmbr0.10
iface vmbr0.10 inet static
        address 192.168.10.20/24
        gateway 192.168.10.1
Then your PVE host should be using VLAN 10 with IP 168.168.10.20.
 
Last edited:
  • Like
Reactions: eduardoll
Remove the IP/gateway from vmbr0 and add something like this:
Code:
auto vmbr0.10
iface vmbr0.10 inet static
        address 192.168.10.20/24
        gateway 192.168.10.1
Then your PVE host should be using VLAN 10 with IP 168.168.10.20.

I tried the following config without success. Is that any additional step? Thanks
Code:
iface enp3s0 inet manual

auto vmbr0
iface vmbr0 inet static
#       address 192.168.10.20/24
#       gateway 192.168.10.1
        bridge-ports enp3s0
        bridge-stp on
        bridge-fd 0
        bridge-vlan-aware yes
        bridge-vids 2-4094

auto vmbr0.10
iface vmbr0.10 inet static
        address 192.168.10.20/24
        gateway 192.168.10.1
 
Looks fine. Except that it should be iface vmbr0 inet manual instead of iface vmbr0 inet static when you don't give that bridge an IP.
 
Last edited:
Looks fine. Except that it should be iface vmbr0 inet manual instead of iface vmbr0 inet static when you don't give that bridge an IP.
Thanks! So I decided to keep PVE host on VLAN 10. This is my interfaces settings
Code:
auto lo
iface lo inet loopback

iface enp3s0 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.10.20/24
        gateway 192.168.10.1
        bridge-ports enp3s0
        bridge-stp on
        bridge-fd 0
        bridge-vlan-aware yes
        bridge-vids 2-4094

I have 2 VMs for now:
1 - VM ID 101 - Need to run on VLAN 100
2 - VM ID 103 - Need to run on VLAN 10

For VM 103, that is in the same VLAN of the host, It is working out of the box (I didnt need to set VLAN id 10 in its setting, since this VLAN is configured as "default" on the unifi switch).
For VM 101 (that is the VM that I need to run on VLAN 100), ì'm passing the VLAN id 100 and it gets the right IP address and everything works well for ~30 min.

For a reason I cant understand, if i don`t turn on VM101, PVE host and VM 103 works flawlessly. If I turn VM 101 on, everything works ok and, and after a while, PVE host disconnects completely from the network. (I cant reach PVE host or any of the VMs from its IP addressess). I need to power cycle the host in order to recover remote access.

When PVE is disconnected from the network I can still login the host. So, PVE host is still running, but not connected to the network. This issue is only happening when I use VLANs.

Below are screenshots of my VLAN setting on Switch. I cant find any issue in these settings:
unifi-networks.png

unifi-profiles.png

Some strange errors are appearing on the host monitor, but I does not looks related to the VLAN issues:
PXL_20220113_201306106.MP.jpg
PXL_20220113_201430962.jpg

Do you have any suggestion where I can have a look to find any hint to fix this issue?

Thanks in advance!
 
Issue just happened. I noticed that if I unplug and plug in the lan cable, the PVE host will come back accessible. No need to restart.

Issue happened at 12h14. I unplugged and plugged network cable at 12h39

Nothing appeared in syslogs and dmesg
dmesg syslog.png

neither in unifi controller log

unifi.png
 

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!