วันพุธที่ 2 พฤษภาคม พ.ศ. 2561

การ Set Port Mirroring ใน VMware Esxi และตั้งค่าใน Cisco Switch

Configuring ESXi
First create a new Standard vSwitch, this is going to be the target for your port mirror.  Make sure that you name it appropriately so that it is easy to assign it to your VMs without confusion.
Make sure that you then assign the NIC that you connected to the port that is being replicated in the Network adapters tab.
Then most importantly make sure that you set the Security settings of both the vSwitch and the port group to Accept promiscuous mode.
Next set the VLAN ID to All.
Then you need to add a NIC to your VM and select the network that you created above.
Switch Configuration
I was using a Cisco SF300 switch so in the GUI this was a simple matter of going to Diagnostics>Port and VLAN Mirroring and choosing my source and destination ports.  Please note that adding the port mirror does not cause any network interruption or downtime on the switch and can be done in working hours safely.
Testing
To test I first installed Wireshark and selected the NIC that I had bound the mirrored port to.
I then started a continuous ping from my desktop to the device connected to the port that I was mirroring from.  I then added a filter to Wireshark using the syntax ip.addr == 10.200.20.40 (this is the IP of the machine I was pinging from).
Once I could see the ICMP packets I knew that everything was working ok and that I had successfully mirrored the port and sent the traffic to the 2nd NIC of my VM in ESXi.
WebSite Reference : http://dailysysadmin.com/KB/Article/965/port-mirroring-cisco-switch-virtual-machine-vmware-esxi-host/