Tun device seems to randomly change upon connection? #158
-
Been using openvpn3 for a good while now and its been fine, however lately I have noticed something strange. Is there a way to help diagnose why this is happening, and or an intended feature of some kind? I have tried to make sure its not a conflict, like make sure there is no old connections on tun0 still, but its not that, it just seems to randomly decide to switch to tun1 most of the time when connecting. I am using the command If I connect and it switches to tun1, using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
Hi, This is an expected behaviour, actually. It is the only way to ensure network traffic expected to be routed via the VPN does not leak when there are connectivity issues with the VPN link. The old approach was to tear down the tun interface, create it again and then setup up IP addresses and routing. This had the potential of leaking network traffic via your default gateway in the time window the VPN IP address and routes were not present on your system; they disappears when the network interface is removed. In OpenVPN 3, when there is a connectivity issue and a full reconnect is required, a new tun interface is created and configured and then the old interface is removed. The problem here with this approach is that the new tun interface cannot have the same interface name as the old one. Hence the device name change. I would recommend you to use However, it is generally considered even better and more flexible to not be dependent on device names themselves, but rather do the firewall filtering based on subnets instead. But I do see that there are use cases where this might not be as easy - like when forwarding traffic from the public Internet. |
Beta Was this translation helpful? Give feedback.
-
I think its safe to say I no longer experience what ever it was that was causing this issue. Thanks for your time in replying and helping diagnose this. Its safe to say it's an issue on my end not the software. |
Beta Was this translation helpful? Give feedback.
Hi,
This is an expected behaviour, actually. It is the only way to ensure network traffic expected to be routed via the VPN does not leak when there are connectivity issues with the VPN link. The old approach was to tear down the tun interface, create it again and then setup up IP addresses and routing. This had the potential of leaking network traffic via your default gateway in the time window the VPN IP address and routes were not present on your system; they disappears when the network interface is removed.
In OpenVPN 3, when there is a connectivity issue and a full reconnect is required, a new tun interface is created and configured and then the old interface is removed. The problem …