# OpenVPN & tun - no device

## Uzytkownik

I have hardened gentoo. I try to use openvpn.

However:

```
checktundevice() {

        if [[ ! -e /dev/net/tun ]]; then

                if ! modprobe tun ; then

                        eerror "TUN/TAP support is not available in this kernel"

                        return 1

                fi

        fi

        if [[ -h /dev/net/tun && -c /dev/misc/net/tun ]]; then

                ebegin "Detected broken /dev/net/tun symlink, fixing..."

                rm -f /dev/net/tun

                ln -s /dev/misc/net/tun /dev/net/tun

                eend $?

        fi

}

```

I have tunneling(Universal TUN/TAP device) compiled in kernel, but I have no such files. I have in /dev/misc only rtc and I don't have net dirs at all.

What's wrong?

(If it's possibly I'd like to resolve it without restarting computer - this computer is kind of router/server).

----------

## thepustule

what happens if you use the tunctl command to manually activate a tun interface?

----------

## Uzytkownik

In which packages is it?

----------

## magic919

You can create a TUN device using Gentoo.  See /etc/conf.d/net.example for how.

----------

## Uzytkownik

 *thepustule wrote:*   

> what happens if you use the tunctl command to manually activate a tun interface?

 

```

# tunctl

Failed to open '/dev/net/tun' : No such file or directory

```

 *magic919 wrote:*   

> You can create a TUN device using Gentoo. See /etc/conf.d/net.example for how.

 

```
# /etc/init.d/net.tun0 start

 * Caching service dependencies ...                                       [ ok ]

 * Starting tun0

FATAL: Module tun not found.

 *   TUN/TAP support is not present in this kernel                        [ !! ]

```

```
# grep tun /etc/udev/rules.d/*

/etc/udev/rules.d/50-udev.rules:KERNEL=="tun",          NAME="net/%k",  MODE="0600"

# gzcat /proc/config.gz | grep TUN

# CONFIG_INET_TUNNEL is not set

CONFIG_INET6_TUNNEL=y

# CONFIG_IPV6_TUNNEL is not set

CONFIG_TUN=y

# CONFIG_8139TOO_TUNE_TWISTER is not set

```

----------

## thepustule

You may also need to 

```
modprobe tun
```

first.

----------

## Uzytkownik

 *thepustule wrote:*   

> You may also need to 
> 
> ```
> modprobe tun
> ```
> ...

 

I have it compiled into kernel - not like a module but in bzImage  :Smile: 

Regards.

----------

## UberLord

iirc you need hotplug enabled in the kernel too.

----------

## Uzytkownik

 *UberLord wrote:*   

> iirc you need hotplug enabled in the kernel too.

 

I have hotplug support (it's needed by my modem).

What's "iirc"?

----------

## UberLord

If I Remember Correctly.

http://en.wikipedia.org/wiki/IIRC

----------

## Uzytkownik

 *UberLord wrote:*   

> If I Remember Correctly.
> 
> http://en.wikipedia.org/wiki/IIRC

 

Sorry. Anyway I have hotplug support.

----------

## UberLord

I think it's just a missing kernel option, but I cannot give any more help than that. Sorry :/

----------

## Uzytkownik

I've added it by mknod. I try openvpn now.

----------

## Uzytkownik

Which option set to take ip address for clients from 192.168.0.8 -15?

Server is 192.168.0.1 and address 192.168.0.2-7 are reserved in my lan.

----------

## UberLord

```
ifconfig-pool 192.168.0.5 192.168.0.15 255.255.255.0
```

Put that in your servers openvpn.conf

----------

## xtlosx

use openvpn to create your tun\tap devices.. i had this same problem fixed it using the openvpn binary.

----------

