YunoHost-Apps / vpnclient_ynh

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

Remove DNS resolution for IPv6 route #125

Open hidrarga opened 2 months ago

hidrarga commented 2 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 2 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 2 months ago

!testme

yunohost-bot commented 2 months ago

Alrighty! Test Badge

yunohost-bot commented 2 months ago

:worm: Test Badge

hidrarga commented 1 month 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 1 month ago

!testme

yunohost-bot commented 1 month ago

Alrighty! Test Badge

yunohost-bot commented 1 month ago

:worm: Test Badge