Live data from Hacker News

WireGuard: Beyond the most basic configuration

sloonz.github.io

71–80 of 115 posts

Re: WireGuard: Beyond the most basic configuration

#71

No RBAC is sad, though understandable. Wireguard is so much faster than OpenVPN. We use Wireguard for S2S but unfortunately need OpenVPN for our employees and contractors due to RBAC. All posts and writeups we've found trying to shoehorn RBAC into Wireguard ultimately ends up with people saying "don't do this."

I like Defguard for this https://defguard.net/

Re: WireGuard: Beyond the most basic configuration

#72

Earlier quoted context omitted.

I've tried many times to setup PowerDNS and never complete it because I get bogged down in the complexity. I saw they had an ansible / terraform script for deployments. Do you just use the team's docs or something else?

Yeah just the PDNS docs. They're excellent. I'll admit my personal setup isn't particularly complex, but I'm not sure how much more complex it can get. I've just got an authoritative server for `lan.` and two secondaries, all 3 using sqlite as their database. I just added their debian repo and apt install'd the two packages (dnsdist and pdns-server). Set the respective config files appropriately (dnsdist is a little…

Cool! I'll have to try once more. That sounds a lot more reasonable than going straight to postgres.

Re: WireGuard: Beyond the most basic configuration

#73
post #27
post #21

Earlier quoted context omitted.

Can't you do that with a prerouting firewall rule? Genuinely asking, never tried myself but seems plausible.

There are a number of ways you could handle this, but none of them make wireguard seem user friendly for this use case. If you're using WireGuard for point to point or to access a specific subnet, this isn't an issue. But a common use case is to use WireGuard like you'd use Mullvad or Nordvpn and tunnel all traffic through it. And if you need exceptions for private address ranges or specific services, you end up havi…

Ah right.

Yeah it would be nice to have a negated allowed ips list, or adding an ! to signify "not this one". Wonder how difficult that would be to implement.

Re: WireGuard: Beyond the most basic configuration

#74
post #26
post #2

Setting up a dynamic DNS record to map a hostname to my home network’s dynamic IP actually makes private VPN usable. It’s really a game changer to be able to access all the local services and resources on the road without exposing them to the public internet.

Just give in and use tailscale, life is so much better on the dark side!

Staying with Wireguard. The article, by the way, is about Wireguard, not an opinion piece comparing alternative technologies.

Re: WireGuard: Beyond the most basic configuration

#75

One that I could not get to work properly with Wireguard is port-forwarding without masquerading. I need the source IP to remain intact, but unless I add 0.0.0.0/0 to the AllowedIPs, the Wireguard peer will drop the packet. If I do add 0.0.0.0/0 to AllowedIPs then it adds a route which prevents the response from my application to go back to the source. Eventually gave up on it. Nobody had a clue how to fix this or wh…

When a public Internet client connects to my VPS, WG routes the port traffic like 443 to the WG client here at home, then through Apache reverse proxy then to a node in my kube cluster running a spring boot app which is my main site. The logs shows the IP of the incoming public Internet client.

The response is routed all the way back out to the Internet client.

Is what I'm describing not achieving what you're discussing?

Happy to post a sanitized version of my server and client config.

Re: WireGuard: Beyond the most basic configuration

#76
post #60

Earlier quoted context omitted.

I agree that would be useful. I'm fairly sure it is because all the entries in `AllowedIPs` are just written as-is to the routing table, and the routing logic in the kernel (and most/all routers?) has no facility for 'does not match'. Instead the solution would be to add a explicit route to state where the excluded CIDR should be sent to. That would would be more specific and would therefore be used for matching pack…

To me this is actually one of the attractive aspects of Wireguard compared to some other VPNs, it doesn't try to manage everything within the tool and delegates to the host's normal routing mechanisms. However it still by default conflates AllowedIPs and the routing table -- you can actually separate them (Table=off with wg-quick) and then manually add routes.

I agree completely with the sentiment, though I never actually mess with the routing tables.

Re: WireGuard: Beyond the most basic configuration

#78
post #20
post #9

I had hoped that this included a way to configure wireguard to get clients from some other place: It would be really nifty if you could configure it to read from LDAP or similar.

Tailscale (also using wireguard for transport) and similar overlay networks kind of do that. With Tailscale there is a central server, you can sign in with single-sign-on, that server enables automatic mesh configuration and helps nodes communicate specifics for port knocking, routing, dns, etc. And there are derp servers (think of them like TURN servers) that can be used as proxies when direct communication can't be…

With Wireguard I own or control everything. Why would I surrender any of that to Tailscale?

Re: WireGuard: Beyond the most basic configuration

#79
post #6

I've always been slightly puzzled about why there isn't an easy built-in way to tunnel all traffic (ie, AllowedIPs = 0.0.0.0/0, ::/0) EXCEPT for some specific IPs. You end up having to programmatically generate a massive list of CIDRs that include everything except those specific IPs.

See https://github.com/tailscale/tailscale/issues/11717#issuecom...
Post reply on HN