This shows you the differences between two versions of the page.
|
|
howtos:geoip_on_ubuntu [2012/10/27 17:42] zimbernimbra |
howtos:geoip_on_ubuntu [2020/09/16 20:57] |
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 <html><pre>sudo aptitude install xtables-addons-common</pre></html> | |
- Create the directory for the GeoIP list <html><pre>sudo mkdir /usr/share/xt_geoip</pre></html> | |
- Install the Perl module (optional) <html><pre>sudo aptitude install libtext-csv-xs-perl</pre></html> | |
- Download GeoIP list <html><pre>sudo /usr/lib/xtables-addons/xt_geoip_dl</pre></html> | |
- Convert the GeoIP list <html><pre>sudo /usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv</pre></html> | |
- Test everything <html><pre>sudo iptables -F && iptables -A OUTPUT -m geoip --dst-cc US -j DROP</pre></html> This will block all outgoing traffic to IP addresses located in the USA, next you can try to visit [[http://www.google.com|Google]], this should not work anymore. LOL | |
| |
__References:__ | |
| |
- Robert Haddon's Blog, <html><a href="http://roberthaddon.blogspot.com/2011/09/geoip-filtering-on-ubuntu-1104-natty.html" class="urlextern" title="http://roberthaddon.blogspot.com" rel="nofollow" target="_blank">Words from High</a></html>, (last visited on 2012-10-27) | |
- <html><a href="http://xtables-addons.sourceforge.net" class="urlextern" title="http://xtables-addons.sourceforge.net" rel="nofollow" target="_blank">xtables on sourceforge.net</a></html>, (last visited on 2012-10-27) | |