Quote:
Originally Posted by boby.kumar
Its didn't help me what i was expecting. Ip calculating is different from Ip blocking.
Anyone has the comment on this?
|
That's funny, because it helped me set over 400 iptable bans on several of my own hosts.
Code:
ipcalc 10.20.50.00
Address: 10.20.50.0
Netmask: 255.255.255.0 = 24
Wildcard: 0.0.0.255
=>
Network: 10.20.50.0/24
HostMin: 10.20.50.1
HostMax: 10.20.50.254
Broadcast: 10.20.50.255
Hosts/Net: 254 Class A, Private Internet
Sooooooo, to block all 10.20.50.xx hosts, you would run:
Code:
for i in 10.20.50.0/24 ; do iptables -I INPUT -s $i -j DROP ; done
Unless I missed my daily dosage of caffeine, that should get you started.