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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to prevent IPs access to my server

Discussion in 'General Discussion' started by preleaf, Sep 21, 2004.

  1. preleaf

    preleaf Well-Known Member

    Joined:
    Aug 25, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    how to prevent IPs access to my server Can I prevent some IPs access to my server .Example :these IPs start 203.x.x.x or 205.x.x.x
    Please ,guide me step by step
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,472
    Likes Received:
    20
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Again, if you search for the term "firewall" you'll get plenty of options, the most popular would be to install APF (an iptables based firewall).
     
  3. preleaf

    preleaf Well-Known Member

    Joined:
    Aug 25, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    thank you so much .I will install APF.I f have any thing please help me
     
  4. ramprage

    ramprage Well-Known Member

    Joined:
    Jul 21, 2002
    Messages:
    655
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Canada
    Also consider using TCPwrappers to restrict user access.
     
  5. preleaf

    preleaf Well-Known Member

    Joined:
    Aug 25, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    are you guide me more detail ?thanks !
     
  6. preleaf

    preleaf Well-Known Member

    Joined:
    Aug 25, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    please ,guide me

    as follow the manual I am know in file allow_host.rules to allow host access to server as this :x.x.x.x/24.But how to permit these IPs start by 205 or 203 .So I can add this line:
    205.x.x.x/24 that i dont replace x.x.x cant I?Because I dont want to THESE IPs START 205 or 203
     
  7. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,191
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    India
    cPanel Access Level:
    Root Administrator
    iptables -A INPUT -s 205.0.0.0/24 -j DROP

    iptables -A INPUT -s 203.0.0.0/24 -j DROP

    that will do.
     
  8. preleaf

    preleaf Well-Known Member

    Joined:
    Aug 25, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    what are file add 2 that lines ?allow_host.rules or conf.apf?where are add 2 lines ?thanks!
     
  9. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,191
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    India
    cPanel Access Level:
    Root Administrator
    just type that on your shell; and then

    /etc/rc.d/init.d/iptables save

    that will do.
     
  10. preleaf

    preleaf Well-Known Member

    Joined:
    Aug 25, 2004
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    156
    Hi linux-image,
    i typed :
    root@host[~]# iptables -A INPUT -s 205.0.0.0/24 -j DROP

    root@host[~]#iptables -A INPUT -s 203.0.0.0/24 -j DROP
    when permit IPs start 205 then these IPs cant login by root but it still access websites onmy server by browser
     
Loading...

Share This Page