Introduction
Blocking an IP address prevents traffic from that address from reaching your network or device. This is useful for blocking abusive users, preventing unauthorized access, or filtering unwanted traffic. Here's how to do it at every level.
Method 1: Block an IP Address on Your Router (Best for Home Networks)
Blocking at the router level stops traffic before it enters your network.
Steps (varies by router brand):
- Log into your router admin panel (usually
192.168.1.1or192.168.0.1) - Enter your admin username and password
- Look for Firewall, Access Control, or IP Filtering settings
- Add a rule to block the specific IP address
- Save and apply
Most modern routers (Netgear, ASUS, TP-Link, Linksys) have this feature.
Method 2: Block an IP Address on Windows (Firewall)
- Open Windows Defender Firewall with Advanced Security (Search for it in Start Menu)
- Click Inbound Rules → New Rule
- Select Custom → Next
- Select All programs → Next
- Leave protocol as default → Next
- Under Remote IP addresses, select These IP addresses → Add the IP
- Select Block the connection → Next
- Apply to all profiles → Name your rule → Finish
Method 3: Block an IP on Mac (via PF Firewall)
Open Terminal and run:
sudo pfctl -e
echo "block in from 1.2.3.4 to any" | sudo pfctl -f -
Replace 1.2.3.4 with the IP to block. This is temporary and resets on reboot; use a pf.conf rule for permanent blocking.
Method 4: Block an IP on Linux (iptables)
sudo iptables -A INPUT -s 1.2.3.4 -j DROP
To make it permanent:
sudo netfilter-persistent save
Method 5: Block IPs in Applications
Apache Web Server:
Add to .htaccess:
Require not ip 1.2.3.4
Nginx:
deny 1.2.3.4;
WordPress (via plugin): WP Cerber, Wordfence, or iThemes Security all offer IP blocking via dashboard.
Important Considerations
- Dynamic IPs change — If the person you're blocking has a dynamic IP, they may get a new one and the block becomes ineffective
- VPNs bypass blocks — Anyone using a VPN can appear from a different IP
- Block ranges with CIDR notation — If one IP from a range is abusive, block the whole subnet:
1.2.3.0/24
Conclusion
Blocking at the router level is the most comprehensive approach for home networks. For servers and applications, firewall rules and application-level blocks give you precise control. Keep in mind that determined bad actors can change their IP through VPNs or dynamic reassignment.
Check any IP's reputation and location at what-is-my-ip.best before deciding to block it.
Last updated: 2026 | Category: How-To Guides