📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Proxmox VLAN Configuration: Linux Bridge Tagging, Management IP, and Virtual Machines

VirtualizationHowto14:37

Transcription

Are you new to Proxmox networking? Are you new to Proxmox VLAN configuration? Configuring that management IP to be on a specific VLAN? How do you set up the bridging in Proxmox? What about setting up VLANs for your virtual machines and their configuration?

Well, this is going to be a fun episode. We're going to look at all things Proxmox networking and see how we can easily configure Proxmox VLANs, management IP on specific VLANs, as well as virtual machine VLAN connectivity. So let's get started and dive right in.

Proxmox uses something called a Linux bridge. Now, the Linux bridge is just a logical construct in Proxmox that allows you to connect the physical network adapters into Proxmox, as well as allowing Proxmox itself to be able to understand things like VLANs. We're going to look at this default bridge, and I want to show you guys my Proxmox host and the out-of-the-box configuration that you will see when you install Proxmox.

So I'm logged into the Proxmox host. We've got our summary screen showing for the data center. I'm going to click the Proxmox host itself, and there is a Network menu option underneath the System menu. So if we click Network, we can see this default Linux bridge. And as you can see, by default, it's going to show the physical network adapters that you have installed on your Proxmox host, as well as this Linux bridge. And you will see the IP address as well that came configured out of the default installation. So if you've allowed DHCP to configure this IP or you assigned a static IP address, you're going to see that here.

If we double-click on the Linux Bridge, we can see the default name. We see that IP address and Gateway displayed here, and the bridge ports represent the physical adapter or adapters that back this particular Linux bridge. Now, the Linux Bridge that's installed by default with Proxmox is not VLAN aware, but don't worry. This is just a quick configuration in the default bridge that is installed by default. In fact, it's just a checkbox. Let's look at that.

I've got just a simple installation. I've got a single network adapter. Then we've also got the default Linux bridge, and this is always labeled this way: the vmbr0. Now, what I want to show you guys, if we go to Edit, we bring up the settings for the default bridge. Now, something that stands out when we're talking about VLANs is this VLAN aware option. It is unchecked, and that's a way that it will default when you come out of a fresh installation of Proxmox.

What we need to do is this simple checkbox, and we're telling Proxmox we want to make the default Linux Bridge VLAN aware, and then simply hit OK. You will notice in the output that it will perform the configuration. This file that you see in the output is the `/etc/network/interfaces` file. Before we check that box, this configuration did not exist. So if we would have opened that file beforehand, we wouldn't see the VLAN configuration. So after we check the box, we will see this configuration: `bridge-vlan-aware: yes`. The `bridge-vids` or VLAN IDs are set to 2 to 4,094, and that's roughly the full range of VLANs that can be configured.

So when we check that VLAN aware checkbox, it will essentially turn this bridge into a trunking bridge, meaning this bridge will pass traffic for essentially every VLAN 2 to 4,094. And we can adjust that as well, as we're going to mention, uh, in just a moment. What we need to do now is we need to apply configuration. Do you want to apply pending network changes? Yes. And we will see those changes applied, and we can go back into the Edit, and we will see VLAN aware is indeed checked.

So now we understand that once we make that bridge VLAN aware, the configuration in that `/etc/network/interfaces` file, it may be a familiar concept that that bridge is enabled, basically like a trunk port. We can specify specific VLANs on that Linux Bridge so that it filters all of the other VLANs, and that is arguably a more secure configuration. So let's see the configuration that we would change to specify specific VLANs on the Linux Bridge.

Okay, so I'm logged into an SSH session on the Proxmox host. So what I'm going to do is edit the file that we mentioned earlier. So I'm going to edit the `/etc/network/interfaces` file. We see the same output that we saw in the GUI of Proxmox in the web UI. Um, we can scroll down, and you notice the `vlan-ids` is set to 2 to 4,094. Now, let's say we wanted to specify specific VLANs. Well, we would do that this way. We could go in here and we can say `vlan 10`, `vlan 149`, `vlan 333`. And all we would need to do is save and exit out of that file. So now we've essentially restricted those VLANs to those specific VLAN IDs for traffic that's passed through the Linux bridge. And an easy way to instantiate that is just simply reboot the host.

Now, let's say that the IP address that you have configured when you install Proxmox is just untagged traffic. Now, let's say you don't want your IP address to reside on that untagged VLAN. So how do we do that? How do we peel off that management IP from the default configuration and actually specify a specific VLAN that we want to move that management IP to? Let's look at that next.

Moving that Management IP to a Specific VLAN.

Okay, so now I'm pivoting over to a physical Proxmox host. So it makes it a little bit easier. We don't have the abstraction of a virtual machine and some of that nested networking that we need to explain. So this is simply a physical Proxmox host that's plugged directly into the switch in the home lab here. And as you can see, this IP address is `10.3.3.3.4`. Now, that is an untagged IP address. So that's the primary VLAN on this switch. So the Proxmox host, out of the install, just simply picked up this `10.3.3.3.14` IP address. So what if I want that IP address, as we mentioned earlier, the management IP, to be on a different VLAN? Well, let's look and see how we can do that.

So I'm also SSH'd into this host, the `10.3.3.3.14` host, and let's look at that file that we mentioned earlier, `/etc/network/interfaces`. And we're going to see what looks to be very similar to the other file that we looked at earlier, except the IP address is different. So here is our IP address, our Gateway. We can see that we have enabled VLAN aware configuration on that default bridge, as we have the `bridge-vids` 2 through 4,094.

Now, let me show you guys the configuration that we need to enable if we want to swap the VLAN configuration for the management IP. And I've got this ready. I'm just going to paste it in for sake of time, and you guys will see what this configuration needs to look like. So now what I have done is we have essentially taken this stanza of configuration, along with the address as well as the Gateway, and we're creating a sub-interface on off of this bridge VLAN. So as we can see, we are prepending that with `vmbr0.149`. Now, the `149` is the VLAN ID. So `auto`, we're going to enable this to come up automatically, which we want. It's off of the bridge interface, it's VLAN 149, and as we can see, that certainly falls within the 2 through 4,094 VLANs. And then also, we've got the IP address that we want to configure: `10.1.1.149.14`, and then we have our Gateway.

So as we can see, this is very simple. Um, we are peeling that off, once again, from the default bridge ID that is sitting on the untagged VLAN traffic, and then we are creating this sub-interface that tells it that we want this sub-interface, and we want this particular IP address for management. So what I'm going to do, I'm going to exit out and save the changes, and we're going to reboot the host, and then we're going to see if it correctly assumes that IP address.

So what I did was launch a continuous ping to `10.1.1.149.14`, and as we can see, it went from destination host unreachable to it is actually pinging now. And there we go, we've got access to `10.1.1.149.14`, the same physical host that we changed the IP address on. So now, if we click on the host, we go to Network, we're going to see that we've got that sub-bridge interface. So it is a child interface, if you will, off of the parent Linux bridge, and the type that it creates is a Linux VLAN. So Linux VLAN. And here we see our new IP address that we assigned through the network interfaces file. We can double-click into it as well, and we can see this in the GUI as well. So you can see the IP address, the Gateway, and we've got the VLAN tag. It's and it's grayed out since it knows by the name that this is VLAN 149.

I want to make mention of a couple of things that you want to do that are remnants of the old IP address once you move that IP address to a specific VLAN and reconfigure for this new IP address. Let's see how to do that.

Now that I am remoted into the new host IP address `10.1.1.149.14`, I'm going to edit the host file, and you can see in the host file that by default, when you install the Proxmox host, it's going to put that original IP address into your host file. So I'm going to back out the old IP address and add in the new IP address of the Proxmox host. Now I'm just simply going to save and close that.

The other area that you want to take a look at is DNS. So if you do have a DNS zone that you have configured your Proxmox host to resolve to a specific IP, make sure you update that DNS zone, as well as any reverse DNS zones that you have in place, just to make everything flow through with the management IP address change.

So now that we have our Proxmox host configured for VLANs, we've taken advantage of that with the management IP, how do we enable VLANs for our virtual machines? Well, actually, that is very simple. It's actually just a field in the VLAN configuration for that particular virtual machine.

For configuring VLANs for virtual machines running on our Proxmox host, where we now have VLANs enabled. So let's expand our host. And first off, I want to show you guys an existing virtual machine. Let's say you already had virtual machines running and you want to uh, retro-add that configuration to an existing virtual machine. Well, just simply click on the virtual machine, and then we're going to go to Hardware, because we're going to edit the configuration for the network adapter. Double-click on Network Device, and you can see that, of course, we've got our VM Bridge configured. And remember that we have that configuration that essentially sets that bridge as a trunk port. So here, we simply just enter the VLAN tag information and click OK. Simple as that, and you can see the tag information is now added to our configuration that's displaying in the web UI.

Now, it's very similar if we go to create a virtual machine. I'm just going to uh, name this `testvm1`. Going to click through the wizard, select our ISO, next. Let's get over to Network, and we have basically the same configuration screen that we had when we retro-added that configuration. We've got the default bridge selected, and here we can assign whichever VLAN tag that we want that we have configured, of course, on the bridge and our physical switch port that it uplinks the Proxmox host. And simply click next and finish. And as we can see here, we can look at the network device, see that VLAN tag as it is in the configuration for our network adapter.

Well, there you go, guys. Proxmox VLAN configuration. You guys can see that it's not too difficult to establish some basic VLAN connectivity on a Proxmox VE host. Well, I am Brandon Lee. Please do like this video, subscribe to the channel, check out the VHT forums that I have spun up on virtualizationhow2.com, where you can get answers to questions about Proxmox, ESXi, home labs, and many other subjects. And I will see you guys on the next video. Oh.