How to block an ip for accessing cpanel or anything else on server

TheSpidre

Active Member
Mar 10, 2003
36
0
156
How do I block an ip(range) from accessing the server/cpanel?

cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
You want to block an IP range from server.com/cpanel or from the server including cpanel?

cPanel.net Support Ticket Number:
 

obso

Registered
Feb 16, 2002
4
0
301
Colorado
There are a few ways you can do this:

1. You can use route. Syntax looks like this:

/sbin/route add -host *IP TO BLOCK HERE* gw 127.0.0.1

2. You can use iptables / ipchains:

/usr/local/bin/iptables -I INPUT -s *IP TO BLOCK HERE* -j DROP
/sbin/ipchains -I input -s *IP TO BLOCk HERE* -j DENY

This will block all access to your server.

cPanel.net Support Ticket Number: