Score:0

ufw exclude internal IPs from logs

gb flag

I have a test HTTPS server running on Linux server (Ubuntu 20.04.4) on port 20000. I would like to log all connections on this port. So I did this, and it works fine.

ufw allow log-all 20000/tcp

Now, I would like to exclude any local IP connections from logs related to this rule. How can I do that?

Score:0
gb flag

I think I figured it out. Not sure if this is the recommended way to do it, but I inserted another rule above the "log-all" rule.

sudo ufw insert 4 allow from 192.168.1.0/24 to any port 20000 proto tcp

This rule doesn't do any extra logging, and since it is before the other one all the local IPs allow connection with no logs. So, here's what my rules look like now

To                    Action              From
---                   ------              -----
....
20000/tcp            ALLOW IN           192.168.1.0/24
20000/tcp            ALLOW IN           Anywhere           (log-all)
....
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.