Denna databas ger en referens för att bestämma det autonoma systemet och numret (ASN). Ett autonomt system (AS) är en samling av anslutna Internetprotokoll (IP) dirigeringsprefix under kontroll av en eller flera nätoperatörer som en enda administrativ enhet i routing policy.
Det är gratis för personligt eller kommersiellt bruk med tillskrivning som krävs genom att nämna användningen av dessa uppgifter enligt följande,
Let's explore this database which provides a valuable resource of geolocation data for free now!
Sign Up For FreeÖversätter IP-adress till autonomt system (AS) och autonomt systemnummer (ASN).
Aktuell version | December 2024 |
---|---|
IPv4 Databasstorlek |
BIN: 60.37 MB CSV: 44.34 MB (603,738 Rader) |
IPv6 Databasstorlek |
BIN: 111.9 MB CSV: 55.49 MB (477,377 Rader) |
Array |
Binär (BIN) ASCII-textfil (CSV) |
namn | Typ | Beskrivning |
---|---|---|
ip_from | INT (10)† / DECIMAL (39,0)†† | Första IP-adressen visar nätblock. |
ip_to | INT (10)† / DECIMAL (39,0)†† | Senaste IP-adressen visar nätblock. |
cidr | VARCHAR(43) | IP-adressintervall i CIDR. |
asn | INT(10) | Autonomt systemnummer (ASN). |
as | VARCHAR(256) | Autonomt system (AS) namn. |
† IPv4
†† IPv6
Nedan följer stegen för att konfigurera databasen för både IPv4- och IPv6-data.
CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_asn`(
`ip_from` INT(10) UNSIGNED,
`ip_to` INT(10) UNSIGNED,
`cidr` VARCHAR(43),
`asn` VARCHAR(10),
`as` VARCHAR(256),
PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
LOAD DATA LOCAL
INFILE 'IP2LOCATION-LITE-ASN.CSV'
INTO TABLE
`ip2location_asn`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
CREATE DATABASE ip2location
GO
USE ip2location
GO
CREATE TABLE [ip2location].[dbo].[ip2location_asn](
[ip_from] bigint NOT NULL,
[ip_to] bigint NOT NULL,
[cidr] nvarchar(43) NOT NULL,
[asn] nvarchar(10) NOT NULL,
[as] nvarchar(256) NOT NULL
) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_asn]([ip_to]) ON [PRIMARY]
GO
BULK INSERT [ip2location].[dbo].[ip2location_asn]
FROM '{PATH TO IP2LOCATION-LITE-ASN.CSV}'
WITH
(
FORMATFILE = '{PATH TO ASN.FMT}'
)
GO
OBS! Du måste kopiera FMT-koden nedan och spara den som en fil med namnetASN.FMT på din dator.
12.0
6
1 SQLCHAR 0 1 "\"" 0 first_double_quote Latin1_General_CI_AI
2 SQLCHAR 0 20 "\",\"" 1 ip_from "",
3 SQLCHAR 0 20 "\",\"" 2 ip_to "",
4 SQLCHAR 0 43 "\",\"" 3 cidr Latin1_General_CI_AI,
5 SQLCHAR 0 10 "\",\"" 4 asn Latin1_General_CI_AI,
6 SQLCHAR 0 256 "\",\"" 5 as Latin1_General_CI_AI
CREATE DATABASE ip2location WITH ENCODING 'UTF8';
\c ip2location
CREATE TABLE ip2location_asn(
ip_from bigint NOT NULL,
ip_to bigint NOT NULL,
cidr character varying(43) NOT NULL,
asn character varying(10) NOT NULL,
as character varying(256) NOT NULL,
CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to)
);
COPY ip2location_asn FROM 'IP2LOCATION-LITE-ASN.CSV' WITH CSV QUOTE AS '"';
CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_asn_ipv6`(
`ip_from` DECIMAL(39,0) UNSIGNED,
`ip_to` DECIMAL(39,0) UNSIGNED,
`cidr` VARCHAR(43),
`asn` VARCHAR(10),
`as` VARCHAR(256),
PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
LOAD DATA LOCAL
INFILE 'IP2LOCATION-LITE-ASN.IPV6.CSV'
INTO TABLE
`ip2location_asn_ipv6`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
CREATE DATABASE ip2location
GO
USE ip2location
GO
CREATE TABLE [ip2location].[dbo].[ip2location_asn_ipv6](
[ip_from] char(39) NOT NULL,
[ip_to] char(39) NOT NULL,
[cidr] nvarchar(43) NOT NULL,
[asn] nvarchar(10) NOT NULL,
[as] nvarchar(256) NOT NULL
) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_asn_ipv6]([ip_to]) ON [PRIMARY]
GO
BULK INSERT [ip2location].[dbo].[ip2location_asn_ipv6]
FROM '{PATH TO IP2LOCATION-LITE-ASN.IPV6.CSV}'
WITH
(
FORMATFILE = '{PATH TO ASN.FMT}'
)
GO
OBS! Du måste kopiera FMT-koden nedan och spara den som en fil med namnetASN.FMT på din dator. Den första raden i FMT-koden anger versionen av bcp. Ändra versionen enligt din MS-SQL installerad.
12.0
6
1 SQLCHAR 0 1 "\"" 0 first_double_quote Latin1_General_CI_AI
2 SQLCHAR 0 39 "\",\"" 1 ip_from "",
3 SQLCHAR 0 39 "\",\"" 2 ip_to "",
4 SQLCHAR 0 43 "\",\"" 3 cidr Latin1_General_CI_AI,
5 SQLCHAR 0 10 "\",\"" 4 asn Latin1_General_CI_AI,
6 SQLCHAR 0 256 "\",\"" 5 as Latin1_General_CI_AI
CREATE DATABASE ip2location WITH ENCODING 'UTF8';
\c ip2location
CREATE TABLE ip2location_asn_ipv6(
ip_from decimal(39,0) NOT NULL,
ip_to decimal(39,0) NOT NULL,
cidr character varying(43) NOT NULL,
asn character varying(10) NOT NULL,
as character varying(256) NOT NULL,
CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to)
);
COPY ip2location_asn_ipv6 FROM 'IP2LOCATION-LITE-ASN.IPV6.CSV' WITH CSV QUOTE AS '"';
Läs allmänna villkor för databaslicenser.
Enhance your applications with essential geolocation data by using our FREE databases.