
How to Run WireGuard Behind Starlink: CGNAT, Relay Options and Safe Testing
Tips & Tricks
WireGuard is a good fit for a Starlink connection when you plan the direction of the tunnel first. A device on your Starlink network can usually make an outbound connection to a reachable peer. The harder case is an outside device trying to start a connection into your home, because Starlink IPv4 service may use carrier-grade NAT (CGNAT).
That is a reachability problem, not automatically a WireGuard or Starlink failure. This guide shows how to choose a topology, test it in small steps and keep a clean rollback path.
Before you configure anything
Write down these details:
- Which side is the WireGuard server, and which side will initiate the connection?
- Do you need access to one device, one LAN subnet or all internet traffic?
- Does the Starlink connection have a publicly reachable IPv4 address, working inbound IPv6, or neither?
- Which device is the only routing owner for the home LAN?
- What is your rollback path if the tunnel changes DNS, routes or remote access?
Make sure the two networks use different private ranges. For example, a home LAN of 192.168.50.0/24 and a remote LAN of 192.168.60.0/24 can be routed clearly; overlapping ranges make a tunnel look broken even when the handshake is healthy.
Export or note the current router configuration before changing it. Do not begin by changing Starlink settings, putting multiple routers into bridge-like modes, or opening several UDP ports at once.
Choose the topology that matches the problem
Starlink device as the client
This is the simplest arrangement. A laptop, phone or router on Starlink initiates a tunnel to a WireGuard server at an office, cloud host or another reachable site. The home device makes an outbound connection, so an inbound port forward at the Starlink location is normally not required.
Use only the remote subnet in AllowedIPs while testing. Add 0.0.0.0/0 for a full-tunnel design only after you have confirmed that the remote endpoint can provide internet access, DNS and enough upload capacity.
Remote device needs to reach a home WireGuard server
This design needs a reachable endpoint at home. A Starlink IPv4 address behind CGNAT cannot receive a normal inbound port forward from the public internet. If your service provides a genuinely reachable IPv4 address, forward one UDP port to the WireGuard host through the one device that owns routing. If you use IPv6, apply an explicit firewall rule and allow only the peers and ports you need.
If the home service is behind CGNAT and has no usable inbound IPv6 path, use a reachable cloud server as a WireGuard hub, or choose an overlay system designed to traverse NAT. The cloud hub should route only the home subnet required by the remote peer. Do not treat a random port-forwarding rule as a solution to CGNAT.
Two Starlink sites need private access
Use a hub-and-spoke or site-to-site design with non-overlapping LAN ranges. Decide which peer initiates, route only the approved subnets, and document which router forwards traffic between the tunnel and the LAN. Keep the Starlink internet path separate from the private routes so a tunnel outage does not accidentally become a whole-site outage.
Build the first peer conservatively
Create a key pair for every peer and keep private keys on the device that uses them. Give each WireGuard interface a small tunnel range that does not overlap either LAN. Use a unique peer configuration rather than copying one profile between phones or laptops.
For the first test:
- Set the remote endpoint to a hostname or address that is known to be reachable.
- Use a narrow
AllowedIPslist for the tunnel subnet and one remote LAN subnet. - Keep DNS unchanged until the tunnel can pass traffic by address.
- Add
PersistentKeepalive = 25on a peer that sits behind NAT when it must remain reachable after idle time. Use it only where needed. - Start with the device's normal WireGuard MTU. If the handshake succeeds but larger traffic stalls, test a lower MTU in a controlled change rather than changing several network values together.
If Starlink is connected through a third-party router, confirm whether the Starlink router is routing, bypassed, or acting only as an upstream handoff. Two active routing owners can create confusing paths, especially when the WireGuard host is behind both devices.
Validate in this order
Test from a device that is definitely using Starlink Wi-Fi or Ethernet, not mobile data:
- Confirm the normal Starlink connection works without the tunnel.
- Bring up WireGuard and check that the latest handshake timestamp updates.
- Ping the tunnel address of the other peer.
- Test one approved LAN address, such as a router or server that should be reachable.
- Test a normal TCP or HTTPS connection to the intended service.
- Test DNS only after address-based traffic works.
- Move the client to a different network, such as mobile data, and repeat the same checks.
- Leave the tunnel idle, then test again to catch NAT timeout problems.
- Run a short file transfer or application test. Do not start with repeated speed tests because they consume data and do not prove that the route is correct.
- Disconnect the tunnel and confirm that ordinary Starlink browsing still works.
A successful handshake proves that encrypted packets reached the peer. It does not prove that the peer is forwarding traffic to the intended LAN, that return routes exist, or that DNS is correct.
Fix the symptom, not the whole network
- No handshake: check the endpoint address, UDP port, keys, clock and whether the receiving side is actually reachable. If the home endpoint is behind CGNAT, stop adding port forwards and change the topology.
- Handshake works but the LAN is unreachable: check
AllowedIPs, IP forwarding, the LAN firewall and the return route. Make sure the destination device allows traffic from the tunnel range. - Tunnel address works but names do not: check DNS separately. A full-tunnel peer may be sending DNS to a resolver that is not reachable through the chosen route.
- Small requests work but larger pages or transfers stall: investigate MTU and path fragmentation. Change one value, repeat the same test and keep the smallest change that solves the problem.
- The tunnel works after connecting but fails after idle: use a suitable keepalive on the NAT-side peer and check whether the endpoint or firewall expires UDP state.
- The tunnel is slow: test the remote backhaul, CPU limits, Wi-Fi path and whether a full-tunnel configuration is sending every household device through the remote site.
Keep a safe rollback
Before leaving the setup in service:
- Save a copy of each peer configuration without exposing private keys in screenshots or support requests.
- Record the old DNS, routes, router mode and firewall rules.
- Remove test port forwards and temporary wide
AllowedIPsentries. - Disable the peer and verify normal Starlink browsing still works.
- Keep one local management path that does not depend on the tunnel.
- Change one setting at a time when troubleshooting, and write down the result.
The short version
WireGuard can work well with Starlink, but the first question is reachability. An outbound client tunnel usually avoids the CGNAT problem. A home server that must accept inbound connections needs a publicly reachable path, IPv6 with an appropriate firewall, or a reachable relay or hub. Start with narrow routes, validate the handshake and LAN access separately, and keep rollback steps ready before widening the tunnel.
This approach gives you a working testable path without assuming that a port-forwarding rule can defeat CGNAT.