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

[BUG] connman: DNS broken #6233

Open
3nprob opened this issue Feb 14, 2022 · 1 comment
Open

[BUG] connman: DNS broken #6233

3nprob opened this issue Feb 14, 2022 · 1 comment

Comments

@3nprob
Copy link

3nprob commented Feb 14, 2022

Describe the bug

It seems to me that DNS support for Wireguard VPN is not working.

To Reproduce

Connect to Wireguard VPN when already connected to DHCP-enabled wifi network:

$ cat /storage/.config/wireguard/myvpn.config
[provider_wireguard]
Type = WireGuard
Name = WireGuard VPN Tunnel
Host = 1.2.3.4
Wireguard.Address = 10.1.100.121/24
Wireguard.ListenPort = 1234
Wireguard.PrivateKey = foo
Wireguard.PublicKey = bar
Wireguard.PresharedKey = baz
Wireguard.DNS = 10.1.100.2
Wireguard.AllowedIPs = 10.1.100.0/24
Wireguard.EndpointPort = 2345
Wireguard.PersistentKeepalive = 30

$ connmanctl  connect vpn_1_2_3_4
Connected vpn_1_2_3_4

$ wg
## Connected, data transfering in both directions.

$ nslookup foo.mydomain.com 
(does not work, looks up using ISP DNS acquired via DHCP)

$ nslookup foo.mydomain.com 10.1.100.2
(resolves correctly)

$ cat /etc/resolv.conf
# Generated by Connection Manager
nameserver $ISP_DHCP_DNS

So it seems connman ignores the desired DNS from wireguard.

I suspect the -r here is the reason:

ExecStart=/bin/sh -c ". /usr/lib/connman/connman-setup; exec /usr/sbin/connmand -nr $CONNMAN_MAIN $CONNMAN_DEBUG"

If the -r is removed, connman would instead run a local DNS proxy and keep track of DNS config properly.

It would be great if at the very least this could be made overridable by env vars (or just re-enable connman's built-in DNS functionality?)

Informations

  • LE Version: 10.0.1
  • Hardware Platform: Rpi400
@3nprob
Copy link
Author

3nprob commented Feb 14, 2022

Overriding connman.service with a version sans -r and DNS over VPN works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants