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

[Openvpn-users] tap interface created with openvpn sends no data?

  • Subject: [Openvpn-users] tap interface created with openvpn sends no data?
  • From: Davide <davide.brini2@xxxxxxxxxxxxxxx>
  • Date: Wed, 28 Nov 2007 13:27:58 +0100

Foreword: this is not strictly related to openvpn usage as a vpn, but 
rather is about the "openvpn --mktun" option used to create persistent 
tap interfaces. I hope this is not too OT.

I'm having this weird problem. I do this (linux, openvpn 2.0.6):

# openvpn --mktun --dev tap5
Wed Nov 28 11:08:42 2007 TUN/TAP device tap5 opened
Wed Nov 28 11:08:42 2007 Persist state set to: ON
# ifconfig tap5 netmask up

Now, I use a very simple C program I wrote to open /dev/net/tun and get a 
descriptor for reading data sent by the tap interface. The code used by 
this program to open the interface is almost entirely copied from that 
in the Documentation/networking/tuntap.txt file in the linux kernel 

When doing something like "ping", I expect to see some data 
coming out of the tap interface (at least some ARP request, for 
example). But, nothing is received, and the read() on the tap 
descriptors blocks and never reads anything.

If, on the other hand, I use tunctl to create the tap interface, 
everything works and my program correctly reads some outgoing frames 
from the tap interface.

I also tried to attach vde_switch to the tap interface, and I saw the 
same behavior: when the interface is created with openvpn --mktun, no 
data is received, with tunctl things work.

So, my question is: am I doing something wrong, or does openvpn --mktun 
do something different than tunctl?
OpenVPN mailing lists