Realtek (or Intel)
1.在设备管理中开启VLAN;
2.定位注册表:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00xx
如果该目录下有多个子项,则需要定位到需要抓包的那个网卡: DriverDesc 应该是 Realtek xxxxx;PC网卡的驱动程序关键字后面有00xx;
如果有多个Realtek,则看:DeviceInstanceID 该项数值应该等于 “网卡属性---详细信息---设备实例路径”中的值
查看DeviceInstanceID ,打开网卡--> 属性 --> 配置 --> 详细信息-->设备实例路径
3.修改注册表:
定位到该子项后,修改其中的MonitorModeEnabled 的数值为1,如果没有该项则新建这个DWORD键;
(设为0,表示剥离tag;为1则表示保留tag)
(如果是PCI或PCI-X,则新建键名为“MonitorModeEnabled”;如果是PCI-E,则键名“MonitorMode”)
重启电脑
另外一种答案:当上面不行的时候
I finally got my Realtek PCIe GBE Controller to do router on a stick with Windows 8.1 / Server 2012 R2!
Here's how:
1. I updated my drivers to the latest:
http://www.realtek.com.tw/downloads/dow ... Down=false
2. Once installed, went to my regedit in: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\00nn
Where nn is the physical instance of the network port where you want to capture the VLAN tags.
3. Added / Edited the following DWORDS:
MonitorModeEnabled - 1
MonitorMode - 1
*PriorityVLANTag - 0
SkDisableVlanStrip - 1
4. Restarted my machine, and voila! Working router on a switch! No need to use Linux!
Broadcom
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet
新增一项PreserveVlanInfoInRxPacket=1,类型为string,位置与TxCoalescingTicks相同;