]> git.ipfire.org Git - people/ms/libloc.git/blame - man/location-query.txt
location-query: Allow filtering networks by family
[people/ms/libloc.git] / man / location-query.txt
CommitLineData
161ac92d
MT
1= location-query(8)
2
3== NAME
4location-query - Query the location database
5
6== SYNOPSIS
7[verse]
8`location-query lookup ADDRESS [ADDRESS...]`
9`location-query get-as ASN [ASN...]`
10`location-query search-as STRING`
11`location-query list-networks-by-as ASN`
12`location-query list-networks-by-cc COUNTRY_CODE`
bbdb2e0a 13`location-query list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast]`
161ac92d
MT
14
15== DESCRIPTION
16The `location-query` retrieves information from the location database.
17This data can be used to determine someone's location on the Internet
18and for building firewall rulesets to block access from certain ASes
19or countries.
20
21== OPTIONS
22
23--database FILE::
24-d FILE::
25 The path of the database which is being opened.
26 +
27 If this option is omitted, the system's database will be opened.
28
29--debug::
30 Enable debugging mode
31
32== COMMANDS
33
34'lookup ADDRESS [ADDRESS...]'::
35 This command returns the network the given IP address has been found in
36 as well as its Autonomous System if that information is available.
37
38'get-as ASN [ASN...]'::
39 This command returns the name of the owning organisation of the Autonomous
40 System.
41
42'search-as STRING'::
43 Lists all Autonomous Systems which match the given string.
44 +
45 The search will be performed case-insensitively.
46
44e5ef71 47'list-networks-by-as [--family=[ipv6|ipv4]] [--output-format FORMAT] ASN'::
161ac92d 48 Lists all networks which belong to this Autonomous System.
4439e317 49 +
44e5ef71
MT
50 The '--family' parameter can be used to filter output to only IPv6 or
51 IPv4 addresses.
52 +
4439e317
MT
53 The '--output-format' parameter can change the output so that it can be
54 directly loaded into other software. The following options are available:
55 +
56 * 'list' (default): Just lists all networks, one per line
6da14cc1 57 * 'ipset': For ipset
71e0ad0b 58 * 'nftables': For nftables
4439e317
MT
59 * 'xt_geoip': Returns a list of networks to be loaded into the xt_geoip
60 kernel module
161ac92d 61
44e5ef71 62'list-networks-by-cc [--family=[ipv6|ipv4]] [--output-format FORMAT] COUNTRY_CODE'::
161ac92d
MT
63 Lists all networks that belong to a country.
64 +
65 The country has to be encoded in ISO3166 Alpha-2 notation.
4439e317 66 +
44e5ef71 67 See above for usage of the '--family' and '--output-format' parameters.
161ac92d 68
44e5ef71 69'list-networks-by-flags [--family=[ipv6|ipv4]] [--output-format FORMAT] [--anonymous-proxy|--satellite-provider|--anycast]'::
bbdb2e0a
MT
70 Lists all networks that have a certain flag.
71 +
44e5ef71 72 See above for usage of the '--family' and '--output-format' parameters.
bbdb2e0a 73
161ac92d
MT
74'--help'::
75 Shows a short help text on using this program.
76
77'--version'::
78 Shows the program's version and exists.
79
80== EXIT CODES
81The 'location-query' command will normally exit with code zero.
82If there has been a problem and the requested action could not be performed,
83the exit code is unequal to zero.
84
85== BUGS
86Please report all bugs to the bugtracker at https://bugzilla.ipfire.org/.
87
88== AUTHORS
89Michael Tremer