pogy
Posts: 6
Joined: Sat Jun 08, 2013 10:36 am

OpenVPN Server stopped working

Fri Sep 06, 2013 12:42 pm

Hi all,

I am having trouble with OpenVPN server on raspbian.
At the moment I just know that the tun interface cannot be created.

Log output:

Fri Sep 6 14:05:02 2013 Linux ifconfig failed: external program exited with error status: 255
Fri Sep 6 14:05:02 2013 Exiting
Fri Sep 6 14:24:35 2013 OpenVPN 2.2.1 arm-linux-gnueabihf [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Jun 15 2013
Fri Sep 6 14:24:35 2013 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Fri Sep 6 14:24:35 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Fri Sep 6 14:24:35 2013 Diffie-Hellman initialized with 1024 bit key
Fri Sep 6 14:24:35 2013 TLS-Auth MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ]
Fri Sep 6 14:24:35 2013 Socket Buffers: R=[163840->131072] S=[163840->131072]
Fri Sep 6 14:24:35 2013 Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Fri Sep 6 14:24:35 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Sep 6 14:24:35 2013 /sbin/ifconfig 10.8.0.1 netmask 255.255.255.0 mtu 1500 broadcast 10.8.0.255
SIOCSIFADDR: No such device
: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFMTU: No such device
SIOCSIFBRDADDR: No such device
: ERROR while getting interface flags: No such device
Fri Sep 6 14:24:35 2013 Linux ifconfig failed: external program exited with error status: 255
Fri Sep 6 14:24:35 2013 Exiting

ifconfig:

eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18659 errors:0 dropped:25 overruns:0 frame:0
TX packets:18955 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1405703 (1.3 MiB) TX bytes:1858179 (1.7 MiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:722 errors:0 dropped:0 overruns:0 frame:0
TX packets:722 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:41774 (40.7 KiB) TX bytes:41774 (40.7 KiB)

When trying:

modprobe tun
ERROR: could not insert 'tun': Exec format error

Please suggest next steps in troubleshooting.

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: OpenVPN Server stopped working

Fri Sep 06, 2013 1:22 pm

What are the outputs of:

uname -a

find /lib/modules/ -name tun.ko

find /lib/modules/`uname -r` -name tun.ko -exec file {} \;


?

pogy
Posts: 6
Joined: Sat Jun 08, 2013 10:36 am

Re: OpenVPN Server stopped working

Fri Sep 06, 2013 1:31 pm

rpi1:/dev/net# uname -a
Linux rpi1 3.6.11+ #494 PREEMPT Fri Jul 5 15:30:31 BST 2013 armv6l GNU/Linux
rpi1:/dev/net# find /lib/modules/ -name tun.ko
/lib/modules/3.6.11+/kernel/drivers/net/tun.ko
rpi1:/dev/net# find /lib/modules/`uname -r` -name tun.ko -exec file {} \;
/lib/modules/3.6.11+/kernel/drivers/net/tun.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), BuildID[sha1]=0x946acac39a420253907f48915af8b40048059c6b, not stripped
rpi1:/dev/net#

fulton
Posts: 4
Joined: Sat Sep 07, 2013 12:31 pm

Re: OpenVPN Server stopped working

Sat Sep 07, 2013 12:41 pm

I'm having the same problem, the "tun.ko" module fails to load.

Code: Select all

$ sudo modprobe tun
ERROR: could not insert 'tun': Exec format error

$ sudo dmesg
[2048764.664901] tun: disagrees about version of symbol module_layout
It appears that at least a few modules in drivers/net are affected.
Running kernel is 3.6.11+ and raspberrypi-bootloader is 1.20130902-1

pogy
Posts: 6
Joined: Sat Jun 08, 2013 10:36 am

Re: OpenVPN Server stopped working

Sun Sep 08, 2013 6:42 pm

same here:

Code: Select all

[email protected] ~ $ dmesg | grep tun
[   26.059093] tun: disagrees about version of symbol module_layout
[  183.079981] tun: disagrees about version of symbol module_layout
[50075.397769] tun: disagrees about version of symbol module_layout
[50085.045453] tun: disagrees about version of symbol module_layout
[50243.468688] tun: disagrees about version of symbol module_layout
[51262.594764] tun: disagrees about version of symbol module_layout
[51278.325233] tun: disagrees about version of symbol module_layout
[51900.135440] tun: disagrees about version of symbol module_layout
[51970.499891] tun: disagrees about version of symbol module_layout
[51980.355391] tun: disagrees about version of symbol module_layout
[52440.453929] tun: disagrees about version of symbol module_layout
[52771.155868] tun: disagrees about version of symbol module_layout
[53396.746447] tun: disagrees about version of symbol module_layout
[57186.821899] tun: disagrees about version of symbol module_layout
[60180.410326] tun: disagrees about version of symbol module_layout
[60199.265190] tun: disagrees about version of symbol module_layout
[247169.978501] tun: disagrees about version of symbol module_layout

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: OpenVPN Server stopped working

Mon Sep 09, 2013 8:52 pm

Hmm,

This does indeed suggest there is a problem with tun.ko - a mismatch of some sort between the running kernel and the module.

I haven't been on the 3.6 branch for ages. Are you fully up to date with rpi-update?

pogy
Posts: 6
Joined: Sat Jun 08, 2013 10:36 am

Re: OpenVPN Server stopped working

Tue Sep 10, 2013 7:05 am

Yes, the raspberry is up to date via rpi-update.

fulton
Posts: 4
Joined: Sat Sep 07, 2013 12:31 pm

Re: OpenVPN Server stopped working

Sun Sep 15, 2013 2:13 pm

FWIW pn my RPi the issue is now resolved after I've removed the SD card to make a backup of the system. (A regular soft boot didn't change anything.)

For the record, this is what I currently have:

Code: Select all

$ uname -a
Linux possum 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux

$ dpkg -l raspberrypi-bootloader
...
ii  raspberrypi-bootloader   1.20130902-1      armhf             Raspberry Pi bootloader

$ sha256sum /lib/modules/3.6.11+/kernel/drivers/net/tun.ko
9a5bc26b4ff486ae57c62e15708465d9443687445eb3a850737b3cfdc8549c3f  /lib/modules/3.6.11+/kernel/drivers/net/tun.ko

pogy
Posts: 6
Joined: Sat Jun 08, 2013 10:36 am

Re: OpenVPN Server stopped working

Sun Sep 15, 2013 7:39 pm

I tried the same, but the issue persists.

Code: Select all


uname -a
Linux rpi1 3.6.11+ #494 PREEMPT Fri Jul 5 15:30:31 BST 2013 armv6l GNU/Linux

dpkg -l raspberrypi-bootloader
ii  raspberrypi-bootl 1.20130902-1  armhf         Raspberry Pi bootloader

sha256sum /lib/modules/3.6.11+/kernel/drivers/net/tun.ko
9a5bc26b4ff486ae57c62e15708465d9443687445eb3a850737b3cfdc8549c3f  /lib/modules/3.6.11+/kernel/drivers/net/tun.ko

modprobe tun
ERROR: could not insert 'tun': Exec format error

cat /var/log/openvpn
Sun Sep 15 21:17:32 2013 OpenVPN 2.2.1 arm-linux-gnueabihf [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Jun 15 2013
Sun Sep 15 21:17:32 2013 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x.  Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Sun Sep 15 21:17:32 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Sun Sep 15 21:17:32 2013 Diffie-Hellman initialized with 1024 bit key
Sun Sep 15 21:17:32 2013 TLS-Auth MTU parms [ L:1574 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Sep 15 21:17:32 2013 Socket Buffers: R=[163840->131072] S=[163840->131072]
Sun Sep 15 21:17:32 2013 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Sun Sep 15 21:17:32 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Sep 15 21:17:32 2013 /sbin/ifconfig  10.8.0.1 netmask 255.255.255.0 mtu 1500 broadcast 10.8.0.255
SIOCSIFADDR: No such device
: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFMTU: No such device
SIOCSIFBRDADDR: No such device
: ERROR while getting interface flags: No such device
Sun Sep 15 21:17:32 2013 Linux ifconfig failed: external program exited with error status: 255
Sun Sep 15 21:17:32 2013 Exiting

dmesg
[ 1141.685159] tun: disagrees about version of symbol module_layout
[ 1673.383066] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[ 1673.409191] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[ 1673.435235] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[ 1673.461092] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[ 1673.486948] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[ 1673.513160] Loading kernel module for a network device with CAP_SYS_MODULE (deprecated).  Use CAP_NET_ADMIN and alias netdev- instead.
[ 2668.536321] tun: disagrees about version of symbol module_layout


boombata
Posts: 2
Joined: Sun Sep 01, 2013 12:03 pm

Re: OpenVPN Server stopped working

Wed Nov 20, 2013 10:45 am

copied back tun.ko from previous version, it now works.
Julien.

shaan_raspberrypi
Posts: 1
Joined: Wed Dec 11, 2013 5:41 am

Re: OpenVPN Server stopped working

Wed Dec 11, 2013 5:54 am

Hi ,
I am also having same problem with tun.ko....(/lib/modules/3.6.11+/kernel/drivers/net/tun.ko
)
****************Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19) *****************


Could you please let me know from where did you find the old version for tun.ko ?

Thanks

atmosx
Posts: 24
Joined: Mon Aug 06, 2012 1:36 pm
Location: Greece

Re: OpenVPN Server stopped working

Thu Dec 19, 2013 5:15 pm

Same problem here after upgrade, but here is a clear version miss-match. Theoretically re-compiling the kernel with tun/tap support would add this at kernel level avoiding headaches. Didn't try it yet but will soon and let you know.

User avatar
DougieLawson
Posts: 36544
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: OpenVPN Server stopped working

Thu Dec 19, 2013 7:03 pm

Can you post the output from
/usr/sbin/openvpn --config ./server.conf
on your system.

I've just tried it on my system running

Code: Select all

[email protected] /etc/openvpn # vcgencmd version
Dec  9 2013 21:24:40
Copyright (c) 2012 Broadcom
version c7215df85576f3e72f9c390db9bc2da642453b10 (clean) (release)
[email protected] /etc/openvpn # uname -a
Linux pi 3.10.24+ #610 PREEMPT Thu Dec 12 13:12:09 GMT 2013 armv6l GNU/Linux
[email protected] /etc/openvpn #
That was installed ten days ago with sudo rpi-update.

And it worked fine. Created the tun device with no problems.

My config looks like

Code: Select all

port 1194
proto udp
dev tun
#tun-ipv6
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh1024.pem
server 192.168.50.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user openvpn
group openvpn
persist-key
persist-tun
status openvpn-status.log
verb 3
#tun-ipv6
#ifconfig-ipv6  2001:xxxx:xxxx:xxxx:a::1 2001:xxxx:xxxx:xxxx:a::2
#ifconfig-ipv6-pool 2001:xxxx:xxxx:xxxx:b::7/64
#route-ipv6 2001:xxxx:xxxx:xxxx:b::7
#push "route-ipv6 ::/0"
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Troubleshooting”