1

I have 2 homes: home1 is using an ISP with CGNAT, home2 has a public ip address.

I'd like to be able to connect from anywhere to a Wireguard VPN server from home1 (SH1) and use that connection to route all traffic to the internet, not just the internal network.

In home2 I have another server behind a firewall (SH2) to which I can forward all traffic and I'm running also a wireguard server.

SH1 has let's say the private ip address 192.168.100.10 SH2 has let's say the private ip address 192.168.10.10 SH2 vpn address is 10.0.0.1 SH1 vpn address (connected to SH2) is 10.0.0.2

I thought I could forward the traffic from the firewall in home2 to SH1 to SH2 (connected to SH1 via vpn).

So from the SH1 I can connect to the SH2. Where I always failed is that I couldn't forward traffic from the SH2's private ip address to SH1's vpn address.

What iptable rules or settings should I use to forward the traffic from a vpn server to a vpn client?

5
  • Does the VPN have to be Wireguard specifically?
    – grawity
    Commented Apr 8, 2022 at 11:21
  • I don't like OpenVPN's performance
    – Auras
    Commented Apr 8, 2022 at 12:38
  • You cannot typically port forward traffic on a port to your own device when you are behind a CGNAT. Did OpenVPN actually work on the home1 network
    – Ramhound
    Commented Apr 8, 2022 at 13:04
  • @Ramfound home1 has a tunnel to home2. There should be a way to forward the traffic over that tunnel
    – Auras
    Commented Apr 8, 2022 at 14:03
  • You should add in the question your currently attempted setup with SH1 and SH2's WireGuard configurations (usually: wg0.conf, feel free to obfuscate keys), as well as their observed network configuration. For each of them (once WireGuard is running and SH1 can ping SH2 over WireGuard): ip -br link; ip -4 -br address; ip route; ip rule, along possible iptables rules twice too: iptables-save -c. With that it would be much easier to figure out what's missing, since the idea sounds fine.
    – A.B
    Commented Apr 23, 2022 at 8:01

0

You must log in to answer this question.

Browse other questions tagged .