Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

resolv.conf when turning off wireguard vpn

This probably isn't the best way to handle things, but because I use both connman and wireguard on a laptop that I take on the road, I have this snippet in my /etc/wireguard/wg0.conf:

[Interface]
DNS = 192.168.1.1,192.168.1.2, ipa.internal.com, vm.internal.com, remote.internal.com, internal.com
PostUp = ln -sf /run/resolvconf/resolv.conf /etc/resolv.conf
PostDown = ln -sf /run/connman/resolv.conf /etc/resolv.conf

This forces my resolv.conf to use whatever resolvconf generates, which wireguard uses. And wireguard passes those non-IP address names as the search domains to resolvconf, and of course those nameserver entries.

I should probably bother to learn how to get connman to use resolvconf, or get it to use wireguard.

Further reading

Further research indicates that while Connman has wireguard support, it is incomplete/buggy and I will stick to my current methods of using it.

  1. Intel's ConnMan Is Ready With WireGuard Support - Phoronix sa.
  2. connman/connman.git - Connection Manager
  3. connman/connman.git - Connection Manager
  4. connman/connman.git - Connection Manager
  5. WireGuard - LibreELEC.wiki#known-issues

Comments