Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a rather strange problem that I couldn't figure out. On my server, I only enabled port 22 for SSH and port 6000 for an application. The default policies were deny incoming, allow outgoing, and deny routed. I noticed a bunch of [UFW BLOCK] from some external peers and the STP is 6000.
I couldn't figure out why ufw blocked those traffic, I changed the default for incoming to allow. Well, it didn't help. I then changed the default for routed to also allow. So now all incoming, outgoing, and routed are allowed. Still, I am seeing [UFW BLOCK] growing whenever I check dmesg.
I thought by allowing all is essentially not blocking anything. Why does ufw still block the incoming traffic?
I have a rather strange problem that I couldn't figure out. On my server, I only enabled port 22 for SSH and port 6000 for an application. The default policies were deny incoming, allow outgoing, and deny routed. I noticed a bunch of [UFW BLOCK] from some external peers and the STP is 6000.
I couldn't figure out why ufw blocked those traffic, I changed the default for incoming to allow. Well, it didn't help. I then changed the default for routed to also allow. So now all incoming, outgoing, and routed are allowed. Still, I am seeing [UFW BLOCK] growing whenever I check dmesg.
I thought by allowing all is essentially not blocking anything. Why does ufw still block the incoming traffic?
Did you 'ufw reload' after making those changes?
Show us the (relevant part of the) logs, show us ufw configuration, e.g. 'ufw status verbose'.
Use code tags for code & command output (see my signature).
Status: active
Logging: on (low)
Default: allow (incoming), allow (outgoing), allow (routed)
New profiles: skip
To Action From
-- ------ ----
443/tcp ALLOW IN Anywhere
6000/tcp ALLOW IN Anywhere
22/tcp (OpenSSH) ALLOW IN Anywhere
443 ALLOW IN Anywhere
443/tcp (v6) ALLOW IN Anywhere (v6)
6000/tcp (v6) ALLOW IN Anywhere (v6)
22/tcp (OpenSSH (v6)) ALLOW IN Anywhere (v6)
443 (v6) ALLOW IN Anywhere (v6)
Hmmm. My Default reads "deny (incoming), allow (outgoing), disabled (routed)" - yours reads like no firewall at all, tbh.
But I'm no expert.
I also get confused by SPT= and DPT= ...
Anyhow, it looks like it should be working (comparing to my own ufw setup where I succesfully punched some holes).
Only thing more stricter is that you specified the tcp protocol, so check out if your application uses only tcp.
Could it be that it's not UFW or your system's firewall at all, but your router instead?
I always have to open a port both on the server's firewall and the router.
As mentioned, it was "deny (incoming), allow (outgoing), disabled (routed)". I was trying to test why ufw blocked the incoming traffic so I changed it to "allow". The strange things is, like you pointed out, this is essentially no firewall. However, ufw still blocks some incoming traffic.
I believe SPT stands for "source port" and DPT stands for "destination port". So basically the incoming packets were from source:6000. From the message, I also think that opening only tcp should be sufficient. The block packages were using tcp (PROTO=TCP).
I have a physical firewall. However, since the dmesg says "[UFW BLOCK]", I think it is from ufw.
At this point, I have turned off ufw on my server because I have a physical firewall and this server is inside a private network. I don't think it is a huge concern from being attached from outside. The only ports that are opened, as you can see, are 443, 6000, and 22.
I simply want to learn and understand why ufw is blocking those packages.
Maybe start with a fresh ufw profile.
Should default to deny incoming.
Then read the docs, and try punching a hole again.
Keep in mind that ufw has different commands to add opening rules: "allow,insert,prepend" and obviously they do different things.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.