티스토리 뷰
- 설치환경 : CentOS Linux release 7.9.2009 (Core)
1. 패키지 설치하기
root@todle-todle:~:# yum -y install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` iptables-devel wget
※ 주의사항 : 설치되어진 kernel버전과 동일한 버전의 kernel-devel 을 설치해주셔야합니다.
yum 으로 설치 시 버전이 kernel과 버전이 맞지않는다면, 맞는 버전의 rpm 파일을 찾아 설치해주셔야 합니다:))
ex) rpm -qa | grep kernel or uname -r
위에 내용을 보시면 커널버전이 kernel-3.10.0-1160.el7.x86_64 라는것을 알 수 있습니다.
그렇다면 kernel-devel도 동일한 버전이 필요하게 됩니다.
수동 설치방법은 아래 사진1, 사진2 참고 !
root@todle-todle:~:# yum -y install perl-Text-CSV_XS
root@todle-todle:~:# wget http://ftp.orange-business.com/pub/CPAN/modules/by-category/05_Networking_Devices_IPC/NetAddr/NetAddr-IP-4.078.tar.gz
root@todle-todle:~:# wget https://sourceforge.net/projects/xtables-addons/files/Xtables-addons/xtables-addons-2.11.tar.xz
2. NetAddr-IP-4.078.tar.gz 설치하기
root@todle-todle:~:# tar xzf NetAddr-IP-4.078.tar.gz
root@todle-todle:~:# cd NetAddr-IP-4.078
root@todle-todle:~/NetAddr-IP-4.078:# perl Makefile.PL
※ 아래와 같은 에러가 생긴다면 "yum install perl-CPAN"을 설치 후 다시 perl Makefile.PL를 실행해주세요!
root@todle-todle:~/NetAddr-IP-4.078:# make && make install
3. xtables-addons-2.11.tar.xz 설치하기
root@todle-todle:~:# tar -xvf xtables-addons-2.11.tar.xz
root@todle-todle:~:# cd xtables-addons-2.11
root@todle-todle:~/xtables-addons-2.11:# vi mconfig
* 12번째 라인에 build_TARPIT=m 앞에 # 주석을 처리 후 저장 :wq
root@todle-todle:~/xtables-addons-2.11:# ./configure
root@todle-todle:~/xtables-addons-2.11:# make && make install
4. CSV파일 적용시키기
root@todle-todle:~:# cd /root/xtables-addons-2.11/geoip
root@todle-todle:~/xtables-addons-2.11/geoip:# wget https://files-cdn.liferay.com/mirrors/geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
root@todle-todle:~/xtables-addons-2.11/geoip:# unzip GeoIPCountryCSV.zip
root@todle-todle:~/xtables-addons-2.11/geoip:# ./xt_geoip_build GeoIPCountryWhois.csv
root@todle-todle:~/xtables-addons-2.11/geoip:# mkdir -p /usr/share/xt_geoip
root@todle-todle:~/xtables-addons-2.11/geoip:# /bin/cp -r {BE,LE} /usr/share/xt_geoip/
--설치 끝--
root@todle-todle:~:# iptables -A INPUT -m geoip --src-cc CN -j DROP
설치 후 중국차단 잘 되는지 확인!
위에서 사용한 GeoIPCountryWhois.csv 파일은 오래된 파일이라서 최신 csv 파일이 있으시다면 그걸로 동일하게 적용하시면 됩니다!
글을 작성하면서 직접 설치도 같이하여 별다른 에러는 없을것으로 판단됩니다.
혹시라도 안되시는 부분이 있거나, 잘못된 부분이 있다면 언제든지 댓글 남겨주세요 ~
'Linux' 카테고리의 다른 글
[CentOS7/리눅스] Nginx-1.19.4 컴파일 설치 해보기 (0) | 2021.06.09 |
---|---|
[CentOS7] httpd-2.2.34 / mysql-5.1.73 / php-5.6.30 컴파일 설치 (0) | 2021.06.08 |
재미있는 Linux #2. cmatrix (0) | 2021.06.08 |
재미있는 Linux #1. asciiquarium (0) | 2021.06.08 |
[CentOS7] PHP 5.6 설치 (0) | 2021.06.08 |
- Total
- Today
- Yesterday
- 젠지
- T1
- centos
- 리눅스
- cmatrix
- LCK
- xtables-addons-2.11
- putty
- CVE-2022-3786
- asciiquarium
- iptables
- tcping
- mysql5.1
- 1.19.4
- 해외차단
- 재미있는
- CVE-2022-3602
- drx
- xtables
- centos7
- php
- 3.0.7
- CentOS6
- Linux
- 리그오브레전드
- ssh
- 3.0.4
- 재미
- 롤
- 3.0.0
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |