# tun / openvpn

## calubro

hi

i'm running a xen gentoo - domU an try to get openvpn working - when i try to start it i get:

```
dmesg | grep tun

[    0.202559] IPv4 over IPv4 tunneling driver

[    0.203207] sit: IPv6 over IPv4 tunneling driver

[   41.314000] tun: version magic '3.5.7-gentoo SMP mod_unload modversions 686 ' should be '3.5.7-gentoo SMP mod_unload 686 '

[64433.439891] tun: version magic '3.5.7-gentoo SMP mod_unload modversions 686 ' should be '3.5.7-gentoo SMP mod_unload 686 '

[66407.078295] tun: version magic '3.5.7-gentoo SMP mod_unload modversions 686 ' should be '3.5.7-gentoo SMP mod_unload 686 '

[66491.367548] tun: version magic '3.5.7-gentoo SMP mod_unload modversions 686 ' should be '3.5.7-gentoo SMP mod_unload 686 '

```

```
ll /dev/net/tun

crw-rw-rw- 1 root root 10, 200 Mar 24 14:35 /dev/net/tun

```

```
# tail -f /var/log/messages

Mar 25 09:03:56 xxx openvpn[14538]: Socket Buffers: R=[87380->131072] S=[16384->131072]

Mar 25 09:03:56 xxx openvpn[14538]: ROUTE default_gateway=192.168.1.254

Mar 25 09:03:56 xxx kernel: [66491.367548] tun: version magic '3.5.7-gentoo SMP mod_unload modversions 686 ' should be '3.5.7-gentoo SMP mod_unload 686 '

Mar 25 09:03:56 xxx modprobe: FATAL: Error inserting tun (/lib/modules/3.5.7-gentoo/kernel/drivers/net/tun.ko): Invalid module format

Mar 25 09:03:56 xxx openvpn[14538]: Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)

Mar 25 09:03:56 xxx openvpn[14538]: /bin/ifconfig  10.8.0.1 pointopoint 10.8.0.2 mtu 1500

Mar 25 09:03:56 xxx openvpn[14538]: Linux ifconfig failed: external program exited with error status: 1

Mar 25 09:03:56 xxx openvpn[14538]: Exiting

Mar 25 09:03:56 xxx /etc/init.d/openvpn[14537]: start-stop-daemon: failed to start `/usr/sbin/openvpn'

Mar 25 09:03:56 xxx /etc/init.d/openvpn[14523]: ERROR: openvpn failed to start

```

```
ifconfif -a

tunl0: flags=128<NOARP>  mtu 1480

        tunnel   txqueuelen 0  (IPIP Tunnel)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
```

tun/tap device support is build in the kernel ...

Any ideas?

Thx, br Cal

----------

## Hu

I interpret this output to mean that, although TUN is currently builtin, it was at one time a module, and the module is still present on disk.  The module is unnecessary and is configured for a different kernel than the one you now use, so it cannot load.  You should remove it.

----------

## calubro

Hi Hu!

That's true ... it seems to use an old existing module! I tried to remove it and got this:

```
# tail -f /var/log/messages

Mar 26 07:26:32 xxx openvpn[16401]: TLS-Auth MTU parms [ L:1544 D:140 EF:40 EB:0 ET:0 EL:0 ]

Mar 26 07:26:32 xxx openvpn[16401]: Socket Buffers: R=[87380->131072] S=[16384->131072]

Mar 26 07:26:32 xxx openvpn[16401]: ROUTE default_gateway=192.168.1.254

Mar 26 07:26:32 xxx modprobe: FATAL: Could not read '/lib/modules/3.5.7-gentoo/kernel/drivers/net/tun.ko': No such file or directory

Mar 26 07:26:32 xxx openvpn[16401]: Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)

Mar 26 07:26:32 xxx openvpn[16401]: /bin/ifconfig  10.8.0.1 pointopoint 10.8.0.2 mtu 1500

Mar 26 07:26:32 xxx openvpn[16401]: Linux ifconfig failed: external program exited with error status: 1

Mar 26 07:26:32 xxx openvpn[16401]: Exiting

Mar 26 07:26:32 xxx /etc/init.d/openvpn[16400]: start-stop-daemon: failed to start `/usr/sbin/openvpn'

Mar 26 07:26:32 xxx /etc/init.d/openvpn[16386]: ERROR: openvpn failed to start

^C

xxx # ll /dev/net/tun

crw-rw-rw- 1 root root 10, 200 Mar 24 14:35 /dev/net/tun

```

I tried to remove the section in the init script - but still same message ...

EDIT:

I got openVpn to start: changed the tun/tap to Module in the Kernel - and copied it to the domU ... not a real clean solution I think but working ...

----------

