2 ms·
This works if both sides has wireguard installed and are in the network, but is there a way to got this to work for any connections from the internet? eg. your
by gruez 6y ago
This works if both sides has wireguard installed and are in the network, but is there a way to got this to work for any connections from the internet? eg. your VPS has ip 1.1.1.1, you want any traffic that goes to 1.1.1.1 to go to the wireguard interface on your PC, and any traffic set from the wireguard interface on your PC exits through 1.1.1.1. Bonus points if set it up in such so that the interface address on your PC shows up as 1.1.1.1.
- aftbit 6y agoYes this is relatively straightforward to accomplish via iptables pre&postrouting rules. I think the key insight is to realize that you're basically asking for NAT with DMZ: Internet -> [eth0] WG BOX [wg0] -> [wg0] HOME SERVER analogous to: Internet -> [eth0] ROUTER [eth1] -> [eth0] HOME SERVER
- zokier 6y agoYou probably want to have two (or more) interfaces (eni in aws lingo) on the wg server so that you dedicate one for this tunneled traffic. Also you probably want to setup some sort of NAT instead of just routing packets directly.
- zokier 6y agoThat was kinda the article I was expecting to read, so I was very confused when it didn't actually go there.