Live data from Hacker News

The Holy Trinity of WireGuard, Hosts and PiHole

benjamin.computer

1–3 of 3 posts

Re: The Holy Trinity of WireGuard, Hosts and PiHole

#2
>no matter which settings I used, wireguard would not reconnect to the server if the gateway changed.

I have the exact same arrangement going for me, family and friends on all devices. Strangely, I find Wireguard reconnects seamlessly no matter which network/gateway I use or which network I hop on to. I havent done anything special either, just the normal config and firewall rules to keep it away from bots.

Re: The Holy Trinity of WireGuard, Hosts and PiHole

#3
> I use port 443 as it's rarely blocked. This does mean the server can't really run a https server but that's fine for now.

Note that Wireguard only uses UDP.

---

> One thing I haven't quite figured out is how the routing works in depth. Quite often, local LAN traffic is also sent over wireguard too, which isn't very efficient at all. I'm still working that out but I believe it's something to do with the AllowedIPs setting.

Yes, the {great,bad} thing about computers is that they do what you tell them to do.

You should probably RTFM^Wtake a look at the wg(8) man page [0]. It explains all of the various fields that you can use in the configuration file. For example:

  AllowedIPs — a comma-separated list of IP (v4 or v6)
  addresses with CIDR masks from which incoming traffic for
  this peer is allowed and to which outgoing traffic for this
  peer is directed. The catch-all 0.0.0.0/0 may be specified
  for matching all IPv4 addresses, and ::/0 may be specified
  for matching all IPv6 addresses. May be specified multiple
  times.
---

> One important issue reared it's ugly head when I was setting up redundancy. Once my internet had been repaired, I began setting up a second backup internet gateway; ... Hopefully, someone else will come up with a better idea in the future.

Unless you can provide more details than that, I doubt it. There's about a dozen things it could be and, well, no one can read your mind. Additionally, it seems that all of the crystal balls stopped working too (likely because ... clickity click ... we're at the low point of the ~11 year sunspot cycle).

---

WRT your laptop's DNS "resetting the DNS" issue, well, I suspect you'd find the solution in the dhclient.conf(5) man page, if only you bothered to look.

---

In the future, I would highly recommend reading the documentation for the tools you intend to use instead of using whatever random hacks you happen to stumble upon.

Good luck.

---

[0]: https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8