Skip to content

조회 수 10351 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

kernel 버전: linux-2.6.18.4

OS 버전: CentOS 4.4

 

- geoip설치 시 필요한 파일 목록 입니다.

 

tar xvfj linux-2.6.16.27.tar.bz2

tar xvfj iptables-1.3.5.tar.bz2

tar xvfz iproute2-2.6.16-060323.tar.gz

tar xvfj patch-o-matic-ng-20060626.tar.bz2

tar xvfj patch-o-matic-ng-20060511.tar.bz2

tar xvfz esfq-2.6.15.1.tar.gz

tar xvfz netfilter-layer7-v2.2.tar.gz

 

-  linux커널소스 및 iptable 소스를 /usr/src에 압축을 풀로 linux 및 iptables로 각각 심볼릭링크를 걸어줍니다.

 

[root@localhost ~]# ln -s /usr/src/linux-2.6.16.27 /usr/src/linux

[root@localhost ~]# ln -s /usr/src/iptables-1.3.5 /usr/src/iptables

 

- iptables소스 및 커널소스를 geoip설치 시 제대로 적용할 수 있도록 패치를 합니다.

[root@localhost ~]# patch -p1 < ../netfilter-layer7-v2.2/kernel-2.6.13-2.6.16-layer7-2.2.patch

 

[root@localhost ~]# cd /usr/src/iptables

[root@localhost ~]# patch -p1 < ../netfilter-layer7-v2.2/iptables-layer7-2.2.patch

[root@localhost ~]# chmod +x extensions/.layer7-test

 

[root@localhost ~]# cd /usr/src/iproute2-2.6.16-060323

[root@localhost ~]# patch -p1 < ../esfq-2.6.15.1/esfq-iproute2.patch

 

[root@localhost ~]# cd /usr/src/linux

[root@localhost ~]# patch -p1 < ../esfq-2.6.15.1/esfq-kernel.patch

 

[root@localhost ~]# cd /usr/src/patch-o-matic-ng-20060511

[root@localhost ~]# patch -p1 < ../patch-geoip.patch

 

[root@localhost ~]# cd /usr/src/patch-o-matic-ng-20060626

[root@localhost ~]# patch -p1 < ../patch-connlimit.patch

 

[root@localhost ~]# /usr/src/patch-o-matic-ng-20060511

[root@localhost ~]# ./runme geoip nth

 

[root@localhost ~]# cd /usr/src/patch-o-matic-ng-20060626

[root@localhost ~]# ./runme time u32 connlimit ipp2p IPMARK ROUTE TARPIT

 

[root@localhost ~]# ./runme extra

 

만일 실행 중 아래와 같이 메시지가 발생하였을 경우

Do you want to apply this patch [N/y/t/f/a/r/b/w/q/?] y

unable to find ladd slot in src /tmp/pom-8915/net/ipv4/netfilter/Makefile (./patchlets/geoip/linux-2.6/./net/ipv4/netfilter/Makefile.ladd)

 

patch-o-matic-ng 의 Makefile내용을 kernel netfilter Makefile에 추가시켜 줍니다.

[root@localhost ~]# cat /usr/src/patch-o-matic-ng-20060511/patchlets/geoip/linux-2.6/net/ipv4/netfilter/Makefile.ladd >> /usr/src/linux/net/ipv4/netfilter/Makefile

 

[root@localhost ~]# cd /usr/src/linux

[root@localhost ~]# make menuconfig

 

Networking --->

[*] Networking support

Networking options --->

[*] Network packet filtering (replaces ipchains) --->

V t?chto podsekc?ch za?krt?me, co se d?:

Core Netfilter Configuration --->

IP: Netfilter Configuration --->

(M)geoip match support

 

iptables 및 kenel 및 iproute 소스를 컴파일 합니다.

 

[root@localhost ~]# cd /usr/src/iproute2-2.6.16-060323

[root@localhost ~]# make

[root@localhost ~]# make install

 

[root@localhost ~]# cd /usr/src/iptables

[root@localhost ~]# make

[root@localhost ~]# make install

 

[root@localhost ~]# cd /usr/src/linux

[root@localhost ~]# make bzImage

[root@localhost ~]# make modules

[root@localhost ~]# make modules_install

[root@localhost ~]# make install

 

커널컴파일을 완료된 후 컴파일한 버전의 커널로 부팅하면 이제 iptables의 geoip를 사용할

준비가 되었습니다.

사용가능한 옵션은 --src-cc와 --dst-cc이 있는데,각각 뒤에 국가코드명이 들어가면 됩니다. 예를 들면,

# 일본과 미국에서의 웹 접속을 차단하고 다른 곳에서의 접속은 허용하고자 할 때

[root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -m geoip --src-cc JP,US -j DROP

[root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT

# 한국에서의 ftp만 허용하고 나머지 국가에서의 접속은 차단하고자 할 때

[root@localhost ~]# iptables -A INPUT -p tcp --dport 21 -m geoip --src-cc KR -j ACCEPT

[root@localhost ~]# iptables -A INPUT -p tcp --dport 21 -j DROP

[root@localhost ~]# iptables -A INPUT -p tcp --dport 21 -m geoip --src-cc KR -j ACCEPT

# 중국에서의 웹 접속을 차단하고 다른 곳에서의 접속은 허용하고자 할 때

root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -m geoip --src-cc CN -j DROP

[root@localhost ~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT

 

** 국가별 코드 **

 

대한민국        KR

네덜란드        NL

싱가포르        SG

포르투칼        PT

중국              CN

미국              US

일본               JP

독일              DE

호주              AU


  1. 보안서버 SSL 구동시 비밀번호 자동 입력 및 부팅시 자동 ...

    Date2009.03.23 ByADMINPLAY Views9318
    Read More
  2. 보안 체킹 프로그램 - portsentry

    Date2010.04.27 ByADMINPLAY Views16180
    Read More
  3. 매직키를 이용한 응급복구법

    Date2010.03.31 Byl2zeo Views32096
    Read More
  4. 리눅스용 백신 AVG

    Date2009.06.04 ByADMINPLAY Views9091
    Read More
  5. 리눅스용 각종 보안도구 사이트모음

    Date2009.07.12 ByADMINPLAY Views33716
    Read More
  6. 리눅스서버에서 ping(ICMP) 열기/닫기

    Date2009.08.18 ByADMINPLAY Views14837
    Read More
  7. 리눅스 해킹점검 가이드

    Date2008.12.10 ByADMIN Views18241
    Read More
  8. 리눅스 아이피 차단 해제

    Date2009.03.11 ByADMINPLAY Views10542
    Read More
  9. 리눅스 보안 - 권한설정에 주의해야할 명령어들은 ?

    Date2010.03.31 Byl2zeo Views27748
    Read More
  10. 리눅스 - iptables NAT rule

    Date2010.03.24 ByADMINPLAY Views9672
    Read More
  11. 기본 tcpdump사용법

    Date2009.05.22 ByADMINPLAY Views11699
    Read More
  12. 국가별로 접속 차단설정(geoip 설치)

    Date2009.05.10 ByADMINPLAY Views10351
    Read More
  13. 간단한 보안 설정 (TCP Wrapper)

    Date2009.05.22 ByADMINPLAY Views8944
    Read More
  14. [적용] iptables 접속 차단 스크립트

    Date2010.05.03 ByADMINPLAY Views25686
    Read More
  15. [그누보드관련] $_POST 는 이미 오염된(?) 변수다.

    Date2010.11.18 ByADMINPLAY Views16139
    Read More
  16. ZONE-H.KR

    Date2008.11.11 ByADMIN Views8546
    Read More
  17. wowhacker.com

    Date2008.11.11 ByADMIN Views8069
    Read More
  18. Tcpdump 사용법

    Date2009.06.06 ByADMINPLAY Views11159
    Read More
  19. Tcpdump 용어 정리

    Date2010.01.30 ByADMINPLAY Views8509
    Read More
  20. SYN Flooding공격에 대한 대비

    Date2009.09.24 ByADMINPLAY Views12967
    Read More
Board Pagination Prev 1 2 3 4 5 Next
/ 5

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234