Skip Navigation

Calling all Linux enthusiasts! Help us create a comprehensive guide to Linux firewalls and security!

Hello fellow Linux enthusiasts!

As many of you know, Linux can be a powerful and flexible operating system, but it can also be daunting for new users, especially when it comes to securing their systems. With the abundance of information available online, it's easy to get overwhelmed and confused about the best practices for firewall configuration and basic security.

That's why I reaching out to the Linux community for help. I am looking users who are willing to share their expertise and write a comprehensive guide to Linux firewall and security.

The goal of this guide is to provide a centralized resource that covers the following topics:

 undefined
        Introduction to Linux firewalls (e.g., firewalld, ufw, etc.)
    Understanding basic security principles (e.g., ports, protocols, network traffic)
    Configuring firewalls for various scenarios (e.g., home networks, servers, VPNs)
    Best practices for securing Linux systems (e.g., password management, package updates, file permissions)
    Troubleshooting common issues and errors
    Advanced topics (e.g., network segmentation, SELinux, AppArmor)


  

I am looking for a well-structured and easy-to-follow guide that will help new users understand the fundamentals of Linux firewall and security, while also providing advanced users with a comprehensive resource for reference.

If you're interested in contributing to this project, please reply to this post with your experience and expertise in Linux firewall and security. We'll be happy to discuss the details and work together to create a high-quality guide that benefits the Linux community.

Thank you for your time and consideration, and im looking forward to hearing from you!

72 comments
  • I tried using a guide online one time to build a linux router/firewall onto a passively-cooled mini-computer that I could leave on a shelf with no I/O connected... basically a replacement for the garbo off-the-shelf wifi routers that die every year. It worked...mostly. The problem is that the random little things that didn't work right just were insurmountable for a linux noob who was just trying to follow a guide.

    I hate that spending money on the best ones you can buy STILL die after a year or two. And now they all require you to login so even more people can inspect all my network traffic.

    I'd love to see a guide that's kept up to date for building a simple router/firewall, with sections like you have above for more information so people can unlock ports for unusual stuff or whatever. I mean, in a perfect world, you install a LTS OS and set it up and forget about it for a few years. Mine was like that except it required manual intervention every time it rebooted. If that wasn't the case, it would have been perfect and I would be recommeding it to everyone.

    • Instead of building one from scratch why not simply use one of the already made router operating systems? I would personally recommend opnsense, it has a nice easy to use web UI and can be setup in like maybe 20min.

      as for hardware you can use just about anything but i highly recommend these cute little dedicated router boxes. It is passively cooled, plenty powerful to handle wireguard VPN at gigabit speeds and should easily last you many many years without an issue.

      • That's the kind of box I've been using. Just been running linux on it. It's been a few years, I'll look into opnsense, thx.

    • Use openwrt on a existing device

      • My issue is that the cheapo consumer hardware sucks. Using good software on bad hardware doesn't solve the issue. Unless I can use it on a normal computer... last I looked into it, I don't think you could.

    • Can you explain to me what a router does? Is is just a PC tunnelling inbound and outbound connections? What makes it the master of the network?

      Btw in Germany we have FritzBox which doesnt suck, but seems they sell their company

      • You got a lot of good answers to this. I'll add mine:

        A router is a device that bridges multiple physical networks (it will have at least two network interfaces) and directs traffic between them. It inspects every packet of data and decides which port to send it to.

        In a typical home here in the US, one network is your ISP (connected to your cable modem, for example) and the other is your home computers, consoles and devices via wifi or direct connection (like a NAS drive, for example).

        Generally you want a firewall to go along with your router. Instead of blindly passing all data to the correct network, it will decide whether it is allowed to pass or not based on a configured ruleset. Most consumer home wifi routers have a simple firewall built-in.

        They also have other features like "load balancing" to prioritize certain data that is more sensitive to interruptions in the data flow (like gaming) over data that isn't (like video or audio), or "DHCP servers" to hand out IP addressed to devices on the network, or "VPN tunneling" to encrypt data, etc.

        A linux-based computer is more than capable of performing all these tasks. If well-configured, it can do it much better than a consumer device, with better hardware and more reliability for less money over time (when taking reliability into account).

      • A router routes traffic. It usually has dhcp and a firewall.

        However, most devices for consumers are a router, switch and a wireless access point. What this means is that they have a router but also Ethernet plugs in the back and a WiFi antenna

      • There is a thing called the OSI model, which is a useful tool for understanding what different components of a computer network do. I suggest looking up that term if you want to learn more about how networks work.

        You might be familiar with the idea of IP addresses and MAC addresses. An IP address is routable, as in you can look at an IP address and tell where on the network (and broadly speaking, in the world) it is. A MAC address is assigned to the network adapter during its manufacture, it's kind of like the machine's name.

        When you get out a sheet of parchment, a well of squid ink and a quill pen and write an old fashioned letter to an acquaintance (ask your parents, they probably used to actually do this), you write both the recipients street address and their name on the envelope. The postal service uses the street address to move the letter to the correct building, and then there's probably someone in your household who gets the mail out of the mailbox and then says "Jim, this letter is for you."

        Think of a router as a post office; routers send each other data packets based on the recipient IP address. A switch works via MAC addresses and is more like your dad saying "Jim you got a letter." A hub, which is a technology we don't use anymore, would be more like your dad reading everyone's mail out loud for everyone to hear, and everyone else is just supposed to ignore what's not for them.

        Now, let's talk about a more informal definition of the word "router": The box with a bunch of wires and probably a couple antennas on it that your Wi-Fi probably comes out of. We call that little box a "router," and that's one of the many jobs it does. You can think of networking components as little building blocks, and your home router has many building blocks in it. It's a little computer with some networking hardware attached, and it likely functions as a router, an Ethernet switch, a wireless access point or two, probably your DHCP server (assigns IP addresses to devices on the network automatically), it probably serves as a firewall, mine can be a print server or a file server.

  • I'd love a good firewalld guide that's kinda tldr and would go into the details later.

  • Nobody:

    OP: "Please do the needful."

    • It reads like OP has been looking for something that is actually usable and not LLM shat garbage blog posts. Asking people directly seems like the primary way of getting any actually useful information these days.

  • This shouldn't be targeted at the average used who does not need firewalls nor most networking stuff. If highly invested in security, maybe AppArmor/SELinux could come handy. Other topics I find interesting would be the use of VPNs with Wireguard, setup killswitches, how to configure a system-wide Tor proxy, etc.

    In stuff like that I could definitely help, depending on the conditions.

72 comments