Tagged vlan for motherboard ethernet port and ESXi

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

vcth4nh

New Member
Mar 7, 2024
11
1
3
Router switch: Edgerouter X SFP
Mobo: Supermicro x10 DAi
Os: ESXi

My ESXi server will run 2 types of VM: VM for public and VM for private
Currently all my devices are on the same vlan. I want to separate a vlan 30 for the public vm
Can I achieve this with a single eth port on my mobo?

I've set up something like this:
1711352202361.png
1711352452970.png
1711352378760.png

But the VM on vlan 30 doesn't receive ip from DHCP server
 

nabsltd

Well-Known Member
Jan 26, 2022
433
294
63
Can I achieve this with a single eth port on my mobo?
Yes, you can. The easiest way is to use a different vSwitch for each VLAN, and connect both to the same physical adapter. This allows your VMs to not have to know about VLANs, and the vSwitch will tag the packets sent to the physical adapter, and strip tags that come into each vSwitch from the physical adapter.

This means the NIC must connect to a "trunk" port on the physical switch. Configure the port to only accept tagged packets and to tag packets sent out.

Then, make sure you have a DHCP server on VLAN 30 that serves up the correct IP address range for that VLAN.
 

JJ27

Member
Oct 24, 2018
37
17
8
The way that I usually do things with ESXi is to configure the port as Trunk in the switch passing a VLAN range (or VLAN values), and then on ESXi, configure portgroups per VLAN, so then I can connect VMs to portgroups with one vNIC for each needed VLAN
 

vcth4nh

New Member
Mar 7, 2024
11
1
3
configure the port as Trunk in the switch passing a VLAN range (or VLAN values), and then on ESXi, configure portgroups per VLAN, so then I can connect VMs to portgroups with one vNIC for each needed VLAN
Seems like I did the same thing (?), can you check my screenshot?
I don't know if I misconfig something in the switch or the ESXi
 

JJ27

Member
Oct 24, 2018
37
17
8
Not really versed on ubiquity config, but on ESX you should have (if you use the default vswitch) the default management network PG with the vmkernel port connected and another port group with the VLAN 30 in your case which seems correctly configured.

If the ubiquity switch has L3 capabilities (which the name implies) and you set up a Virtual interface in there, try setting up a VM with static ip and see if you can ping the interface.
 

nabsltd

Well-Known Member
Jan 26, 2022
433
294
63
Do you mean this? ESXi doesn't allow me to choose the vmnic0, which is used for switch0
Now that I think about it, I don't know if what I described is available in plain ESXi. I use a Distributed Virtual Switch controlled by vCenter, and I can attach as many virtual switches to a single uplink as I need.

The portgroup method is the way to go in your case, but I just never bothered with it because a new vSwitch is just as easy to create.
 

vcth4nh

New Member
Mar 7, 2024
11
1
3
Now that I think about it, I don't know if what I described is available in plain ESXi. I use a Distributed Virtual Switch controlled by vCenter, and I can attach as many virtual switches to a single uplink as I need.

The portgroup method is the way to go in your case, but I just never bothered with it because a new vSwitch is just as easy to create.
Interesting, I’ve nerver heard of Distributed Virtual Switch. Definitely will look into that.