Jun 082016

Here is how you can compile and install xtables-addons on CentOS 7.
first, Install Dependencies:

# yum install gcc gcc-c++ make automake unzip zip xz kernel-devel-`uname -r` wget unzip iptables-devel perl-Text-CSV_XS

download xtables-addons

# wget http://ufpr.dl.sourceforge.net/project/xtables-addons/Xtables-addons/xtables-addons-2.10.tar.xz

extract, compile and install

# tar -xJf xtables-addons-2.10.tar.xz
# cd xtables-addons-2.10
# configure
# make && make install


and now for example we want to use geoip module, first of all install geoip database for xtables-addons.
still from xtables-addons-2.10 directory.

# cd geoip
# ./xt_geoip_dl
# ./xt_geoip_build GeoIPCountryWhois.csv
# mkdir -p /usr/share/xt_geoip
# cp -r {BE,LE} /usr/share/xt_geoip
# modprobe xt_geoip

if you want only allow ssh connection from certain country(ie. ID) and drop the rest here’s how to do it.

# iptables -I INPUT -p tcp --dport 22 -m geoip ! --src-cc ID -j DROP
Apr 092010

Continuing previous article about Building xtables-addons1-1.24 RPM Package, Now added feature which allow us to build the package with options
for example:

$ rpmbuild -ta xtables-addons-1.24.tar.bz2 --with ACCOUNT --with ipset --with geoip

With this command, only ACCOUNT,ipset,geoip modules would be built, other xtables-addons modules are not built(discarded)

Availble options:

--with ACCOUNT
--with CHAOS
--with DELUDE
--with DHCPMAC
--with ECHO
--with IPMARK
--with LOGMARK
--with RAWNAT
--with STEAL
--with SYSRQ
--with TARPIT
--with TEE
--with condition
--with fuzzy
--with geoip
--with iface
--with ipp2p
--with ipset
--with ipv4options
--with length2
--with lscan
--with pknock
--with psd
--with quota2

Continue reading »