VMware Cloud Community
realdreams
Enthusiast
Enthusiast

assign a physical NIC port to a VM?

How can I assign a physical port to a VM, without the hypervisor tempering with the traffic? I need the inbound and outbound traffic to pass unmodified. What I need to do is to capture traffic/send on a 802.1q trunk port. So the VM needs to see all the vlan tags and tagged frames from VM should be sent out untouched. Is this possible vSphere?

5 Replies
Nick_Andreev
Expert
Expert

If you need to capture and monitor traffic, you can create and configure a port group in promiscuous mode. And then if the network monitoring software on the VM is capable of doing VLAN tagging itself, you can set up VLAN ID 4095 on the port group, which will trunk all VLANs to the VM. It's called Virtual Guest Tagging (VGT).

Is that what you need? If so, refer to the following article:

Sample configuration of virtual machine VLAN Tagging (VGT Mode) in ESX (1004252)

---
If you found my answers helpful please consider marking them as helpful or correct.
VCIX-DCV, VCIX-NV, VCAP-CMA | vExpert '16, '17, '18
Blog: http://niktips.wordpress.com | Twitter: @nick_andreev_au
0 Kudos
ThompsG
Virtuoso
Virtuoso

Hi there,

This is possible without dedicating a network adapter to a VM. Basically you can put either the vSwitch or a PortGroup into promiscuous mode and then start your capture. KB link here on what is required: VMware KB: Configuring promiscuous mode on a virtual switch or portgroup

Another option depending on your licensing level is to use "Port Mirroring" - this is the same as what you could do on a physical switch. Here is some information around this option: VMware vSphere 5.1

If however you are dead keen to still pass a physical adapter directly to a VM then what you are looking to enable is "DirectPath I/O" - there are a bunch of caveats around using this like cannot vMotion (unless using Cisco UCS), no snapshots, no suspend and resume, etc. plus your hardware needs to have VT-d. Here is some documentation around this if interested: VMware KB: Configuring VMDirectPath I/O pass-through devices on a VMware ESX or VMware ESXi host. NOTE: Some hardware while you can enable this feature don't offer support for having this feature enabled, i.e. HP

Kind regards.

0 Kudos
FurqanAhmadShah
Contributor
Contributor

Hi You can use the DirectPatch I/O option and mark the physical NIC as pass-through later after a reboot you can use the hardware directly with VM. You need to configure all the required VLANs on the physical interface at switch side.

0 Kudos
realdreams
Enthusiast
Enthusiast

Can I achieve the same with SR-IOV?

0 Kudos
Nick_Andreev
Expert
Expert

Yes, SR-IOV will let you bypass the hypervisor. Plus, it will let you share the same physical device between multiple VMs. Which VMDirecPath I/O is not capable of.

You will need to make sure that your NIC is compatible with VMDirecPath I/O or SR-IOV here: VMware Compatibility Guide

---
If you found my answers helpful please consider marking them as helpful or correct.
VCIX-DCV, VCIX-NV, VCAP-CMA | vExpert '16, '17, '18
Blog: http://niktips.wordpress.com | Twitter: @nick_andreev_au
0 Kudos