Table: ipinfo_asn - Query IPinfo ASN using SQL
Autonomous System Numbers (ASNs) are a crucial part of the internet's routing infrastructure. They are used by internet service providers and large organizations to manage their network routes and traffic. With ASNs, users can understand how internet traffic is routed and identify the networks responsible for specific internet activities.
Table Usage Guide
The ipinfo_asn
table provides detailed insights into Autonomous System Numbers (ASNs) within IPinfo. As a network engineer or IT professional, explore ASN-specific details through this table, including the network prefix, name, country, and associated metadata. Utilize it to uncover information about network routing, such as the routes used by an internet service provider or a large organization, and the traffic patterns of these networks.
Important Notes
- This table requires a paid plan.
- Because ASNs cannot be listed in full, the
ipinfo_asn
table requires theasn
field to be specified in all queries, defining the ASN to lookup.
Examples
Info about an ASN
Gain insights into the specifics of a particular Autonomous System Number (ASN) including its name, country of origin, and the number of IP addresses it has. This is useful for network administrators and cybersecurity professionals to understand the scale and geographical location of a specific ASN.
select name, country_name, num_ipsfrom ipinfo_asnwhere asn = 'AS7922';
select name, country_name, num_ipsfrom ipinfo_asnwhere asn = 'AS7922';
IPv4 prefixes managed by an ASN
Explore which IPv4 prefixes are managed by a specific Autonomous System Number (ASN). This can be useful to understand the scope of networks managed by an ASN and potentially identify patterns or anomalies.
select p ->> 'netblock' as netblock, p ->> 'name' as namefrom ipinfo_asn, jsonb_array_elements(prefixes) as pwhere asn = 'AS7922';
select json_extract(p.value, '$.netblock') as netblock, json_extract(p.value, '$.name') as namefrom ipinfo_asn, json_each(prefixes) as pwhere asn = 'AS7922';
Schema for ipinfo_asn
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
allocated | text | Date when the ASN was allocated, e.g. 1997-02-14 | |
asn | text | = | Autonomous System Number (ASN) of the administrator for the IP, e.g. AS13335 |
country | text | Country code of the ASN, e.g. US | |
country_name | text | Country name of the ASN, e.g. United States | |
domain | text | Domain of the ASN, e.g. comcast.com | |
downstreams | jsonb | Downstream information for the ASN. | |
name | text | Name of the ASN. | |
num_ips | bigint | Number of IPs in the ASN, e.g. 71224576 | |
peers | jsonb | Peers for the ASN. | |
prefixes | jsonb | List of objects representing IPv4 ranges for the ASN. | |
prefixes6 | jsonb | List of objects representing IPv6 ranges for the ASN. | |
registry | text | Registry for the ASN, e.g. arin | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
type | text | Type of the ASN, e.g. isp | |
upstreams | jsonb | Upstream information for the ASN. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- ipinfo
You can pass the configuration to the command with the --config
argument:
steampipe_export_ipinfo --config '<your_config>' ipinfo_asn