Port Forwarding. What exactly happens in it and how safe is it?

1.00K views

I’m setting up a self hosted Minecraft server and all I have left to do is setup port forwarding. I’m not exactly experienced with this so I was wondering how it works so I understand if I need to “turn off” the port every time after using the server or not and how the “dynamic” ip stuff works

In: Technology

2 Answers

Anonymous 0 Comments

Basically, most home internet connections use a technology called NAT to allow more than one device to share a single public IP address.

One of the restrictions of NAT is that communication has to originate from inside, because the router basically creates a two way tunnel to talk out of, and back into from the webapp.

Port forwarding is used when you need to explicitly open up that forwarding for everyone. Since you’re hosting a server, people are trying to connect in to you, so you have to be listening for them.

Anonymous 0 Comments

The ELI5 version: port forwarding is like having an all mail addressed to you automatically delivered to your room. You can get picky and say, “mom, I only want my Playboy magazines delivered to my room – throw away all of the other ones.” As long as I don’t disguise my junk mail as a Playboy magazine, it won’t get to your room. This assumes that your mother has been correctly told what to deliver and what to throw away.

The technical version:

A) Port forwarding tells your router that any traffic coming in on port 123 needs to be forwarded to port 456 on internal IP address 192.168.1.20. This means that all packets sent to that port will be forwarded on to that internal ip address. It would normally block those requests. If you have your server locked down correctly and your router configured correctly, the only hazard is if there is a vulnerability in that listening application. If you turn off your server or shutdown the application, there shouldn’t be anything listening and nothing bad can happen. You will want your server to have a static IP address internally – you can either configure in on the server as a static or you can use DHCP and tell the router to make it static, so that the router will always assign the same address to the server.

2) I assume you are talking about using a dynamic DNS service for your router. If your router supports dynamic DNS, you will need to set it up, probably create an account with a dynamic DNS service, and then use the DNS name that they provide you as your public server address. If your router doesn’t support it, then you will need to run a dynamic DNS application or service on your server which will ping the DNS service and update your public ip address there.