Mezgani blog

March 20, 2010

Number of public IP address in an AS (example IAM)

Filed under: bash, routing — Tags: , , — Ali MEZGANI @ 1:51 pm

You can get the number of public address in an AS by using whois and ipcalc tools like this query :

$ for ip in $(whois -i origin AS6713 | awk ‘/route/ { print $2 }’); do ipcalc $ip; done | awk ‘/\/Net/{ ip+=$2 } END { printf ip “\n” }’

155638

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.