[SOLVED] how to open a port to a single application?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[SOLVED] how to open a port to a single application?
I want to host a game server, so I have to open a port in the firewall, right? But I'm scared of leaving it too wide open. gutf lets me open for some preconfigured applications (like Transmission), or open a specific port (without limiting the access through that port). There's also the possibility of opening not a specific port, but for a specific service... but I have no idea how all those names in /etc/services relate to my situation.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: how to open a port to a single application?
All the examples you give just open a port (or more than one). If you pick a preconfigured application, it will open the ports needed by that application. If you pick a service, it will open the ports needed by that service. The firewall just discards unsolicited traffic on closed ports, and lets through unsolicited traffic on open ports. If you don't have a (any) program running that is listening on that port, nothing bad happens. You should generally not use a port below 1024 for purpose like game servers, as ports below 1024 are generally reserved for specific services (like port 80 for your web server). You can check which TCP and UDP ports are being listened to with:
Pick a port number above 1024, one that isn't shown in that list, and you should be fine with opening that port and running your game server on it. There is also a register of known ports being used by specific programs: http://www.iana.org/assignments/service ... umbers.xml. If you don't have those programs running, you can use their ports.
Code: Select all
sudo ufw show listening