1LOCATION(1) LOCATION(1)
2
3
4
6 location - Query the location database
7
9 location export --directory=DIR [--format=FORMAT] [--family=ipv6|ipv4] [ASN|CC ...]
10 location get-as ASN [ASN...]
11 location list-countries [--show-name] [--show-continent]
12 location list-networks-by-as ASN
13 location list-networks-by-cc COUNTRY_CODE
14 location list-networks-by-flags [--anonymous-proxy|--satellite-provider|--anycast|--drop]
15 location lookup ADDRESS [ADDRESS...]
16 location search-as STRING
17 location update [--cron=daily|weekly|monthly]
18 location verify
19 location version
20
22 location retrieves information from the location database. This data
23 can be used to determine someone’s location on the Internet and for
24 building firewall rulesets to block access from certain ASes or
25 countries.
26
28 --database FILE, -d FILE
29 The path of the database which is being opened.
30
31 If this option is omitted, the system’s database will be opened.
32
33 --quiet
34 Enable quiet mode
35
36 --debug
37 Enable debugging mode
38
40 export [--directory=DIR] [--format=FORMAT] [--family=ipv6|ipv4] [ASN|CC
41 ...]
42 This command exports the whole database into the given directory.
43
44 The output can be filtered by only exporting a certain address
45 family, or by passing a list of country codes and/or ASNs. The
46 default is to export all known countries.
47
48 The output format can be chosen with the --format parameter. For
49 possible formats, please see below.
50
51 If the --directory option is omitted, the output will be written to
52 stdout which is useful when you want to load any custom exports
53 straight into nftables or ipset.
54
55 get-as ASN [ASN...]
56 This command returns the name of the owning organisation of the
57 Autonomous System.
58
59 list-countries [--show-name] [--show-continent]
60 Lists all countries known to the database.
61
62 With the optional parameters --show-name and --show-continent, the
63 name and continent code will be printed, too.
64
65 list-networks-by-as [--family=[ipv6|ipv4]] [--format=FORMAT] ASN
66 Lists all networks which belong to this Autonomous System.
67
68 The --family parameter can be used to filter output to only IPv6 or
69 IPv4 addresses.
70
71 The --format parameter can change the output so that it can be
72 directly loaded into other software. For details see below.
73
74 list-networks-by-cc [--family=[ipv6|ipv4]] [--format=FORMAT]
75 COUNTRY_CODE
76 Lists all networks that belong to a country.
77
78 The country has to be encoded in ISO3166 Alpha-2 notation.
79
80 See above for usage of the --family and --format parameters.
81
82 list-networks-by-flags [--family=[ipv6|ipv4]] [--format=FORMAT]
83 [--anonymous-proxy|--satellite-provider|--anycast|--drop]
84 Lists all networks that have a certain flag.
85
86 See above for usage of the --family and --format parameters.
87
88 list-bogons [--family=[ipv6|ipv4]] [--format=FORMAT]
89 Lists all bogons (i.e. networks that are unknown to the database).
90
91 See above for usage of the --family and --format parameters.
92
93 lookup ADDRESS [ADDRESS...]
94 This command returns the network the given IP address has been
95 found in as well as its Autonomous System if that information is
96 available.
97
98 search-as STRING
99 Lists all Autonomous Systems which match the given string.
100
101 The search will be performed case-insensitively.
102
103 update
104 This command will try to update the local database.
105
106 It will terminate with a return code of zero if the database has
107 been successfully updated. 1 on error, 2 on invalid call and 3 if
108 the database was already the latest version.
109
110 The --cron option allows limiting updates to once a day (daily),
111 once a week (weekly), or once a month (monthly). If the task is
112 being called, but the database has been updated recently, an update
113 will be skipped.
114
115 verify
116 Verifies the downloaded database.
117
118 version
119 Shows the version information of the downloaded database.
120
121 --help
122 Shows a short help text on using this program.
123
124 --version
125 Shows the program’s version and exists.
126
128 The location command will normally exit with code zero. If there has
129 been a problem and the requested action could not be performed, the
130 exit code is unequal to zero.
131
133 Some commands allow specifying the output format. This is helpful if
134 the exported data should be imported into a packet filter for example.
135 The following formats are understood:
136
137 • list (default): Just lists all networks, one per line
138
139 • ipset: For ipset
140
141 • nftables: For nftables
142
143 • xt_geoip: Returns a list of networks to be loaded into the xt_geoip
144 kernel module
145
147 The downloader checks a DNS record for the latest version of the
148 database. It will then try to download a file with that version from a
149 mirror server. If the downloaded file is outdated, the next mirror will
150 be tried until we have found a file that is recent enough.
151
153 Please report all bugs to the bugtracker at
154 https://bugzilla.ipfire.org/; refer to
155 https://wiki.ipfire.org/devel/bugzilla for details.
156
158 Michael Tremer
159
160
161
162 LOCATION(1)