Iptips is a program that blocks blacklisted-ipaddresses via Linux iptables NFQUEUE. (written in C,Lua,bash) optional: making ipaddress-blacklist (edit conf/drop.conf). Programs) 1:blackipd(C) managing ipaddress-Database (POSIX msg server). 2:blackip (C) registering(unregister) ipaddresses with the ipaddress-Database. 3:nfqd (C) nfqueue daemon (receiving packets from iptables NFQUEUE,POSIX msg client) 4:iptips.sh daemon start,stop script 5:mk_nfque.lua creating start_nfque.sh 6:start_nfque.sh nfqueue start_script 7:stop_nfque.lua nfqueue stop_script Requirement) 1:libnfnetlink,libnetfilter_queue (netfilter netlink library) 2:glib2 (GNOME library version 2) 3:zlog (C logging library) 4:Lua (version 5.2.x) 5:Penlight (Lua Library) 6:lfs (Lua Library) install) sudo yum install glib2 glib2-devel sudo yum install libnfnetlink libnfnetlink-devel\ libnetfilter_queue libnetfilter_queue-devel Lua library A)Penlight ex) sudo cp -r lua/pl /usr/local/share/lua/5.2/ B)lfs (LuaFileSystem) edit config make; sudo make install
Config) 1:blackdb.conf Batabase config 2:nfqueue.conf NFQUEUE config 3:drop.conf making ipaddress-blacklist (optional) 4:log.conf zlog config Install) tar xvf iptips-0.5.tar.gz cd iptips-0.5 1:make 2:edit passwd in your blackdb.conf. 3:edit nfqueue-number in your nfqueue.conf. if kernel >= 2.6.31 and iptables >= 1.4.5 num = 1:2 ==> -j NFQUEUE --queue-balance 1:2 4:mk_nfque.lua mk_nfque.lua ../conf/nfqueue.conf ==> start_nfque.sh 5:sudo make install default-target /var/lib/iptips 6:edit start,stop commands in your iptables-script. iptips.sh start iptips.sh stop ex) cat start_nfque.sh iptables -t raw -I PREROUTING -i eth0 -p tcp -j NFQUEUE --queue-bypass --queue-balance 1:2
7:register ipaddresses with the database. blackip -r 127.0.0.1 -p 123456 -a /home/proj/IptFW/Blacklists/blacklist.txt blackip -r 127.0.0.1 -p 123456 -c 5.5.5.5 blackip -r 127.0.0.1 -p 123456 --list 5 -f /home/proj/IptFW/Blacklists/blackip_5.txt blackip -r 127.0.0.1 -p 123456 --sum -f /home/proj/IptFW/Blacklists/blackip_sum.txt blackip -r 127.0.0.1 -p 123456 --save (if you use your database after rebooted.) Download License) GPL version 3 Author) H.Nakano Release) 2013.11.11 version 0.5