Add IP2Location Database as NetScaler’s Location File

This tutorial shows you on how to add the IP2Location database as the location file for NetScaler GLSB (Global Server Load Balancing) configuration. NetScaler supported 4 types of IP2Location database, the CSV format file, namely the IP-Country database (DB1 or DB1.LITE), IP-Country-ISP (DB2), IP-Country-Region-City (DB3 or DB3.LITE) and IP-Country-Region-City-ISP (DB4).

The DB1DB2DB3 and DB4 are the commercial packages available for purchase at https://www.ip2location.com. The DB1.LITE and DB3.LITE are the free packages available for download at https://lite.ip2location.com.

Below are the command to load the location file for each database type:

IP2Location DB1 or DB1.LITE
add locationFile <locationFile> -format ip-country

IP2Location DB2
add locationFile <locationFile> -format ip-country-isp

IP2Location DB3 or DB3.LITE
add locationFile <locationFile> -format ip-country-region-city

IP2Location DB4
add locationFile <locationFile> -format ip-country-region-city-isp

Add Location File

The tutorial below will demonstrate the installation steps using the free DB1.LITE database.

  1. Download the DB1.LITE database (CSV format) from https://lite.ip2location.com.
  2. Unzip the file and upload IP2LOCATION-LITE-DB1.CSV to NetScaler server.
  3. Login to NetScaler CLI and issue the below command. Note: Assuming the database was uploaded to NetScaler’s /var folder.
    add locationFile /var/IP2LOCATION-LITE-DB1.CSV -format ip-countryNote: Enter nscli command to log into NetScaler CLI, if you are on the linux terminal.

Test Location File

  1. Enter show locationparameter to view the newly installed location file and the entries.
  2. Enter shell to exit the NetScaler CLI, if you are currently log into.
  3. Enter the below command line on the linux terminal to test the location file.nsmap -d -t

Was this article helpful?

Related Articles