Skip to content

18 months on NAT VPS for game server hosting

VPS Hosting by celiadog 5 replies 537 views
#1

Popped a OVHcloud NAT plan back in 2022, origin was pure desperation after my origin server got priced out. 18 months later, still caching hits on five game instances. The pop? You learn to pop ports like you pop breath mints.

Started with 20 forwarded ports. UDP hole punching for voice chat was 12, sometimes 15, never stable. Then I got creative. Made a community port allocation agreement with my regulars:

  • 30000-30009 voice
  • 30100-30119 game traffic
  • 30200+ ephemeral

Cache hit rate on connections went from miss city to 80%.

Origin story: I run origin off a $3 NAT at RackNerd now. It's 8 to my players, 22 to the nearest pop. No regrets. Pop me questions if you want my allocation spreadsheet.

#2

U r telling me u ran a whole game server wif no public ip lol

11 #3

celiadog said:
Made a community port allocation agreement with my regulars

Can or not ah? 20 ports only for 5 game server, very tight lah. You already find way to share UDP port? I try before, always conflict dong.

#4

Bash
If (ports < 20) {
Echo "technical debt"
Return cronjob_every_5min
}

I bash my NAT config idempotent every morning. `0 6 * * * /usr/local/bin/reconcile-ports.sh` is my lifestyle now. Technical debt was trusting the provider's panel API. Now I cron raw iptables. Beautiful.

Vive la résistance... électrique
#5

celiadog said:
UDP hole punching

RFC 4787 section 4.2: endpoint-independent mapping. Your "creative" UDP hole punching is literally specified behavior. AS path to OVHcloud's prefix is 4 hops from my edge, for what that's worth. Diagram:

[CGNAT]---[Your NAT]---[Game]
|
[STUN server]

Anyone without their own ASN talking about NAT behavior is guessing. I operate two ASes and 6 prefixes. The port exhaustion problem is real but solvable with proper 5-tuple management.

#6

Endpoint-independent mapping on a budget NAT plan? I'd want to see packet captures

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft