티스토리 뷰
Centos6.6 (2.6.32-504.16.2.el6.x86_64) + geoip + ipset 설치
사전 패키지 설치
yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` iptables-devel openssh-clients perl-CPAN irqbalance ntsysv vim pci* ncurses* ipvsadm bridge-utils wget libmnl* |
Text-CSV_XS 설치
rpm -i http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm yum install perl-Text-CSV_XS |
업데이트후 리부팅
yum update -y reboot |
xtables-addons 1.4.2 설치
공식홈페이지 http://xtables-addons.sourceforge.net |
geoip 설치
wget http://downloads.sourceforge.net/project/xtables-addons/Xtables-addons/1.42/xtables-addons-1.42.tar.xz tar xvf xtables-addons-1.42.tar.xz cd xtables-addons-1.42 vim mconfig (아래라인 제외하고 다 삭제 하거나 주석처리) build_geoip=m ./configure && make && make install
|
GEOIP DB 설치
cd geoip/ ./xt_geoip_dl ./xt_geoip_build GeoIPCountryWhois.csv mkdir -p /usr/share/xt_geoip/ cp -r {BE,LE} /usr/share/xt_geoip/ |
geoip + iptables 연동 테스트
iptables -A INPUT -m geoip --src-cc CN -j DROP iptables -D INPUT -m geoip --src-cc CN -j DROP |
ipset 4.5 설치
공식홈페이지 http://ipset.netfilter.org/index.html |
ipset 설치
wget thttp://ipset.netfilter.org/ipset-4.5.tar.bz2 tar xvfj ipset-4.5.tar.bz2 cd ipset-4.5 vim Makefile 수정 IP_NF_SET_MAX=2048 make && make install |
ipset + iptables 연동 테스트
ipset -N test iphash iptables -A INPUT -j SET --add-set test src iptables -D INPUT -j SET --add-set test src ipset -F test ipset -X test
|
ipset + geoip + iptables 연동 테스트
ipset -N test iphash iptables -A INPUT -m geoip --source-country CN -j SET --add-set test src iptables -D INPUT -m geoip --source-country CN -j SET --add-set test src ipset -F test ipset -X test |
설치 후기
최종적으로 ipset + geoip + iptables 를 같이 사용했을때 에러 메세지가 없다면 정상적으로 설치된것이다. 참고로 센트오에스 6 이외에 다른 커널에 설치하는 경우는 ipset 과 xtables-addonS 에 INSTALL 이나 README 파일을 열어보면 최소 필수 커널버젼등이 명시되어 있으니 참고하여 설치하면 된다. |
'Linux' 카테고리의 다른 글
geoip 국가 코드 (geoip country code) (0) | 2015.07.15 |
---|---|
리눅스 메모리 부족 및 oom_killer (0) | 2015.07.07 |
possible SYN flooding on port 80. Sending cookies 에 대한 대응책(?) (0) | 2015.06.12 |
apache tunning (아파치 튜닝) (0) | 2015.06.12 |
apache 기본 개념 정리 (0) | 2015.06.12 |
- Total
- Today
- Yesterday
- php
- yum
- WAF
- 리눅스
- glusterfs
- pptp
- virtualbox
- ntp
- IPSEC
- galera
- mod_security
- cURL
- MySQL
- Apache
- centOS7
- SSL
- NGINX
- mariadb
- HAProxy
- iptables
- kvm
- OpenVPN
- softether
- 베이어다이나믹
- L2TP
- gitlab
- centos8
- GeoIP
- ssh
- 인증서
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |