[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

[Openvpn-users] Tap-Win32 packet sink/source


  • Subject: [Openvpn-users] Tap-Win32 packet sink/source
  • From: "Alan Duca" <idduka@xxxxxxxxx>
  • Date: Tue, 30 Oct 2007 08:26:22 +0100

Hi,

   I am trying to use the Tap-Win32 adapter in TUN mode as a source and sink for packets at ip level. I seem to have understood how the virtual adapter (on windows) should be set up in order to be used as a source for ip packets. I set up end points for the virtual point-to-point link, and add a static link telling the kernel to forward any packets with destination 11.11.11.11 (for example) to the remote endpoint of the virtual point-to-point link. This way, the kernel is "coerced" to send the packets with destination to the local endpoint of the point-to-point link (the virtual adapter), and hence the packets are captured by the Tap-Win32 adapter, and pushed up to application level.

   However, I haven't yet found out how to use the Tap-Win32 adapter as a sink for packets. I tried using the same setup, and calling WriteFile instead of ReadFile. The result was that the written packets (ip header and all), were bypassing the local ip stack (good), being sent to the virtual adapter (hmmm...), and never ending up on the real physical adapter so as to be forwarded on to the actual destination (bad!).

   OpenVPN makes use of the Tap-Win32 adapter as a source and sink for packets on Windows (in both TAP and in TUN modes). Would anyone be able to give me some insight as to how to properly make use of the virtual adapter as a sink for packets, with written (outgoing) packets actually ending up on the real physical adapter and out towards the connected network (instead of being sent to the virtual adapter and being lost in digital limbo).

   Any help would be greatly appreciated :)

Alan.