• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

how to add multiple IPs to iptables

hardbrasil

Regular Pleskian
hello fellas,

i have a list of bad Ips and would like to add it into iptables,
but i dont went to enter one-by-one or by command line,
i would like to insert into list file of iptables editing a file or something like that,

could you share where and how i can procedure to do this?


thanks!
 
You can use the iprange module in combination with '--src-range' like:

# iptables -A INPUT -i eth0 -m iprange --src-range 192.168.1.90-192.168.1.101 -j DROP
 
I do not know the solution. Maybe someone else will advise something useful?
 
You can try to use this script:

Code:
#!/bin/bash
for IP in `cat /root/iplist.txt`; do
    /sbin/iptables -A INPUT -s $IP -j DROP
done
 
Back
Top