내용으로 건너뛰기
GINS WIKI 긴스 위키
사용자 도구
로그인
사이트 도구
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
현재 위치:
긴스위키 GINS wiki
»
툴 tools
»
GeoIP 지오IP
추적:
검색
tool:geoip
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
<title>GeoIP 지오IP</title> ====== GeoIP ====== - 웹주소 : [[http://www.maxmind.com/app/geolitecountry|링크]] - 다운로드 주소 : [[http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip|링크]] - CSV를 사용한 IP 검사 : [[http://www.maxmind.com/app/csv|링크]] - GeoIP를 활용하는 방식 : [[http://www.maxmind.com/app/geoip_resources|링크]] ====== GeoIP 검사시, 숫자로 변경 하는 방식 ====== * from [[http://www.maxmind.com/app/csv|링크]] CSV 파일 포맷: <code> "begin_ip","end_ip","begin_num","end_num","country","name" "61.88.0.0","61.91.255.255","1029177344","1029439487","AU","Australia" "61.92.0.0","61.93.255.255","1029439488","1029570559","HK","Hong Kong" "61.94.0.0","61.94.7.255","1029570560","1029572607","ID","Indonesia" </code> Beginning IP Number, Ending IP Number의 계산 방법: <code> ipnum = 16777216*w + 65536*x + 256*y + z where IP Address = w.x.y.z </code> 숫자에서 IP로 변경하는 방식: <code> w = int ( ipnum / 16777216 ) % 256; x = int ( ipnum / 65536 ) % 256; y = int ( ipnum / 256 ) % 256; z = int ( ipnum ) % 256; Where % is the mod operator. </code> Here is sample Perl code to convert the IP number to a IP address: <code> sub numToStr { my ($ipnum) = @_; my $z = $ipnum % 256; $ipnum >>= 8; my $y = $ipnum % 256; $ipnum >>= 8; my $x = $ipnum % 256; $ipnum >>= 8; my $w = $ipnum % 256; return "$w.$x.$y.$z"; } </code> **SQL Query** <code sql> SELECT ip_country FROM geoip WHERE 404232216 BETWEEN begin_ip_num AND end_ip_num LIMIT 1 </code> **MySQL Query** <code sql> SELECT ip_country FROM geoip WHERE 404232216 >= begin_ip_num AND 404232216 <= end_ip_num LIMIT 1 </code>
tool/geoip.txt
· 마지막으로 수정됨: 2024/04/23 22:43 저자
127.0.0.1
문서 도구
문서 보기
이전 판
역링크
맨 위로