You are not logged in.

#1 2014-06-28 13:10:47

snowblind
Member
Registered: 2013-07-18
Posts: 39

OpenConnect VPN client suddenly failing -- Failed to open tun device

This started recently on my laptop, when trying to connect to my company's Cisco VPN it simply fails and doesn't provide much information:

Jun 28 08:01:25 winter openconnect[17279]: POST https://vpn.company.net/
Jun 28 08:01:25 winter openconnect[17279]: Attempting to connect to server X.X.X.X
Jun 28 08:01:26 winter openconnect[17279]: SSL negotiation with vpn.company.net
Jun 28 08:01:26 winter openconnect[17279]: Connected to HTTPS on vpn.company.net
Jun 28 08:01:26 winter openconnect[17279]: XML POST enabled
Jun 28 08:01:36 winter openconnect[17279]: POST https://vpn.company.net/
Jun 28 08:01:43 winter openconnect[17279]: Got CONNECT response: HTTP/1.1 200 OK
Jun 28 08:01:44 winter openconnect[17279]: CSTP connected. DPD 30, Keepalive 20
Jun 28 08:01:54 winter openconnect[17279]: Failed to open tun device: No such device

I've made sure that the kernel is configured to load the tun device:

[root@localhost log]#  zgrep CONFIG_TUN /proc/config.gz
CONFIG_TUN=m
[root@localhost log]# 

And beyond this, I cannot seem to find any more information on what's going on. I know that the client is actually connecting, because we use a 2-step auth service that pushes requests to my phone, and I receive the request to authorize the login. It simply cannot start the tunnel. I've checked if the tun module is actually loaded, and it is not:

[root@localhost log]# lsmod | grep -i tun
[root@localhost log]# 

But as I understand it, this shouldn't matter, correct? The module should get loaded as needed by userspace applcations? I *believe* this started after I had setup an OpenVPN connection to connect to a client's VPN, but I made sure to uninstall OpenVPN (as it's not required by openconnect) and the issue still continues. OpenConnect works totally fine and connects to my company's VPN without a problem, on my desktop running Arch.

If anyone can shine some light on this I would greatly appreciate it! Thanks!

EDIT: I found a solution, though maybe someone can shine some light on why this works (and what broke in the first place). I basically insmoded the actual .ko file of the tun module:

[root@localhost net]# find /lib/modules/ -iname 'tun.ko.gz'
/lib/modules/3.15.1-1-ARCH/kernel/drivers/net/tun.ko.gz
[root@localhost net]# insmod /lib/modules/3.15.1-1-ARCH/kernel/drivers/net/tun.ko.gz
[root@localhost net]# lsmod | grep tun
tun                    20931  0 
[root@localhost net]#

After doing this I can connect to the VPN without issue.

Last edited by snowblind (2014-06-28 13:15:47)

Offline

#2 2014-06-28 21:40:40

demaio
Member
From: Germany
Registered: 2012-09-02
Posts: 102
Website

Re: OpenConnect VPN client suddenly failing -- Failed to open tun device

Did you upgrade to a newer kernel recently without a reboot afterwards? See https://bbs.archlinux.org/viewtopic.php?id=163377 for a (perhaps) related problem and solution.

Offline

Board footer

Powered by FluxBB