The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by TheSpidre, Jul 29, 2003.

  1. TheSpidre

    TheSpidre Active Member

    Joined:
    Mar 10, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    How do I block an ip(range) from accessing the server/cpanel?

    cPanel.net Support Ticket Number:
     
  2. ciphervendor

    ciphervendor Well-Known Member

    Joined:
    Aug 26, 2002
    Messages:
    1,052
    Likes Received:
    0
    Trophy Points:
    36
    You want to block an IP range from server.com/cpanel or from the server including cpanel?

    cPanel.net Support Ticket Number:
     
  3. obso

    obso Registered

    Joined:
    Feb 16, 2002
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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:
     
Loading...

Share This Page