This is an old revision of the document!
GeoIP Filtering on Ubuntu 12.04 LTS
Though Ubuntu Linux offers packages for GeoIP filtering, some manual steps are still required for realization.
- Install the Kernel module + userspace programs
sudo aptitude install xtables-addons-common
- Create the directory for the GeoIP list
sudo mkdir /usr/share/xt_geoip
- Install the Perl module (optional)
sudo aptitude install libtext-csv-xs-perl
- Download GeoIP list
sudo /usr/lib/xtables-addons/xt_geoip_dl
- Convert the GeoIP list
sudo /usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv
- Test everything
sudo iptables -F && iptables -A OUTPUT -m geoip --dst-cc US -j DROP
References:
- Robert Haddon's Blog, Words from High, (last visited on 2012-10-27)
- xtables on sourceforge.net, (last visited on 2012-10-27)