Question

How to turn on TUN/TAP on droplet server

to run openvpn I need tun/tap, how to start it ?

Already running


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
July 2, 2024

Heya,

In case you still need to enable tun/tap,

1. Check if TUN/TAP is Enabled

First, check if the TUN/TAP module is already enabled:

cat /dev/net/tun

If you see the output “File descriptor in bad state”, it means TUN/TAP is enabled. If you see “No such file or directory”, it means TUN/TAP is not enabled.

2. Load the TUN Module

If TUN/TAP is not enabled, you need to load the TUN module:

sudo modprobe tun

You can verify that the module is loaded:

lsmod | grep tun

You should see an output like:

tun 28672 0

3. Ensure TUN/TAP Loads on Boot

To ensure that the TUN module loads on boot, you need to add it to /etc/modules:

echo "tun" | sudo tee -a /etc/modules
Bobby Iliev
Site Moderator
Site Moderator badge
July 2, 2024

Hi there,

Noticed that you mentioned that this is already running? Did you sort it out and if so would you mind sharing this with the community here?

What I personally do when setting up an OpenVPN instance is to use the 1-Click installation from the DigitalOcean Marketplace:

https://marketplace.digitalocean.com/apps/openvpn-access-server

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel