Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apps don't recover after tunnel reconnects #5

Open
aleqx opened this issue Jun 10, 2018 · 1 comment
Open

apps don't recover after tunnel reconnects #5

aleqx opened this issue Jun 10, 2018 · 1 comment

Comments

@aleqx
Copy link

aleqx commented Jun 10, 2018

If I have any existing running apps that bound to the openvpn interface to either listen or send, then if the openvpn tunnel dies and reconnects the netns is recreated fine, with the same name and IP, but the apps that were previously running in the netns can't reach the network any more ... it seems that even though the netns is recreated and has the same name, it's a different interface than the previous one. I have to restart ALL apps everywhere ...

This isn't a safe "set it and forget it" approach. To fix this, the net namespace and interface should not be destroyed (like they are now) upon disconnection/reconnection ... this should be possible, and only change the IP address of the interface upon reconnection.

For example (this is old, needs updating): https://austinjadams.com/blog/running-select-applications-through-openvpn/

Better yet, once could actually run openvpn itself under the net namespace:

https://gist.github.com/Schnouki/fd171bcb2d8c556e8fdf
or
https://gist.github.com/Ernillew/aa0a13e738d2165878111801c5144d18

@aleqx
Copy link
Author

aleqx commented Jun 11, 2018

Ok, I fixed it in this PR #6

Others can use my fork until/unless it gets merged: https://github.com/aleqx/openvpn-netns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant