to run openvpn I need tun/tap, how to start it ?
Already running
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!
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
Heya,
In case you still need to enable tun/tap,
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.
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
To ensure that the TUN module loads on boot, you need to add it to /etc/modules
:
echo "tun" | sudo tee -a /etc/modules
Heya,
I assume this is now sorted, I’ll like to mention the following. Run the following command to see if the TUN device is available:
cat /dev/net/tun
If it returns File descriptor in bad state
, it means the TUN/TAP driver is available.
Additionally, once OpenVPN is running, verify the TUN interface is up:
ip a show tun0
You should see an interface named tun0
with an IP address assigned.
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.