Alright, so the other day, I was messin’ around, trying to get a quick thing working with Netcat, you know, good ol’ nc. Super handy tool, I use it for all sorts of quick tests and simple data transfers. This time, I was trying to set up a listener on one of my boxes. Simple stuff, right?

So, I fired up my terminal. Typed out the command, something like nc -l -p 1234
. Standard procedure. I expected it to just sit there, waiting for a connection. Then I went to another machine, tried to connect to it. And… nothing. Just crickets. The connection would just hang, then time out. Frustrating!
My first thought was, “Did I type the IP address wrong?” Checked that. Nope, IP was correct. “Is the network down?” Fired off a ping. Ping worked fine. So, the machines could see each other. What gives?
I spent a good few minutes scratching my head. I retyped the nc command on the listening end, just in case I’d fumbled the port number or something. Nope, all good. Tried a different port. Still no dice. It’s always the simple things that trip you up, isn’t it?
The “Aha!” Moment
Then it hit me. Like a ton of bricks. The firewall! I’m running Ubuntu on that box, and a while back, I’d set up UFW – Uncomplicated Firewall. Or as I was calling it in my head at that frustrating moment, “UFC” because it felt like I was in a fight with my own setup! Sometimes these things just slip your mind when you’re focused on the task at hand.
So, here’s what I did next, step-by-step, to wrestle with this “UFC” thing:

- First, I needed to check its status. Opened a new terminal on the server box. Typed in
sudo ufw status
. And bam! There it was:Status: active
. Yep, the firewall was up and running, doing its job a little too well for what I wanted at that moment. - Next, I realized I hadn’t explicitly allowed traffic on port 1234. UFW, by default, is pretty restrictive if you’ve set it up that way. Good for security, annoying when you forget.
- So, the fix was pretty straightforward. I just needed to tell UFW to allow incoming connections on that specific port. The command for that is simple enough:
sudo ufw allow 1234/tcp
. I specifically wanted TCP for this nc connection. - After running that, UFW kindly told me
Rule added
. Always good to see that confirmation.
Back to Netcat
With the firewall rule in place, I went back to my original plan. Started the nc listener again on the server: nc -l -p 1234
.
Then, fingers crossed, I went to the other machine and tried to connect again. And boom! Connection established. Just like that. Data started flowing, or well, it would have if I was sending anything more than a test string.
It’s funny, really. You can spend ages troubleshooting complex stuff, and then sometimes it’s the basic security layer you set up yourself that catches you out. A good reminder to always check the simple things first – network, typos, and yes, the ever-present firewall. That “UFC” can really throw a punch if you’re not looking!
So yeah, that was my little adventure with nc and dealing with what I momentarily, and frustratingly, dubbed “UFC”. All sorted in the end. Just another day in the life, I guess. Keep it simple, and don’t forget your firewall rules!