Bug 2111343 - wg-quick DNS configuration gets lost if SaveConfig is enabled in the configuration file
Summary: wg-quick DNS configuration gets lost if SaveConfig is enabled in the configur...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: wireguard-tools
Version: 36
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Joe Doss
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-27 06:18 UTC by H.Janssen
Modified: 2023-05-25 16:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-25 16:55:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch to get DNS and Saveconfig combination running in wg-quick (970 bytes, patch)
2022-07-27 06:18 UTC, H.Janssen
no flags Details | Diff

Description H.Janssen 2022-07-27 06:18:26 UTC
Created attachment 1899583 [details]
patch to get DNS and Saveconfig combination running in wg-quick

Description of problem:
DNS= lines disappear from the configuration if SaveConfig=true

Version-Release number of selected component (if applicable):
wireguard-tools-1.0.20210914-2.fc36.x86_64

How reproducible:
Always

Steps to Reproduce:
1.wg-quick up wg0 with DNS= and SaveConfig=true in wg0.conf
2.wg-quick down wg0
3.

Actual results:
DNS= lost in config file

Expected results:
DNS= as before


Additional info:
The save_config routine in wg-quick uses "resolvconf -l " to get a list of nameservers for this interface. This is not supported in Fedora 36. The second try is listing a file which also does not exist in Fedora.

Adding a third try calling "resolvectl dns <interfacevar> " and adapting the output to be equal to "resolvconf -l" with cut and awk fixes the problem. Probably there are cleaner ways to adapt the script to the different distributions.

Comment 1 Joe Doss 2022-07-27 20:21:08 UTC
Hi there,

Have thought about pushing these changes upstream to see if we can fix things at that level vs maintaining a patch on our end? Jason is pretty good about taking patches for these kinds of things.

Joe

Comment 2 Ilkka Tengvall 2022-07-27 20:27:16 UTC
I applied and verified the functionality. It fixes the problem. This topic is discussed here, for background:

https://ask.fedoraproject.org/t/wireguard-client-not-working-even-if-wg0-is-showing-traffic-count/

I'd check if the rpm dependencies cover the tools used in patch, resolvectl, cut, awk.

Comment 3 H.Janssen 2022-07-29 21:54:25 UTC
Thanks. Of course fine to send the patch to upstream. The good thing of the patch is that it is one line and works, the bad thing is that it modifies the output of a command to mimic another command. May be there are better ways to get the info, like a welldefined DBus API.
And it is not guaranteed that systemd-resolved is up in Fedora, so probably it is not easy to program it in a robust way for all environments in all configurations.

Comment 4 Ben Cotton 2023-04-25 17:39:59 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Ludek Smid 2023-05-25 16:55:18 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.