OpenWrt Forum Archive

Topic: No Tap interface to set up openvpn

The content of this topic has been archived on 16 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am trying to set up an openvpn server on a netgear WGT634u (running smoothly kamikaze 7.09)

i followed the tuto at http://oldwiki.openwrt.org/OpenVPNHowTo.html

I am struggling with the startup scripts.

all I have read say
"# Creates TAP devices for use by OpenVPN and bridges them into OpenWRT Bridge"

But my scripts shows /dev/tap device does not exist.

How do I set this virtual interface ?

I did not find any explanation

Thanks for the help

any help ?

Do you have kmod-tun installed?

Thanks for the investigation MMCM.

I think it is installed, as shown below ('tun' module, I guess)

I have printed the log when i try to launch the Openvpn service
I still have a "Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)"

Any Idea ?

root@PTC2:/etc/openvpn# lsmod
Module                  Size  Used by    Tainted: P
tun                     6496  0
usb_storage            27664  2
sd_mod                 18416  3
scsi_mod               71968  2 usb_storage,sd_mod
ehci_hcd               28016  0
ohci_hcd               14064  0
ath_pci                94384  0
wlan_xauth               480  0
wlan_wep                4000  0
wlan_tkip               9664  0
wlan_ccmp               5408  2
wlan_acl                1888  0
ath_rate_minstrel       7840  1
ath_hal               271168  3 ath_pci,ath_rate_minstrel
wlan_scan_sta           8736  0
wlan_scan_ap            2624  0
wlan                  146432  10 ath_pci,wlan_xauth,wlan_wep,wlan_tkip,wlan_ccmp,wlan_acl,ath_rate_minstrel,wlan_scan_sta,wlan_scan_ap
ppp_async               9664  0
ppp_generic            20000  1 ppp_async
slhc                    5408  1 ppp_generic
crc_ccitt               1024  1 ppp_async
vfat                    8512  0
fat                    42448  1 vfat
ext3                   97040  0
jbd                    54672  1 ext3
ext2                   39952  1
usbcore               102032  4 usb_storage,ehci_hcd,ohci_hcd
nls_base                4416  2 vfat,fat
switch_robo             4048  0
switch_core             5088  1 switch_robo
diag                    8272  0
root@PTC2:/etc/openvpn# openvpn server.ovpn
Mon Jul  6 16:52:37 2009 OpenVPN 2.0.9 mipsel-linux [SSL] [LZO] [EPOLL] built on Jun  4 2007
Mon Jul  6 16:52:37 2009 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jul  6 16:52:37 2009 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jul  6 16:52:37 2009 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jul  6 16:52:37 2009 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jul  6 16:52:37 2009 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Mon Jul  6 16:52:37 2009 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Mon Jul  6 16:52:37 2009 Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)
Mon Jul  6 16:52:37 2009 Exiting

(Last edited by nicolo on 6 Jul 2009, 15:57)

nicolo wrote:

Thanks for the investigation MMCM.

I think it is installed, as shown below ('tun' module, I guess)

I have printed the log when i try to launch the Openvpn service
I still have a "Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)"

Any Idea ?

Try to execute

openvpn --mktun --dev tap0

and see what happens. This must create /dev/tap0 device. I use OpenVPN bridge on my home router.

Thanks rpra but

 
root@PTC2:~# openvpn --mktun --dev tap0
Tue Jul  7 08:10:30 2009 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Tue Jul  7 08:10:30 2009 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Tue Jul  7 08:10:30 2009 Cannot open TUN/TAP dev /dev/tap0: No such file or directory (errno=2)

... still don't work

Gotcha.

I just typed

 cp /dev/null /dev/tap0

prior to launching the openvpn service.

and my openvpn client can connect remotely to the netgear now

The discussion might have continued from here.