Some Intel Ethernet adapters and their drivers will, by default, strip VLAN tags when processing packets or strip tagged packets completely.
สำหรับ card LAN Intel ที่ผมใช้คือ "Intel(R) 82579V Gigabit Network Connection" ดังภาพที่ 1 ข้างล่าง
รูปที่ 1 แสดง card LAN Intel ที่ใช้ในการ capture
และผลของการ capture ก่อนที่จะมีการแก้ไขค่า Registry ใน Windows 7 คือ ไม่พบ VLAN tagging ดังภาพที่ 2
รูปที่ 2 แสดงผลการ capture ที่ยังไม่เห็น VLAN
จากนั้นจึงได้เข้าไปดู information การแก้ไขค่า Registry บน Windows เพื่อให้ card LAN Intel สามารถรองรับการ capture VLAN tagging ได้ ตาม link นี้ครับ
//www.intel.com/support/network/sb/CS-005897.htm
For Microsoft Windows*
To allow tagged frames to be passed to your packet capture software, add a registry dword and value, or change the value of the registry key.
จากข้อความข้างบน เค้าแนะนำให้ทำการ เพิ่ม registry DWORD และกำหนดค่า หรือให้ทำการเปลี่ยนแปลงค่าของ Registry Key
จากนั้น
จากนั้น เค้าให้เราทำการสร้าง Key (DWORD) ใหม่ และให้วางไว้ตาม path คือ
โดย nn (จาก 00nn) จะเป็น Physical Instance ของ card LAN ของเรา
========================================
จากข้อมูลที่กล่าวไปแล้วทั้งหมด เรามาเริ่มกันเลยครับ
Step 1: เปิด "Registry Editor" ดังภาพที่ 3 ข้างล่าง
รูปที่ 3 แสดงการเปิด Registry Editor
Step 2: ให้ไล่ Registry ตาม path ดังภาพที่ 4 ไปจนถึงตำแหน่งของ card LAN Intel โดยที่ 00nn ในตัวอย่างคือ 0007
Note: 00nn ของแต่ละเครื่องจะไม่เหมือนกัน ต้องทำการไล่ตรวจสอบทีละอันจนเจอ อย่าเอา 0007 ของผมไป setup นะครับ เพราะอาจจะไม่ใช่ตัวเดียวกัน
ซึ่งสามารถสังเกตได้จาก "DriverDesc" ที่จะบอกรายละเอียดของชื่อ card LAN ที่เรากำลังสนใจอยู่
รูปที่ 4 แสดงการไล่ path ใน Register Editor
Step 3: ทำการสร้าง DWORD ใหม่สองอัน คือ "MonitorModeEnabled" และ "MonitorMode"
When creating or changing registry dword MonitorModeEnabled, set the dword value to one of the following:
- 0 - disabled (Do not store bad packets, Do not store CRCs, Strip 802.1Q vlan tags)
- 1 - enabled (Store bad packets. Store CRCs. Do not strip 802.1Q vlan tags)
When creating or modifying registry dword MonitorMode, set the dword value to one of the following options:
- 0 - disabled (Do not store bad packets, Do not store CRCs, Strip 802.1Q vlan tags)
- 1 - enabled (Receive bad/runt/invalid CRC packets. Leave CRCs attached to the packets. Do not strip VLAN tags and ignore packets sent to other VLANs as per normal operation.)
Step 3.1: ทำการสร้าง DWORD ขึ้นมาใหม่ 2 อัน โดยการ click ขวาที่ 0007 ซึ่งเป็นของ card LAN Intel ที่เรากำลังสนใจ
Click ขวาบน 0007 --> New --> DWORD (32-bit) Value ดังภาพที่ 5
จากนั้นจะได้ DWORD ใหม่ขึ้นมา 2 อันคือ "New Value#1" และ "New Value#2" ดังภาพที่ 6
รูปที่ 5 แสดงการสร้าง DWORD ใหม่
รูปที่ 6 แสดง DWORD ใหม่ที่ถูกสร้างขึ้นมากคือ "New Value#1" และ "New Value#2"
Step 3.2: ทำการเปลี่ยนชื่อของ DWORD ใหม่ทั้งสองจาก "New Value#1" และ "New Value#2" เป็น "MonitorModeEnabled"และ "MonitorMode"
Click ขวาบน DWORD ที่ต้องการเปลี่ยนชื่อ --> Rename
รูปที่ 7 แสดงการเปลี่ยนชื่อของ DWORD
Step 3.3: ทำการกำหนดค่าให้กับ DWORD "MonitorModeEnabled"และ"MonitorMode"
โดยกำหนดค่าให้กับ DWORD ทั้งสองเป็น 1 ดังตัวอย่างในรูปที่ 8
รูปที่ 8 การกำหนดค่าให้กับ DWORD
Step 4: ทำการ restart PC
Step 5: หลังจาก restart PC แล้ว ลองมาทำการ capture traffic ใหม่อีกครั้ง จะสามารถเป็น VLAN tagging ได้ดังภาพที่ 9
รูปที่ 9 แสดงการ capture traffic และสามารถเห็น VLAN tagging ได้แล้ว
Note: ตัวอย่างบทความนี้ใช้ได้กับ card LAN Intel นะครับ สำหรับ card LAN ยี่ห้ออื่นๆ ก็ขอให้ท่านไปดูจาก Web ของผู้ผลิตรายนั้นๆ เองนะครับ
หวังว่าบทความนี้จะเป็นประโยชน์กับท่านบ้างไม่มากก็น้อยนะครับ
ขอบคุณครับ
โก้-ชัยวัฒน์ (KoChaiwat)