Estimated Reading Time: 3 min
Here’s a comprehensive guide on IPv4 Firewall Settings to help you configure and manage your firewall for complete security and network control.
IPv4 Firewall Settings Guide
1. Introduction to IPv4 Firewall
A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. IPv4-based firewalls help protect networks by filtering traffic using IP addresses, ports, and protocols.
2. Types of Firewalls
- Packet Filtering Firewall: Examines packets and allows or blocks them based on IP addresses, ports, and protocols.
- Stateful Inspection Firewall: Tracks active connections and makes decisions based on the state of traffic.
- Proxy Firewall: Intermediary between user requests and the target system.
- Next-Generation Firewall (NGFW): Includes deep packet inspection (DPI), application-layer filtering, and intrusion prevention.

3. Firewall Rules and Configuration
Firewall rules define what traffic is allowed or denied. Rules are usually structured as follows:
ACTION PROTOCOL SOURCE IP DESTINATION IP PORT
3.1 Common Actions
- ALLOW: Permit traffic
- DENY: Block traffic
- LOG: Record traffic for monitoring
3.2 Protocols
- TCP (Transmission Control Protocol)
- UDP (User Datagram Protocol)
- ICMP (Internet Control Message Protocol)
3.3 Common Ports
Service | Port Number |
---|---|
HTTP | 80 |
HTTPS | 443 |
FTP | 21 |
SSH | 22 |
DNS | 53 |
SMTP | 25 |
4. Configuring IPv4 Firewall on Different Platforms

4.1 Configuring on Linux (iptables)
To list existing firewall rules:
sudo iptables -L -v -n
To allow incoming SSH (port 22):
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
To block an IP address:
sudo iptables -A INPUT -s 192.168.1.100 -j DROP
To save rules:
sudo iptables-save > /etc/iptables/rules.v4
4.2 Configuring on Windows Firewall
To allow an application:
- Open Windows Defender Firewall.
- Click Advanced Settings.
- Select Inbound Rules > New Rule.
- Choose Program and specify the application.
- Allow or block the program.
To block a specific IP address:
New-NetFirewallRule -DisplayName "Block IP" -Direction Inbound -RemoteAddress 192.168.1.100 -Action Block
4.3 Configuring on Cisco Router
To block an IP address:
access-list 100 deny ip 192.168.1.100 0.0.0.255 any
interface GigabitEthernet0/1
ip access-group 100 in
To allow SSH:
access-list 101 permit tcp any any eq 22
interface GigabitEthernet0/1
ip access-group 101 in
5. Best Practices for IPv4 Firewall Security
- Use Least Privilege: Only allow necessary services and block everything else.
- Enable Logging: Keep track of all firewall activity.
- Regularly Review Rules: Remove outdated or unused rules.
- Implement IP Whitelisting: Restrict access to trusted IPs.
- Use Stateful Inspection: Improve security with session tracking.
6. Troubleshooting Firewall Issues
- Check Active Rules: Run
iptables -L
(Linux) orGet-NetFirewallRule
(Windows). - Use Network Monitoring Tools:
tcpdump
,Wireshark
,netstat
. - Verify Connectivity: Use
ping
andtraceroute
to diagnose blocked traffic. - Test Rules: Temporarily disable or modify rules to troubleshoot.
7. Conclusion
Configuring an IPv4 firewall is essential for securing networks against unauthorized access and threats. By applying the right firewall rules, monitoring logs, and following best practices, you can enhance network security and efficiency.