Search code examples
linuxnetwork-programmingbgp

How to get all ip ranges from asn?


I want to get all IP address ranges/blocks from as number. I can search throw google but need to write them manually. I want to get them all at once? Is this possible to get only ip address ranges from websites at once?


Solution

  • You can use whois servers instead of bgp.he.net or any other websites like this.

    whois -h whois.radb.net -- '-i origin AS01' | grep 'route:'

    Just run this command on your Linux machine.