• 2 Posts
  • 12 Comments
Joined 2 years ago
cake
Cake day: June 12th, 2023

help-circle






  • Your ISP might make you go through another layer of NAT. Can you find the WAN IP address of your router and compare it to your public IP address from a website such as ipinfo.io ?

    If they do not match, you’re probably out of luck and will need to forward your port from an actually public IP in order to achieve what you want

    More details : CGNAT (Carrier Grade Network Address Translation) is basically a second router between your router and the public internet. This second router is configured in the same way as your personal one, the main difference being that your ISP fully manages it. From the viewpoint of this second router, your WAN IP is a private IP, and you share one actual public IP with several other customers (the same way all devices on you LAN share one single WAN IP)

    Performing port forwarding from the public internet to your LAN, when behind a CGNAT, would require you to be able to configure a forwarding rule in the ISP’s NAT, which you usually cannot do.






  • Each time you send a packet over the internet, several routers handle this packet without touching the source and destination IP addresses.

    There is nothing stopping him from configuring the VPS in a way that forwards packets from the home server, rewriting the destination IP (and optionally destination port as well) but leaving the source IP intact.

    For outgoing packets, the VPS should rewrite the source (homeserver) IP and port and leave the destination intact.

    With iptables, this is done with MASQUERADE rules.

    This is pretty much how any NAT, including ones behind home routers, work.

    You then configure the homeserver to use the VPS as a gateway over wireguard, which should achieve the desired result.