ASN=”19281″; curl -s https://ipinfo.io/AS${ASN} |grep -Eo “((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(3[0-2]|[1-2][0-9]|[0-9]))$)” |sort -Vu
Source: networking – How to find out all IP ranges belonging to a certain AS? – Super User