LAB: Simple firewall on Kali (or Ubuntu or Debian)
Let's try setting up a simple firewall on Kali to block access to all ports on Kali except for whichever ports we want.
You'll need to do a bunch of internet searches to answer the questions today. If you can't get answers fairly quickly, feel free to ask me. LLMs are fair game.
A little background:
- From 2001-2013, the Linux kernel used a system called
iptablesto control the flow of packets. There is still a command namediptables, which is pretty hard to use without knowing a lot about how the underlying system works. - In January 2014, Linux started using a new packet filtering system called
nftables, which remains in the kernel in 2025. - There's a command called
nftthat helps us manipulate the behavior ofnftables. We will use this command. - There's also a command named
ufwwhich provides a simpler user interface for managingnftables, but it's not installed by default on Kali (or on lots of other Linux systems). You will definitely see references toufwonline if you're searching fornftablesguidance, so if you want to use it, go ahead and install it on your Kali VM.