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

Issue connecting to Wireguard Linux ubuntu 18.04 #1434

Closed
ilyas95 opened this issue Aug 28, 2018 · 19 comments

Comments

Projects
None yet
7 participants
@ilyas95
Copy link

commented Aug 28, 2018

When I try to connect to the server by using sudo wg-quick up configfile I get the following as output:
[#] ip link add configfile type wireguard
[#] wg setconf configfile /dev/fd/63
[#] ip address add 10.192.122.2/32 dev configfile
[#] ip link set mtu 1420 dev configfile
[#] ip link set configfile up
[#] resolvconf -a configfile -m 0 -x
/usr/bin/wg-quick: line 31: resolvconf: command not found
[#] ip link delete dev configfile

I tried to look inside the file /usr/bin/wg-quick but I cannot find the problem
Someone had this problem?
I'm sure the problem is not the server because I'm able to connect with my android phone

@nopdotcom

This comment has been minimized.

Copy link
Collaborator

commented Aug 28, 2018

Which version of which Linux?

@ilyas95

This comment has been minimized.

Copy link
Author

commented Aug 28, 2018

Ubuntu 18.04 LTS (Bionic Beaver)

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2018

I was just about to submit an issue for this. I can confirm that on a stock install of Ubuntu 18.04 you will get this output. I'm pretty certain that the issue is caused by the fact that Ubuntu 18.04 doesn't ship with a version of resolvconf.

nick@Builder:~$ resolvconf
Command 'resolvconf' not found, but can be installed with:
sudo apt install openresolv
sudo apt install resolvconf

@ilyas95, if you'd like a quick fix please install 'resolvconf' with the following command.

sudo apt install openresolv

And then try to run sudo wg-quick up fluid-bike. I believe the correct package to install is 'openresolv' because the default 'resolvconf' does not contain the flags in the script as seen below:

resolvconf -a blah.blah-blak -m 0 -x

resolvconf does not contain the '-m' or '-x' flags.

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Aug 31, 2018

@nopdotcom, considering that Ubuntu holds a large share of the Linux desktop market, do you think it would be a good idea to include instructions related to installing resolvconf? I'd be happy to submit a PR. I have also ensured that I'm not leaking DNS by running it this way.

@ilyas95

This comment has been minimized.

Copy link
Author

commented Sep 1, 2018

@Frichetten
It worked, thank you
I installed openresolv as you suggested: the only problem is that I'm leaking DNS, should I switch to resolvconf to solve it?

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Sep 1, 2018

I wouldn't recommend it. (I had problems while testing with 'resolvconf'). Do me a favor, could you run cat /etc/resolv.conf and see what the outout is? (Don't post it online because it should contain your servers IP address).

If it contains anything other than the IP of your server, we need to fix that. If it does have the right IP the next step would be to run the same command on the server and see what that output is.

As a side note, what VPS provider are you using?

@ilyas95

This comment has been minimized.

Copy link
Author

commented Sep 5, 2018

The resolv.conf on the client (ubuntu 18.04 lts) doesn't have the IP of the server but only a file with nameserver 127.0.0.53
Same thing for the server: I have a nameserver with a similar IP of the resolv.conf in the host
Do you know how can I fix this?
Thanks

@z0rc

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2018

127.0.0.53 is local systemd-resolved daemon, that installed by default in Ubuntu. I'm not sure that resolvconf supports it or ever will. And in general I believe it's wg-quick missing support systemd-resolved and shoudn't entirely rely on resolvconf.

@z0rc

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2018

As alternative, you don't need a wg-quick and can enable Wireguard in systemd directly. See https://wiki.debian.org/Wireguard#Step_2_-_Alternative_C_-_systemd, please be aware, that this isn't a full guide and it might not work in your case.

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2018

@ilyas95, after you run the wg-quick command (with your configuration) what does /etc/resolv.conf look like? When I have Wireguard turned off my /etc/resolv.conf looks exactly like you mentioned. But when I turn Wireguard on it shows the internal 10.x.x.x IP address of the server.

If you are leaking DNS, we'd need to ensure your system is properly routing DNS queries to the server.

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Sep 5, 2018

@z0rc, thank you for the information! On Ubuntu 18.04 I was able to resolve the issue by installing the openresolv package. I believe the issue is related to the following error in the Wireguard output:

[#] ip link add configfile type wireguard
[#] wg setconf configfile /dev/fd/63
[#] ip address add 10.192.122.2/32 dev configfile
[#] ip link set mtu 1420 dev configfile
[#] ip link set configfile up
[#] resolvconf -a configfile -m 0 -x
/usr/bin/wg-quick: line 31: resolvconf: command not found
[#] ip link delete dev configfile

Wireguard isn't finding the resolvconf command which is not standard to Ubuntu 18.04. Although, I would be interested in how difficult it would be to setup Wireguard in systemd.

@Ronaldkornblow

This comment has been minimized.

Copy link

commented Sep 26, 2018

@Frichetten What is the resolution here?

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2018

@Ronaldkornblow, I'm not sure I understand what you mean?

@Ronaldkornblow

This comment has been minimized.

Copy link

commented Oct 1, 2018

@Frichetten I still cannot connect. Is there any resolution here? @cpu

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2018

Oh sorry, I understand now :) Are you getting the same error as described in the OP? If so, have you attempted to install 'openresolv'?

@Ronaldkornblow

This comment has been minimized.

Copy link

commented Oct 6, 2018

@Frichetten
I was able to get rid of the error above from the install.
I installed openresolv which has stopped my dns from working even with wg not up.

@Frichetten

This comment has been minimized.

Copy link
Contributor

commented Oct 6, 2018

@Ronaldkornblow, I would recommend checking what is in your /etc/resolv.conf. If Wireguard is down, you should be using whatever your default DNS server is. However, when Wireguard is up, it should instead use DNS through Wireguard.

@cpu

This comment has been minimized.

Copy link
Member

commented Oct 20, 2018

@nopdotcom, considering that Ubuntu holds a large share of the Linux desktop market, do you think it would be a good idea to include instructions related to installing resolvconf?

@Frichetten Do you mean openresolv here instead of resolvconf? If so, yes I think a docs PR with this update (or a working WireGuard/systemd-resolver config) would be awesome.

alimakki added a commit that referenced this issue Oct 24, 2018

Updated documentation to fix issue found in Issue #1434 (#1475)
Document the need to install `openresolv` for Debnian and Ubuntu users for WireGuard
@alimakki

This comment has been minimized.

Copy link
Collaborator

commented Oct 24, 2018

Closing as the issue has been been documented by @Frichetten

@alimakki alimakki closed this Oct 24, 2018

martintsch added a commit to martintsch/streisand that referenced this issue Apr 8, 2019

Updated documentation to fix issue found in Issue StreisandEffect#1434 (
StreisandEffect#1475)

Document the need to install `openresolv` for Debnian and Ubuntu users for WireGuard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.