1️⃣ Get the ASN from a give IP. To do this visit https://ip-api.com/ and paste the IP :
2️⃣ Install whois if it is not installed on your PC :
Linux :
sudo apt install whois
In Windows it should be pre-installed on command line
3️⃣ Get the ASN for example : AS13335
4️⃣ Scrape IP Ranges :
whois -h whois.radb.net -- '-i origin ASN_NUMBER' | grep 'route:'
My Command :
whois -h whois.radb.net -- '-i origin AS13335' | grep 'route:'
And there you go. You can also install cmder.net to use grep as command which is recommended.