list of ip

Cedric Blancher blancher at cartel-securite.fr
Mon Mar 13 14:30:36 CET 2006


Le lundi 13 mars 2006 à 10:02 -0300, Pedro Drimel Neto a écrit :
> How do I make a rule with a lot os ips like
> IPS="{192.168.1.2, 192.168.1.50, 192.168.1.55}"
> iptables -A INPUT -p tcp -s $IPS -j DROP

An iptables rule can only take one src and/org dst at the time, saying
one host or network. Thus, shell scripting is your friend:

	IPS="192.168.1.2 192.168.1.50 192.168.1.55"
	for i in $IPS; do
		iptables -A INPUT -p tcp -s $i -j DROP;
	done


-- 
http://sid.rstack.org/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE
>> Hi! I'm your friendly neighbourhood signature virus.
>> Copy me to your signature file and help me spread!



More information about the netfilter mailing list