OpenVPN dynamic TUN/TAP

I thought I would give OpenVPN a try, but I’m not having much luck. It stops with a an error saying “Cannot allocate TUN/TAP dev dynamically”.

Looking at various sites for this message, they all say there should be tun devices under /dev (for Linux, etc). I don’t have any. At least, none that I can find. I’m wondering if something else needs to be installed or if there’s a specific setting that should be used that I can’t figure out?

I’m using 64-bit nighty and Beta 5.

Thanks!

I think the tun driver is not yet included in the images.

1 Like

Ah, that would explain it. I guess it’s not available separately, either. Unless I just can’t find it in Haiku Depot. Thanks!

Actually, it is https://cgit.haiku-os.org/haiku/commit/?id=hrev57387
However, it was renamed to tunnel.
It lives in /system/add-ons/kernel/network/devices/tunnel

1 Like

Hmm. Ok. If I specify that with --dev-node, I get an “operation not allowed” error.

Is it supposed to be able to dynamically create TUN devices? Is there something else that should be specified for it work?

Try to follow the manual from this article Haiku Activity & Contract Report, November 2023 (ft. VPN support) | Haiku Project

4 Likes

Awesome! Thanks, that’s what I was searching for. I may be able to get it to work from there.

Thanks for linking that! I successfully made it work. :slight_smile:
I always wondered if it was already usable; I think when I read that post originally, the forum software didn’t display the commands in the “Terminal-box”…

Very nice! I hope it’ll soon join the other services in the Network preferences.

2 Likes

Hello, I’m trying to use OpenVPN on Haiku 32bit, I found this thread and included guide but it doesn’t work for me - I do ifconfig tun/0 up then openvpn --config myconf.ovpn but end up with Cannot allocat TUN/TAP dev dynamically, Exiting due to fatal error. I wonder if there’s some missing step?

Working from memory, but check your .ovpn file. If it says “dev tun” try changing it to “dev tun/0”

1 Like

Thanks! That solved it.

1 Like

My .ovpn files also say “dev tun”, but do work as well…

I originally had dev tun_turris there (the OpenVPN server runs on Turris Omnia and it generated the config file for the client) with comment: Use the same setting as you are using on the server.
Maybe changing it to dev tun would be enough but dev tun/0 works, so I’m cool with it :slight_smile:

1 Like