Course contentsShow
← Security
Lesson 1586 of 3,05232. Operating System Security - Endpoint ProtectionFree lesson

iptables and nftables on Linux

Understanding Linux host firewall frameworks and their role in endpoint protection versus network firewalling.

iptables and nftables on Linux

You'll learn how Linux's host-based firewall frameworks protect individual endpoints, not just network perimeters.


What Are iptables and nftables?

Linux systems use iptables (legacy but still widespread) and nftables (modern replacement) as host-based firewall frameworks. Unlike network firewalls that sit at gateway points filtering traffic between networks, these tools run locally on each Linux endpoint to control what connections that specific machine accepts or initiates.

Think of it like this: a network firewall is the security gate at your building's entrance, while iptables/nftables is the deadbolt on your specific apartment door. Both protect you, but at different layers.

Why Endpoint Firewalling Matters

Even behind network firewalls, endpoints need their own protection because:

  • Lateral movement defense: If an attacker breaches the perimeter, host firewalls limit their ability to pivot between systems
  • Process-level granularity: You can restrict which applications can send/receive traffic
  • Defense in depth: Multiple security layers reduce single-point-of-failure risk
  • Zero-trust architecture: Don't trust network location alone

iptables vs nftables

iptables has been Linux's standard for decades. It uses chains (INPUT, OUTPUT, FORWARD) to filter packets based on IP addresses, ports, and protocols.

nftables is the modern successor offering better performance, simpler syntax, and unified handling of IPv4/IPv6/ARP. Many distributions now default to nftables, though some provide iptables compatibility layers.

Both operate at the kernel level using the Netfilter framework, inspecting every packet before the system processes it.

Endpoint Protection Role

As endpoint protection tools, these firewalls complement EDR and antivirus by preventing unauthorized network communication—blocking callbacks to C2 servers, restricting service exposure, and enforcing communication policies per-host.

Key Takeaway: iptables and nftables are Linux's host-based firewall frameworks that provide per-endpoint network access control, defending against lateral movement and enforcing least-privilege networking as part of comprehensive endpoint security.