Stateful versus stateless firewalls: what is the practical difference?
BeginnerScenarioSecurity: Firewalls, SGs, NACLs & VPN
Answer
Situation read → Do you track connections or evaluate each packet alone?
What I'd do →
- A stateful firewall remembers outbound connections and automatically allows the replies (security groups,
iptables -m conntrack --ctstate ESTABLISHED,RELATED) - A stateless firewall needs explicit rules both ways (NACLs, router ACLs)
- Stateful devices have connection table limits
- Check with
conntrack -L | wc -landsysctl net.netfilter.nf_conntrack_max
Why → State lets you write simple rules, at the cost of memory and a table that can fill.
Interview tip → Say you remember conntrack table exhaustion as the failure mode.
More on Security: Firewalls, SGs, NACLs & VPN
Security group versus NACL: explain the differences.BeginnerHow do you let only your office IP SSH into a server?BeginnerWhat does it mean that a security group can reference another security group?BeginnerWhat is a WAF and where do you place it?BeginnerWhat is the difference between a site-to-site VPN and a client VPN?BeginnerHow does DNAT or port forwarding work on a Linux gateway?Beginner