I. The NPF driver isn' t running
This error occurs because the NPF service is not enabled.
Netgroup Packet Filter (NPF) is the core component of Winpcap. It is a component of Winpcap for hard work. It processes packets transmitted over the network and provides user-level capture, injection, and analysis capabilities ).
It not only provides basic features (such as packet capture), but also more advanced features (such as programmable filter systems ). The former can be used to restrict a packet capture session to only one subset of network communication. The latter provides a powerful and simple network traffic statistics mechanism.
The solution is as follows:
(1) Ensure that you have installed WinPcap (this will prompt you to install Wireshark) can also download from the official website: Address: http://www.winpcap.org/
(2) Enter "net start npf" at the command prompt to indicate that the driver service is successfully enabled. As shown in:
If you want to disable the service, enter: net stop npf.
2. Capture local loopback data
In windows, enter the following statement in the command line:
Copy codeThe Code is as follows:
Route add 192.168.1.106 mask 255.255.255.255 192.168.1.1metric 1
192.168.1.106 is the local ip address and 192.168.1.1 is the routing gateway. The rest remains unchanged.
Note: When establishing a connection, you must use the IP address 192.168.1.106 of the local machine. You cannot use 127.0.0.1, for example:
Copy codeThe Code is as follows:
Socket. Connect ("192.168.1.106", 4530 );