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 DB1, DB2, DB3 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
add locationFile <locationFile> -format ip-country-isp
IP2Location DB3 or DB3.LITE
add locationFile <locationFile> -format ip-country-region-city
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.
- Download the DB1.LITE database (CSV format) from https://lite.ip2location.com.
- Unzip the file and upload IP2LOCATION-LITE-DB1.CSV to NetScaler server.
- 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
nsclicommand to log into NetScaler CLI, if you are on the linux terminal.
Test Location File
show locationparameterto view the newly installed location file and the entries.
shellto exit the NetScaler CLI, if you are currently log into.
- Enter the below command line on the linux terminal to test the location file.
nsmap -d -t