How to install tun/tap driver for openvpn on centos linux?
Best wishes for you.
The TUN/TAP driver is already part of the standard kernel image. Just run modprobe tun
to load it.
If you are inside a virtual server (e. g. OpenVZ/Virtuozzo, Linux-Vserver et al) the provider needs to enable tun/tap-functionality first since you cannot load kernel modules yourself in these environments.
The standard kernel image has TUN/TAP driver configured as default. But if you want to check that with your running kernel you can:
$ sudo apt-get install linux-headers-`uname -r`
$ cd /usr/src/linux-headers-`uname -r`
$ sudo make menuconfig
After searching for "TUN" you will find:
Symbol: TUN[=m]
│ Prompt: Universal TUN/TAP device driver support
│ Defined at drivers/net/Kconfig:112
│ Depends on: NETDEVICES
│ Location:
│ -> Device Drivers
│ -> Network device support (NETDEVICES [=y])
│ Selects: CRC32
The kernel module is located at:
$ ls /lib/modules/`uname -r`/kernel/drivers/net/tun.ko
You can repeat almost the same procedure with a kernel source to check if TUN driver is compiled as a module. Just replace the first two commands with:
$ tar xvjf linux-2.6.XX.X.tar.bz2 && cd linux-2.6.XX.X
and continue.
Best regards
Humber