You don't need a firewall on the LAN. It is just an annoyance to have to open ports later. Extra bureaucracy without benefits. This isn't Windows, you can can easily control your processes, choose if they bind to the network interface and on which port.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Lots of good answers here but I'll toss in my own "figure out what you need" experience from my first firewall funtime. (Disclaimer: I used nftables -- it should be similar to ufw in terms of defaults though).
- Right off the bat, everything unneeded was blocked. I "needed" no configuration, except for maybe...
- Whatever CUPS runs on (when I use it)
- Sometimes I ran
python -m http.server
-- I unblocked port 8000 for personal use. - I chose to unblock port 53 (DNS). I wanted to connect to another computer via hostname IIRC (e.g. connecting to raspberry-pi.local. I might be misremembering this though).
- At one point I played with NGINX -- that's port 80 (HTTP) and port 443 (HTTPS).
- SSH was already permitted (port 22 -- you need root access to enable traffic through ports below 1024 anyway so this wasn't an issue for running typical apps)
I didn't use WireShark back then, really. I think I just ran something like
sudo lsof -nP -iTCP -sTCP:LISTEN
which showed me a bunch of port traffic (mostly just harmless language servers).
You don't have to dive to deep into all the "egress" and "ingress" and whatnot unless you're doing something special. Or your software uses a weird port. (LocalSend lol)
You shouldn't be touching it, honestly. There's a firewall at your router. It should be responsible for blocking incoming traffic. Firewalls on individual machines are for servers where you know exactly what's going in and out. I don't have a firewall on my desktop or laptop.
You will spend the best years of your life chasing random network connections if you block everything by default.