nslocation configure
参考链接:
https://blog.csdn.net/citrixtechsupport/article/details/44700145
https://support.citrix.com/article/CTX130241
https://support.citrix.com/article/CTX130155
https://support.citrix.com/article/CTX133758
/var/netscaler/inbuilt_db/nslocation.csv
NSGEO1.0 Context=geographic Qualifier1=Continent Qualifier2=Country_Code Qualifier3=Subdivision_1_Name Qualifier4=Subdivision_2_Name Qualifier5=City Start 1.0.0.0,1.0.0.255,,AU,,,,,133.0000,-27.0000 1.0.1.0,1.0.1.255,,CN,,,,,105.0000,35.0000 1.0.2.0,1.0.3.255,,CN,,,,,105.0000,35.0000 1.0.4.0,1.0.7.255,,AU,,,,,133.0000,-27.0000 1.0.8.0,1.0.15.255,,CN,Guangdong,,Guangzhou,,113.2500,23.1167 1.0.16.0,1.0.31.255,,JP,"Tky",,Tokyo,,139.7514,35.6850 1.0.32.0,1.0.63.255,,CN,Guangdong,,Guangzhou,,113.2500,23.1167 1.0.64.0,1.0.127.255,,JP,Hiroshima,,Hiroshima,,132.4594,34.3963 1.0.128.0,1.0.131.255,,TH,,,,,100.4667,13.7500
Configuration Command
> show locationparameter Static Proximity ---------------- Database mode: Not applicable Flushing: Idle; Loading: Idle Context: geographic Qualifier 1 label: Continent Qualifier 2 label: Country Qualifier 3 label: Region Qualifier 4 label: City Qualifier 5 label: ISP Qualifier 6 label: Organization Location file (format: Not applicable): Not loaded Lines: 0 Warnings: 0 Errors: 0 Current static entries: 0 Current custom entries: 0 Done > > set locationParameter -q2label Country_Code -q3label Subdivision_1_Name -q4label Subdivision_2_Name -q5label City Done > add locationFile "/var/netscaler/inbuilt_db/nslocation.csv" -format netscaler Done > > show locationparameter Static Proximity ---------------- Database mode: File Flushing: Idle; Loading: In progress Context: geographic Qualifier 1 label: Continent Qualifier 2 label: Country_Code Qualifier 3 label: Subdivision_1_Name Qualifier 4 label: Subdivision_2_Name Qualifier 5 label: City Qualifier 6 label: Organization Location file (format: netscaler): /var/netscaler/inbuilt_db/nslocation.csv Lines: 0 Warnings: 0 Errors: 0 Current static entries: 0 Current custom entries: 0 Done > >
nsmap test ip database
root@netscaler# ps -waux | grep nsmap root 1107 0.0 0.0 29924 148 ?? Is Tue06PM 0:04.31 /netscaler/nsmap -l root@netscaler# root@netscaler# nsmap -h nsmap [[-h] [-d] [-dbfile <filename> || -dbfile6 <filename>] [-f <format name>] [-o <file name>]] | [-l] file -h prints this message -f specifies format of the input file netscaler (default) - netscaler format ip-country - IP-Country format (ip2location.com) ip-country-isp - IP-Country-ISP format (ip2location.com) ip-country-region-city - IP-Country-Region-City (ip2location.com) ip-country-region-city-isp - IP-Country-Region-City-ISP (ip2location.com) geoip-country - GeoIP country (maxmind.com) geoip-region - GeoIP region (maxmind.com) geoip-city - GeoIP city (maxmind.com) geoip-country-org - GeoIP Country Organization (maxmind.com) geoip-country-isp - GeoIP Country ISP (maxmind.com) geoip-city-isp-org - GeoIP City ISP Organization (maxmind.com) geoip-country6 - GeoIP Country IPv6 (maxmind.com) netscaler6 - netscaler format with IPv6 addresses -o specifies output netscaler format file -l runs as daemon and communicates with the NetScaler kernel or PPE -d creates user space database, may be overwritten by kernel -dbfile name of the user space database file -dbfile6 name of the user space database file for ipv6 addresses -logfile logs data into the /var/tmp/nsmap.log instead of syslog Test the database: nsmap [-d] [-op] -t [ip address] -t test the database if ip address is given - non interactive test -op prints database test results in old format root@netscaler# root@netscaler# nsmap -d -t Enter IP address to test or q to exit: 1.0.0.250 1.0.0.250 1.0.0.0-1.0.0.255 "Australia and Oceania"."AU"."*"."*"."*"."*" 133 east -27 south Enter IP address to test or q to exit: 1.0.1.223 1.0.1.223 1.0.1.0-1.0.1.255 "Asia"."CN"."*"."*"."*"."*" 105 east 35 north Enter IP address to test or q to exit: 1.0.2.150 1.0.2.150 1.0.2.0-1.0.3.255 "Asia"."CN"."*"."*"."*"."*" 105 east 35 north Enter IP address to test or q to exit: 1.0.4.9 1.0.4.9 1.0.4.0-1.0.7.255 "Australia and Oceania"."AU"."*"."*"."*"."*" 133 east -27 south Enter IP address to test or q to exit: 1.0.8.7 1.0.8.7 1.0.8.0-1.0.15.255 "Asia"."CN"."Guangdong"."*"."Guangzhou"."*" 113 east 23 north Enter IP address to test or q to exit: 1.0.16.98 1.0.16.98 1.0.16.0-1.0.31.255 "Asia"."JP"."Tky"."*"."Tokyo"."*" 140 east 36 north Enter IP address to test or q to exit: 1.0.32.69 1.0.32.69 1.0.32.0-1.0.63.255 "Asia"."CN"."Guangdong"."*"."Guangzhou"."*" 113 east 23 north Enter IP address to test or q to exit: 1.0.64.37 1.0.64.37 1.0.64.0-1.0.127.255 "Asia"."JP"."Hiroshima"."*"."Hiroshima"."*" 132 east 34 north Enter IP address to test or q to exit: 1.0.128.99 1.0.128.99 1.0.128.0-1.0.131.255 "Asia"."TH"."*"."*"."*"."*" 100 east 14 north Enter IP address to test or q to exit: q root@netscaler#