Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    156
    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:
    166
    You want to block an IP range from server.com/cpanel or from the server including cpanel?

    cPanel.net Support Ticket Number:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. obso

    obso Registered

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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice