location retrieves information from the location database. This data can be used to determine someone’s location on the Internet and for building firewall rulesets to block access from certain ASes or countries.

Installation

No installation is needed. location is part of the core package.

Usage

To run location with help just enter the command:

[root@ipfire ~] # location -h
usage: location [-h] [--debug] [--quiet] [--version] [--database DATABASE] [--public-key PUBLIC_KEY]
                {version,lookup,dump,update,verify,get-as,search-as,list-networks-by-as,list-networks-by-cc,list-networks-by-flags,list-bogons,list-countries,export}
                ...

Location Database Command Line Interface

positional arguments:
  {version,lookup,dump,update,verify,get-as,search-as,list-networks-by-as,list-networks-by-cc,list-networks-by-flags,list-bogons,list-countries,export}
    version             Show database version
    lookup              Lookup one or multiple IP addresses
    dump                Dump the entire database
    update              Update database
    verify              Verify the downloaded database
    get-as              Get information about one or multiple Autonomous Systems
    search-as           Search for Autonomous Systems that match the string
    list-networks-by-as
                        Lists all networks in an AS
    list-networks-by-cc
                        Lists all networks in a country
    list-networks-by-flags
                        Lists all networks with flags
    list-bogons         Lists all bogons
    list-countries      Lists all countries
    export              Exports data in many formats to load it into packet filters

options:
  -h, --help            show this help message and exit
  --debug               Enable debug output
  --quiet               Enable quiet mode
  --version             show program's version number and exit
  --database DATABASE, -d DATABASE
                        Path to database
  --public-key PUBLIC_KEY, -k PUBLIC_KEY
                        Public Signing Key