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.

Blocking IP ranges?

Discussion in 'General Discussion' started by AnIrishman, Feb 5, 2009.

  1. AnIrishman

    AnIrishman Registered

    Joined:
    Feb 5, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi guys. I’ve recently been bombarded with Russian spammers on my forum.

    I’ve decided that I want to block all Russian IP addresses from the site through CPanel’s IP deny manager on my hosting account.

    It gives me the option of entering a range of IP address to ban and it gives the following example.

    10.5.3.3-10.5.3.40

    I’ve found a list of Russian IP addresses but I don’t know how to convert them to a range so I can just enter that.

    Here is the list of IP addresses

    217.116.48.0 217.116.63.255
    217.116.128.0 217.116.159.255
    217.117.80.0 217.117.95.255
    217.117.112.0 217.117.127.255
    217.117.176.0 217.117.191.255
    217.118.64.0 217.118.95.255
    217.118.176.0 217.118.191.255
    217.119.16.0 217.119.31.255
    217.119.80.0 217.119.95.255
    217.144.96.0 217.144.111.255
    217.144.160.0 217.144.191.255
    217.145.16.0 217.145.31.255
    217.145.144.0 217.145.159.255
    217.146.32.0 217.146.47.255
    217.147.0.0 217.147.31.255
    217.147.48.0 217.147.63.255
    217.148.48.0 217.148.63.255
    217.148.192.0 217.148.239.255
    217.149.16.0 217.149.31.255
    217.149.176.0 217.149.191.255
    217.150.0.0 217.150.63.255
    217.150.192.0 217.150.207.255
    217.151.16.0 217.151.31.255
    217.151.64.0 217.151.79.255
    217.151.128.0 217.151.143.255
    217.151.225.40 217.151.225.47
    217.151.227.0 217.151.227.255
    217.151.230.0 217.151.230.255
    217.168.64.0 217.168.79.255
    217.168.240.0 217.168.255.255
    217.169.80.0 217.169.95.255
    217.170.64.0 217.170.95.255
    217.170.112.0 217.170.127.255
    217.170.208.0 217.170.223.255
    217.171.0.0 217.171.15.255
    217.171.64.0 217.171.79.255
    217.171.144.0 217.171.159.255
    217.171.224.0 217.171.239.255
    217.172.16.0 217.172.31.255
    217.172.44.192 217.172.44.199
    217.172.45.208 217.172.45.215
    217.172.49.136 217.172.49.143
    217.173.0.0 217.173.31.255
    217.173.64.0 217.173.79.255
    217.174.0.0 217.174.15.255
    217.174.96.0 217.174.111.255
    217.174.160.0 217.174.180.255
    217.174.181.64 217.174.191.255
    217.175.16.0 217.175.47.255
    217.175.128.0 217.175.159.255
    217.194.240.0 217.194.255.255
    217.195.64.0 217.195.111.255
    217.195.208.0 217.195.223.255
    217.196.96.0 217.196.127.255
    217.197.0.0 217.197.15.255
    217.197.112.0 217.197.127.255
    217.197.240.0 217.198.15.255
    217.198.80.0 217.198.95.255
    217.198.160.0 217.198.191.255
    217.199.208.0 217.199.216.255
    217.199.218.0 217.199.223.255
    217.199.240.0 217.199.255.255
    217.212.248.0 217.212.248.7
    217.212.248.16 217.212.248.23
    217.212.248.64 217.212.248.159
    217.212.254.0 217.212.254.255

    Can anybody tell me how to convert these to a single range?

    Many thanks in advance.
     
  2. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
  3. AnIrishman

    AnIrishman Registered

    Joined:
    Feb 5, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I’ve added “217.0.0.0/8” so does that mean that all the IP addresses I cited above are blocked? Many thanks for the link too.
     
  4. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    Yes, that blocks:

    217.0.0.0 => 217.255.255.255
     
  5. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    But it also means you are blocking a lot of other IPs as well that might not be from Russia.

    Here are the correct blocks for 217. for Russia only:

    Code:
    217.8.80.0/20
    217.8.224.0/20
    217.9.80.0/20
    217.9.144.0/20
    217.10.32.0/20
    217.12.32.0/20
    217.12.96.0/20
    217.12.240.0/20
    217.13.208.0/20
    217.14.16.0/20
    217.14.48.0/20
    217.14.192.0/20
    217.14.240.0/20
    217.15.16.0/20
    217.15.48.0/20
    217.15.128.0/20
    217.15.144.0/20
    217.15.192.0/20
    217.16.16.0/20
    217.16.176.0/20
    217.17.160.0/20
    217.17.176.0/20
    217.18.48.0/20
    217.18.128.0/20
    217.18.144.0/20
    217.19.112.0/20
    217.20.64.0/20
    217.20.80.0/20
    217.20.208.0/20
    217.21.16.0/20
    217.21.96.0/20
    217.21.208.0/20
    217.22.160.0/20
    217.23.16.0/20
    217.23.64.0/20
    217.23.80.0/20
    217.23.128.0/20
    217.23.144.0/20
    217.23.176.0/20
    217.24.112.0/20
    217.24.176.0/20
    217.25.80.0/20
    217.25.144.0/20
    217.25.208.0/20
    217.25.224.0/20
    217.26.0.0/20
    217.26.16.0/20
    217.26.176.0/20
    217.28.80.0/20
    217.28.208.0/20
    217.29.48.0/20
    217.29.80.0/20
    217.29.112.0/20
    217.29.176.0/20
    217.30.240.0/20
    217.64.128.0/20
    217.65.0.0/20
    217.65.80.0/20
    217.65.208.0/20
    217.66.16.0/20
    217.66.64.0/20
    217.66.80.0/20
    217.66.144.0/20
    217.67.0.0/20
    217.67.112.0/20
    217.67.176.0/20
    217.69.192.0/20
    217.69.208.0/20
    217.70.16.0/20
    217.70.96.0/20
    217.70.112.0/20
    217.71.128.0/20
    217.71.160.0/20
    217.71.224.0/20
    217.72.0.0/20
    217.72.144.0/20
    217.73.112.0/20
    217.73.192.0/20
    217.73.240.0/20
    217.74.32.0/20
    217.74.112.0/20
    217.74.128.0/20
    217.74.144.0/20
    217.74.160.0/20
    217.74.240.0/20
    217.76.32.0/20
    217.76.176.0/20
    217.77.48.0/20
    217.77.96.0/20
    217.77.112.0/20
    217.78.176.0/20
    217.79.16.0/20
    217.79.48.0/20
    217.79.224.0/20
    217.106.0.0/15
    217.112.16.0/20
    217.113.112.0/20
    217.114.0.0/20
    217.114.16.0/20
    217.114.32.0/20
    217.114.144.0/20
    217.114.176.0/20
    217.114.224.0/20
    217.114.240.0/20
    217.115.80.0/20
    217.115.176.0/20
    217.116.48.0/20
    217.116.128.0/20
    217.116.144.0/20
    217.117.80.0/20
    217.117.112.0/20
    217.117.176.0/20
    217.118.64.0/20
    217.118.80.0/20
    217.118.176.0/20
    217.119.16.0/20
    217.119.80.0/20
    217.144.96.0/20
    217.144.160.0/20
    217.144.176.0/20
    217.145.16.0/20
    217.145.144.0/20
    217.146.32.0/20
    217.147.0.0/20
    217.147.16.0/20
    217.147.48.0/20
    217.148.48.0/20
    217.148.192.0/20
    217.148.208.0/20
    217.149.16.0/20
    217.149.176.0/20
    217.150.0.0/20
    217.150.16.0/20
    217.150.32.0/20
    217.150.48.0/20
    217.150.192.0/20
    217.151.16.0/20
    217.151.64.0/20
    217.151.128.0/20
    217.168.64.0/20
    217.168.240.0/20
    217.169.80.0/20
    217.170.64.0/20
    217.170.80.0/20
    217.170.112.0/20
    217.170.208.0/20
    217.171.0.0/20
    217.171.64.0/20
    217.171.144.0/20
    217.171.224.0/20
    217.172.16.0/20
    217.173.0.0/20
    217.173.16.0/20
    217.173.64.0/20
    217.174.0.0/20
    217.174.96.0/20
    217.174.160.0/20
    217.174.176.0/20
    217.175.16.0/20
    217.175.32.0/20
    217.175.128.0/20
    217.175.144.0/20
    217.194.240.0/20
    217.195.64.0/20
    217.195.80.0/20
    217.195.96.0/20
    217.195.208.0/20
    217.196.96.0/20
    217.196.112.0/20
    217.197.0.0/20
    217.197.112.0/20
    217.197.240.0/20
    217.198.0.0/20
    217.198.80.0/20
    217.198.160.0/20
    217.198.176.0/20
    217.199.208.0/20
    217.199.240.0/20
    
    You might take a look at http://www.ipdeny.com/ipblocks/
     
  6. ChrisJones198

    ChrisJones198 Registered

    Joined:
    Feb 10, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks guys i am having a very similar problem
     
  7. JawadArshad

    JawadArshad Well-Known Member
    PartnerNOC

    Joined:
    Apr 8, 2008
    Messages:
    447
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    PK
    cPanel Access Level:
    DataCenter Provider
  8. waizen

    waizen Registered

    Joined:
    Apr 27, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I'm in a similar situation. I found this site:

    http://www.countryipblocks.net/index.php

    and it provides a lot of ranges. My question is, how do you go about entering all those ranges within cPanel, hopefully in one shot, without having to enter them all one at a time. This site provides hundreds of them at a time.
     
  9. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    If you use APF or CSF you could simply add them to the deny file via ssh and restart the firewall.
     
  10. nathenwestfield

    nathenwestfield Registered

    Joined:
    Apr 29, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Australia
  11. Chuck Spidell

    Chuck Spidell Registered

    Joined:
    Apr 8, 2015
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    United States
    cPanel Access Level:
    Website Owner
Loading...

Share This Page