YunoHost-Apps / vpnclient_ynh

VPN Client app for YunoHost
GNU Affero General Public License v3.0
41 stars 25 forks source link

Remove DNS resolution for IPv6 route #125

Closed hidrarga closed 4 days ago

hidrarga commented 7 months ago

Problem

Sometimes when the VPN client is restarting, the DNS resolution doesn't work anymore (although it works when the VPN is down). I don't know if that's a bug from OpenVPN or if we are missing something in the firewall rules or network configuration.

Solution

I'm using the environment variables provided by OpenVPN : https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables

With this solution, we don't need to store IPv6 of the VPN server in a config variable, which makes the client connection much faster.

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

hidrarga commented 7 months ago

It takes less than 30s on a cube with this method (it was taking more than 60s with DNS resolution issues)

hidrarga commented 7 months ago

!testme

yunohost-bot commented 7 months ago

Alrighty! Test Badge

yunohost-bot commented 7 months ago

:worm: Test Badge

hidrarga commented 5 months ago

I've added some improvements for the firewall rules: when the VPN client is connecting, it provides some environmental variables, such as trusted_ip OR trusted_ip6 variables, but not both at the same time, so I can only create a rule for IPv4 or IPv6... Actually, I don't know if that's a problem?

Otherwise, I could use the variables ifconfig_ipv6_remote and route_vpn_gateway but I'm not sure if they are valid for all clients?

What do you think of this PR @zamentur @alexAubin ?

hidrarga commented 5 months ago

!testme

yunohost-bot commented 5 months ago

Alrighty! Test Badge

yunohost-bot commented 5 months ago

:worm: Test Badge

alexAubin commented 3 months ago

(Ah yes that's listed in the doc you mention : https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/#environmental-variables )