View Single Post
Old 10-18-2017, 09:56 PM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
I thought to a fast way to get an IP CIDR

Code:
$ whois  173.208.249.226 |grep 'CIDR:'|cut -d':' -f2|sed -e 's/^/ufw deny from /g' -e 's/            / /g' -e 's/$/  to any;/g'

#returns
ufw deny from 173.208.249.224/29  to any;
ufw deny from 173.208.128.0/17  to any;
Use the smaller CIDR (narrower) of just the ip's if you dont want to block the whole datacenter (/18 to /24)

Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote