theinvisible / openfortigui

VPN-GUI to connect to Fortigate-Hardware, based on openfortivpn
https://hadler.me/linux/openfortigui/
GNU General Public License v3.0
492 stars 54 forks source link

systemd.resolved resets /etc/resolv.conf and connection is lost. #41

Closed cdysthe closed 4 years ago

cdysthe commented 6 years ago

On systems using systemd.resolved the connection breaks when systemd resets resolv.conf to default. It happens after a few miinutes.

Replacing systemd.resolved with another resolver the problem is solved, but it would be good if OpenFortiGui could work with systemd.reolved since more and more systems are using it (Ubuntu 18.04 is one).

theinvisible commented 6 years ago

Hi,

thanks for your report.

As i didnt tested 18.04 in detail i cannot say anything about this right now. Nevertheless setting DNS relies on openfortivpn, so i will forward this.

Regards Rene

DimitriPapadopoulos commented 6 years ago

@cdysthe Could you try the following settings?

These options work for me when running openfortivpn 1.7.0 from the command line on Ubuntu 18.04. See adrienverge/openfortivpn#332.

DimitriPapadopoulos commented 6 years ago

@cdysthe Did this help?

theinvisible commented 6 years ago

As of version 0.7 the new openfortivpn style is used for setting DNS. Also i still dont have a 18.04 machine running here but will come soonest.

boospy commented 6 years ago

@theinvisible Maybe my new wikientry help you to solve the problem: https://deepdoc.at/dokuwiki/doku.php?id=server_und_serverdienste:systemd-resolved_durch_dnsmasq_ersetzen

edmundlaugasson commented 2 years ago

Issue persist in OpenfortiGUI 0.9.5. After disconnecting, the /etc/resolv.conf is empty if Set DNS parameter is enabled. When disabling it, actually DNS will be set :) If enabled, /etc/resolv.conf will be empty after disconnecting VPN. If not set, /etc/resolv.conf contains proper DNS-server, either if VPN is connected or disconnected. At the same time Options > PPPD > PPPD no peerdns is not selected by default. Sounds like it does its work. In current case using EndeavourOS (closely based on Arch Linux)

DimitriPapadopoulos commented 2 years ago

File /etc/rtesolv.conf is not necessarily relevant on modern Linux machines. I suggest you focus on whether DNS resolution works or not. To make sure DNS resolution works, try both:

It would help if you could post actual command outputs and file contents instead of describing them, it would be easier to follow.

edmundlaugasson commented 2 years ago

Certainly, when addresses are opening, name resolving works and vice versa. In current case just resolvconf is used (second command systemd-resolve does not work). I understand, that current issue is related with systemd.resolved but as a result Internet connectivity is broken also in case of resolvconf. Luckily I found the Set DNS parameter (while No peerdns was already turned off by default) to turn off in order to get it work. Just mentioning, that it was not intuitive to catch this initially.

DimitriPapadopoulos commented 2 years ago

It would help if you could post actual command outputs and file contents instead of describing them, it would be easier to follow.