@kirbius I would move wireguard from the router to individual servers. That migh...
Phantasm @phnt@fluffytail.org
@kirbius I would move wireguard from the router to individual servers. That might be beneficial if you will be relaying protocols that don't support metadata from where a request/packet got forwarded and for whom (HTTP does, TCP and UDP do not).
If you do AllowedIPs = 0.0.0.0/0, ::0/0 on the tunnel on every server and set the tunnel as the default route (the default with wg-quick), you also don't need to worry with running a forwarding proxy anywhere on the network as the servers will see a non-internal IP and route it through the default route (your VPS). At that point all the VPS needs is a firewall rule to NAT packets coming from the wg interfaces and forward them to its own default route. Allowing all IPs on the tunnel is necessary since the IP packets will have their original source IPs and wireguard drops all packets that aren't from allowed IPs. This configuration is usually called a transparent proxy. You can rewrite the source IPs on the VPS to only allow the VPS tunnel IP, effectively NAT it on ingress when proxying it, but you loose information where the packets come from on the home servers, which makes logging harder on protocols where you can't do the equivalent of X-Forwarded-For.
Also I would probably replace relayd with something different (HAPRoxy perhaps). relayd is good enough, but if you need to rewrite certain things in the outgoing traffic, it cannot do that. And the logs it gives you are almost useless.
NOTE: You need to route all outgoing traffic from the home servers through the VPS, which has to NAT the traffic. Otherwise if you run something like a Fedi server, you WILL leak your IP to everyone via outgoing federation.
If you do AllowedIPs = 0.0.0.0/0, ::0/0 on the tunnel on every server and set the tunnel as the default route (the default with wg-quick), you also don't need to worry with running a forwarding proxy anywhere on the network as the servers will see a non-internal IP and route it through the default route (your VPS). At that point all the VPS needs is a firewall rule to NAT packets coming from the wg interfaces and forward them to its own default route. Allowing all IPs on the tunnel is necessary since the IP packets will have their original source IPs and wireguard drops all packets that aren't from allowed IPs. This configuration is usually called a transparent proxy. You can rewrite the source IPs on the VPS to only allow the VPS tunnel IP, effectively NAT it on ingress when proxying it, but you loose information where the packets come from on the home servers, which makes logging harder on protocols where you can't do the equivalent of X-Forwarded-For.
Also I would probably replace relayd with something different (HAPRoxy perhaps). relayd is good enough, but if you need to rewrite certain things in the outgoing traffic, it cannot do that. And the logs it gives you are almost useless.
NOTE: You need to route all outgoing traffic from the home servers through the VPS, which has to NAT the traffic. Otherwise if you run something like a Fedi server, you WILL leak your IP to everyone via outgoing federation.