Episode 2.3
DEMYSTIFYING FIREWALLS
Class 12 (10+2) • Unit 2: Network and Internet Concepts
💡 Direct Stream: You can also watch directly on YouTube or via local server:
📺 Watch on YouTube.com
Episode code: 2.3
✍️ Episode 2.3 Topic Notes
📌 A. Packet-Filtering Firewall (Stateless / 1st Generation)
- OSI Layers: Operates at Layer 3 (Network) and Layer 4 (Transport).
- Working Mechanism: Inspects individual packet headers against a static rule matrix (Source IP, Destination IP, Protocol [TCP/UDP/ICMP], Source Port, Destination Port).
- Stateless: Evaluates each packet in complete isolation without remembering previous packets.
- Limitation: Cannot detect application-layer payload exploits; vulnerable to IP spoofing.
📌 B. Stateful Inspection Firewall (Dynamic / 2nd Generation)
- OSI Layers: Operates across Layers 3, 4, and 5 (Session).
- Working Mechanism: Maintains a dynamic State Table tracking active TCP connections (monitoring the SYN, SYN-ACK, ACK three-way handshake and sequence numbers).
- Key Advantage: If an internal client initiates an outbound connection, the return traffic from the external server is automatically permitted through the firewall because it matches an active state table entry, closing the port as soon as the session terminates.
📌 C. Application-Level Gateway / Proxy Firewall (3rd Generation)
- OSI Layer: Operates at Layer 7 (Application Layer).
- Working Mechanism: Intercepts client connections completely. The proxy establishes a connection with the destination server on the client's behalf, reconstructing and deeply inspecting the application payload (HTTP headers, URLs, FTP commands, DNS queries).
- Key Advantage: Complete protocol conformance, content filtering, and complete concealment of internal IP addresses from external servers.
- Limitation: Higher latency and computational overhead due to deep packet processing.
📌 D. Next-Generation Firewall (NGFW)
- Integrates traditional stateful inspection with Deep Packet Inspection (DPI), inline Intrusion Prevention Systems (IPS), SSL/TLS decryption inspection, and application awareness (e.g., distinguishing between Skype and BitTorrent regardless of port).
- Purpose: Public-facing servers (Web, Mail, DNS) must be accessible from the Internet. By placing them in the DMZ, if a hacker compromises the public web server, the inner firewall prevents them from pivoting into the sensitive internal LAN.
📌 A. Architecture of `iptables`:
- Tables:
filter(default for traffic filtering),nat(Network Address Translation),mangle(packet alteration). - Chains in
filtertable: INPUT: Packets destined for the local Linux host.OUTPUT: Packets generated locally and leaving the host.