게시물 1,376건
   
Netfilter IP accounting for NET-SNMP
글쓴이 : 최고관리자 날짜 : 2009-12-12 (토) 20:23 조회 : 13826
글주소 :
ipaccttable-1.0.tar.bz2 (204.2K), Down : 12, 2009-12-12 20:23:51
                                

netfilter 규칙을 snmp 값으로 변환


인스톨 과정은 아래처럼.....

Installing
-----------------------------------------

1. Building
./configure --with-snmp-dlmod-dir=/path/to/snmp/dlmod/dir --with-snmp-mib-dir=/path/to/snmp/mib/dir
make
make install

2. Configuring Net-SNMP
add line to snmpd.conf:
dlmod ipAcctTable ipaccttable

3. Configuring Netfilter
iptables -t mangle -N Accounting
iptables -t mangle -A Accounting -s 10.1.1.1
iptables -t mangle -A Accounting -d 10.1.1.1
iptables -t mangle -A Accounting -s 10.1.1.2
iptables -t mangle -A Accounting -d 10.1.1.2
....


원하는 테이블과 체인을 수정해서 컴파일하려면...
src/ipacct-snmp.c 파일을 수정

#define IPACCT_TABLE            "filter"
#define IPACCT_TABLE_CHAIN      "FORWARD"



SNMPWALK 확인
SNMPv2-SMI::enterprises.14274.2.1.1.1.2.111.1.168.192 = Counter64: 0
SNMPv2-SMI::enterprises.14274.2.1.1.1.3.111.1.168.192 = Counter64: 543864
SNMPv2-SMI::enterprises.14274.2.1.1.1.4.111.1.168.192 = Counter64: 0
SNMPv2-SMI::enterprises.14274.2.1.1.1.5.111.1.168.192 = Counter64: 10713

Outbound bytes
3  Inbound bytes
4  Outbound pkts
5  Inbound bytes


MRTG  CFG
Target[192.168.1.111]: 1.3.6.1.4.1.14274.2.1.1.1.3.111.1.168.192&1.3.6.1.4.1.14274.2.1.1.1.2.111.1.168.192:elcap@xxx.xxx.xxx.xxx:::::2

최고관리자 2010-10-05 (화) 14:51

-- 1.3.6.1.4.1.14274.2.1.1.1.2


        ipAcctBytesIn OBJECT-TYPE
                SYNTAX OCTET STRING
                MAX-ACCESS read-only
                STATUS current
                DEscRIPTION "???"
                ::=  { ipAcctEntry 2 }


-- 1.3.6.1.4.1.14274.2.1.1.1.3


        ipAcctBytesOut OBJECT-TYPE
                SYNTAX OCTET STRING
                MAX-ACCESS read-only
                STATUS current
                DEscRIPTION "???"
                ::=  { ipAcctEntry 3 }


-- 1.3.6.1.4.1.14274.2.1.1.1.4


        ipAcctPktsIn OBJECT-TYPE
                SYNTAX OCTET STRING
                MAX-ACCESS read-only
                STATUS current
                DEscRIPTION "???"
                ::=  { ipAcctEntry 4 }


-- 1.3.6.1.4.1.14274.2.1.1.1.5


        ipAcctPktsOut OBJECT-TYPE
                SYNTAX OCTET STRING
                MAX-ACCESS read-only
                STATUS current
                DEscRIPTION "???"
                ::=  { ipAcctEntry 5 }

최고관리자 2011-03-10 (목) 09:55
./configure --with-snmp-dlmod-dir=/usr/lib/snmp/dlmod --with-snmp-mib-dir=/usr/lib/snmp/mib
이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.