How Firewalls Work: The Gatekeepers of Network Security

Listen to this Post

Firewalls act as security filters, monitoring and controlling incoming and outgoing network traffic based on predefined rules. Whether hardware or software-based, they help prevent unauthorized access, keeping your data safe.

Key Functions of Firewalls:

  • Packet Filtering: Examines IP addresses, ports, and protocols to allow or block traffic.
  • Application-Layer Security: Provides intrusion detection and URL filtering.
  • Stateful Inspection: Tracks active connections and detects anomalies.

Understanding how firewalls work is crucial for cybersecurity professionals and businesses alike.

You Should Know:

Here are some practical commands and configurations related to firewalls:

Linux (iptables)

1. View Current Rules:

sudo iptables -L -v -n 

2. Allow Incoming SSH Traffic:

sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT 

3. Block an IP Address:

sudo iptables -A INPUT -s 192.168.1.100 -j DROP 

4. Save iptables Rules:

sudo iptables-save > /etc/iptables/rules.v4 

Windows (Firewall)

1. Allow a Program Through the Firewall:

netsh advfirewall firewall add rule name="Allow MyApp" dir=in action=allow program="C:\Path\To\MyApp.exe" enable=yes 

2. Block a Specific Port:

netsh advfirewall firewall add rule name="Block Port 80" dir=in action=block protocol=TCP localport=80 

3. Enable Logging for Dropped Packets:

netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\Firewall\pfirewall.log 

Cisco ASA Firewall

1. Allow Traffic from a Specific Network:

access-list OUTSIDE_IN extended permit ip 192.168.1.0 255.255.255.0 any 

2. Block ICMP Traffic:

access-list OUTSIDE_IN extended deny icmp any any 

3. Apply ACL to an Interface:

access-group OUTSIDE_IN in interface outside 

What Undercode Say:

Firewalls are essential tools for securing networks, and understanding their configuration is critical for cybersecurity professionals. Whether you’re working with Linux, Windows, or enterprise-grade firewalls like Cisco ASA, mastering these commands ensures robust network protection. For further reading, check out:
Cisco Firewall Documentation
Linux iptables Guide
Windows Firewall Commands

By implementing these practices, you can enhance your network’s security posture and mitigate potential threats effectively.

References:

Reported By: Mohamed Abdelgadr – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

Whatsapp
TelegramFeatured Image