What is the command for checking ips on the server and banning them?

Discussion in 'Site & Server Administration' started by musman1986, Feb 1, 2008.

  1. #1
    hi can you tell me what is the command of the ips making connections to the server and how many connections they are making using linux server and how to ban and unban them.
     
    musman1986, Feb 1, 2008 IP
  2. mellow-h

    mellow-h Peon

    Messages:
    750
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    With this, you should see the connections with the specific IP. If you want to see the specific http connections, you can do this:

    To Ban an IP you can use IPtables or Apf:

    You can just restart iptables to get ips unbanned. Note if you save then you need to remove the IP ban rules from the iptables config file.

    I recommend you to use apf firewall. With which you can easily ban an ip with this command:

    To unban an IP, just edit the /etc/apf/deny_hosts.rules file and comment or remove the IP, then restart apf:

     
    mellow-h, Feb 1, 2008 IP