[SOLVED] how to open a port to a single application?

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
BozoDel

[SOLVED] how to open a port to a single application?

Post by BozoDel »

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.
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: how to open a port to a single application?

Post by xenopeek »

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:

Code: Select all

sudo ufw show listening
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.
Image
BozoDel

Re: [SOLVED] how to open a port to a single application?

Post by BozoDel »

Thank you, dear!
Locked

Return to “Networking”