Messages from the ESXi VMkernel indicate that a virtual machine is trying to promiscuously capture all network traffic on a vSwitch portgroup, but the vSwitch portgroup policy is configured to deny promiscuous mode. No warning is emitted for virtual machines attached using promiscuous mode when it is permitted by the effective vSwitch portgroup policy.
By default, a guest operating system's virtual network adapter only receives frames that are meant for it. Placing the guest's network adapter in promiscuous mode causes it to receive all frames passed on the virtual switch that are allowed under the VLAN policy for the associated portgroup. This can be useful for intrusion detection monitoring or if a sniffer needs to to analyze all traffic on the network segment.
If software within a virtual machine is attempting to put the guest network adapter in promiscuous mode, contrary to the defined vSwitch portgroup policy, it may be necessary to investigate if the virtual machine is running undesired software.
This article provides steps for identifying a virtual machine that attempts to promiscuously capture all network traffic on a vSwitch portgroup, based upon the VMkernel log messages. Investigation within a virtual machine is outside the scope of this article.
Symptoms:
/var/log/vmkernel
or /var/log/messages
contain entries similar to:cpuN:nnnn)etherswitch: L2Sec_EnforcePortCompliance: 0xnnnnnnnn: peer not allowed promiscuous, revoking setting
VMware vSphere
VMware ESXi
The log message identifies a specific virtual network interface on an ESX or ESXi host by its PortID. This identifier is not displayed in the vSphere Client, but can be associated with a virtual machine by searching the performance metrics for all virtual machine network interfaces on the host.
To identify which virtual machine is attempting to enter promiscuous mode, convert the logged hexadecimal port identifier to a base 10 number and locate the virtual machine using that port number.
cpuN:12345)etherswitch: L2Sec_EnforcePortCompliance: 0x5000003: peer not allowed promiscuous, revoking setting
12345
and the port identifier is 0x5000003.
0x5000003
is 83886083
in base-10.To identify a virtual machine by its base-10 port identifier using the PowerCLI:
Connect-VIServer -Server <ESXHostnameOrIPAddress>
Get-ESXTOP -CounterName NetPort | select PortID,WorldLeader,ClientName | Where { $_.PortID -eq "83886082" } | ft -AutoSize
PortID WorldLeader ClientName
------ ----------- ----------
83886082 12344 VirtualMachineName
The esxtop command-line performance monitoring utility is included the local ESX/ESXi console. For more information on use of esxtop.
To identify a virtual machine by its base-10 port identifier using esxtop:
PORTID="
83886082"
esxtop
-n 1 -b | tr ',' '\n' | grep -o 'Network Port
(.*
:
$PORTID
:.*)
' | sort -u
Network Port(vSwitchName:
83886082
:12344:
VirtualMachineName
)
The local esxcfg-info command-line utility is included the local ESX/ESXi console. This command provides a view of the internal state of various components.
To identify a virtual machine by its base-10 port identifier using the output of esxcfg-info:
esxcfg-info --network | grep -A 3 "Port Id.*
83886082"
|----Port Id..........83886082
|----World Leader.....
12344
|----Client Name......VirtualMachineName