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
2 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