how to set gufw/ufw firewall rules ?

spdxyz

New Member
Joined
Oct 14, 2024
Messages
4
Reaction score
1
Credits
32
I want to set up through gufw or through ufw directly from the terminal, the next settings from the first print screen.

The second print screen is the one from gufw, if in that gufw window, I must set up these rules.


2.jpg

20241014_065709.jpg
 

Attachments

  • 2.jpg
    2.jpg
    9.7 KB · Views: 54


Make sure UFW is enabled on startup with.
sudo ufw enable

Permit/Deny Ports with
sudo ufw allow/deny port#

Learn to use UFW here.
UFW Information
 
Last edited:
sudo ufw allow/deny port#

UFW Information
2.jpg


Considering this print screen, can you tell me please...

1. How to chose that the rule should be set only for Inbound connection?
2. Just for TCP
3. How to add my ip in that command, or how to add 0.0.0.0.0, for the second command?
4. How to add a range of ports in the command like 0-64000, please?

Thank you.
 
I have read it for many times. It seems that there are no complex commands, for what I am searching for. Thank you.
 
I have read it for many times. It seems that there are no complex commands, for what I am searching for. Thank you.
What do you consider "complex"?
What complex is missing in nftables?

I think it's ufw that lacks complexity and functionality that's present in nftables, it could be you didn't invest enough time because getting to know nft is like learning a new program language, it's fairly advanced and comprehensive.
 
If UFW / GUFW isn't working for what you want have a look at Firewalld.



 
By default, ufw denies all incoming traffic and allows all outgoing

Unless you have something serioulsy complex in nature to contend with, ufw as default takes good care of the vast majority of users.

I am assuming you are relatively new to Linux , and wish to be sure that you are protected.
 
By default, ufw denies all incoming traffic and allows all outgoing

Unless you have something serioulsy complex in nature to contend with, ufw as default takes good care of the vast majority of users.

I am assuming you are relatively new to Linux , and wish to be sure that you are protected.
I've always found the default settings to be enough why change what already works.

As for Firewalld it's the default for Fedora SilverBlue and again defaults seem to be enough.
 
It is a must to add these rules in order for an app to work properly.
It seems that for the first rules the command is:
sudo ufw allow from 141.0.145.180/32 to any port 64297 proto tcp
Unfortunately, for the second rule, it should be something like that, but it doesn't work:

sudo ufw allow 0:64000/tc
ERROR: Bad Port.

Any ideas, please?
Thank you.
 



Top