'How to install tun on Ubuntu 16.04

I try to install tun on Ubuntu 16.04, it generates the tun.ko, but it still doesn't work.

1

Uname -a Linux host-name 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

2

apt-get install linux-source-4.10.0

3

cd /usr/src/linux-source-4.10.0 menuconfig->Device Drivers->Network Device Support->Universal TUN/TAP device driver support

Then save it as tun.config.

4

make modules, it generate tun.ko under /drivers/net/ without err, then copy it to lib/modules/4.10.0-42-generic/kernel/net/tun.ko.

And it still doesn't work. The command "modinfo tun" doesn't output anything.

Any advice about the install tun on Ubuntu 16.04?



Solution 1:[1]

You're probably on a VPS so you'll need to change this on your host settings.

  • Login to your VPS control panel using your username and password.
  • Click the ‘Manage’ button to the right of the VPS in which you want to enable tun/tap
  • Under Controls -> Settings tab, click on ‘Enable TUN/TAP’
  • A dialog box appears asking for confirmation, hit yes

Source: https://www.copahost.com/blog/openvpn-in-ubuntu-tun-tap/

I had this problem myself and just fixed it by doing exactly this.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sojim2