Setting up a game Server without port forwarding

I’m working on creating a Factorio server at home. My aim is to play on my PC when I’m at home and on my Switch when I’m on the go. The problem I’ve run into is that I can’t port forward the necessary ports, which means I need some kind of intermediary service.

I gave Ngrok a shot, and it worked, but it comes with an issue– it changes the IP address every time it starts up. This means I’d have to adjust the IP address each time I connect to the server. Are there any free services out there that would allow me to access the local server from the internet without constantly changing the IP?

I’d suggest Tailscale, which is a zero config mesh VPN. It’ll give you static IP addresses that are permanently assigned to your devices until if/when you decide to delete them. It’ll take care of the port forwarding issue as well.

Cheapest solution that comes in mind to connect without the need for port forwarding is an abstract network like Netmaker, zerotier or tailscale.

Playit.gg could also be a temporary solution for you.

So there’s a lot of things going on here. For one, do you HAVE to run the server at home? If so, you’re probably going to run into problems even if you have a static
IP but no port forwarding, and that’s assuming you actually have a static IP. If you don’t have a static IP, I think there are some domain-forwarding services that run as daemons on your sever and update their server’s knowledge of your WAN IP.

That being said, without port forwarding, I’m not sure any traffic incoming to your router will actually be sent to the correct address on your LAN…

I heard that ngrok now offers the possibility of a static domain, give it another try maybe.

Dynamic dns, plenty of places offer free options.

There’s a number of different options ranging in complexity, setup time, and hardware cost in my mind. For starters we assume that the only requirement is that you need your Switch to be able to reach the game server running in your house. A lot of what you can/can’t do with your router may determine how much additional hardware is needed in this setup.

The first issue to address for consistency is your IP address, which is probably set dynamically by your ISP. This makes anything you do difficult. I would set up Dynamic DNS (DDNS) - you can do this for free with a service like DuckDNS, and many routers have an in-built option for updating the DNS server with your current IP if it changes. This basically lets that IP address change around while you hit a consistent domain name (for example, if you use DuckDNS, it could be creativemode1352.duckdns.org).

Once you have that consistent address to your house, you need some way to get in, which is where a VPN makes the most sense. By using a VPN tunnel, you shouldn’t need to forward any ports to that specific game server host… although I fail to recall if the VPN server needed a port forward to its listening port. The VPN server would be in your house.

It’s not completely easy, but I use Wireguard and it works well enough (again, free). If you don’t have an Ubuntu/Linux box lying around then you could run it in a VM. Disclaimer: you may need to set up static routes out so that when you full tunnel, you see those devices. Hopefully your router has a setting for that.

If at this point or anything before your router isn’t working, then you may want to purchase an actual router/firewall appliance, or build your own (I.e. with OpnSense, pfSense). You can set whatever the ISP gives you to be in Bridge mode so that it just functions as a simple modem. This may or may not require buying a separate Wireless AP as well.

From there you can remote into your house, but there’s a bit of an issue here… the Switch doesn’t have a VPN client on it. In this case, you broadly have two options: use an existing device as a mobile hotspot (Windows PC, phone), or get a dedicated device that essentially creates a mobile VPN wireless access point. Whatever that device is, the idea is that it VPNs into your house, and just allows your Switch to connect through it.

As icing on the cake if you get this all set up: you can manage the power state of your physical server through Wake on LAN, if that PC has a hardwire network card to your router. That will allow you to boot the PC from sleep/shutdown, and you could have startup tasks to initialize the game server.

Since it’s port 34197 I have to ask, what is stopping you from forwarding it?

Wireguard and duck dns.

If I remove a device and readd it, does it have capability to give it the previous ip address/a custom one?

You could also use zrok.io. It’s an open source alternative which can be self-hosted or has a free SaaS (incl. static domains). It also includes cool features like ‘private sharing’. I work on the parent project.

It’s my understanding that it’ll reassign a new one. However, the device can be accessed by its DNS name as well which can be the previous one.

The documentation will clarify the matter:

This feature helps a lot. Basically you can use the hostnames (or manually rename them) to use as the server address. Then instead of using IPs you can use DNS like namelessaregoats.yyyy.ts.net