Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
howtos:geoip_on_ubuntu12.10 [2012/11/03 16:59]
zimbernimbra created
howtos:geoip_on_ubuntu12.10 [2020/09/16 20:57] (current)
Line 1: Line 1:
-xxx+===== GeoIP filtering on Ubuntu 12.10 ===== 
 + 
 +Though Ubuntu Linux offers packages for GeoIP filtering, with version 12.10 GeoIP filtering doesn't work anymore. Ubuntu decided to stay at version 1.42 of xtables which is incompatible with kernel 3.5. Kernel 3.5 is the standard in Ubuntu 12.10. The only fast way to overcome this issue was to upgrade to the latest version of xtables - 1.47.1 as of 3rd of November 2012. 
 + 
 +The following will describe the necessary steps to do, please remember that any upgrade of the kernel will require to install the module again! 
 + 
 +  - Download the source from xtables. 
 +  - Unpack the source <html><p><pre>sudo tar -xvJf xtables-addons-1.47.1.tar.xz</pre></p></html> 
 +  - Change into the source direcotry and run the configuration script <html><p><pre>sudo ./configure</pre></p></html> 
 +  - Compilation <html><p><pre>sudo make</pre></p></html> 
 +  - Install the Kernel module + userspace programs <html><p><pre>sudo make install</pre></p></html> 
 + 
 +Optional steps, if you didn't install GeoIP before: 
 +  - Create the directory for the GeoIP list <html><p><pre>sudo mkdir /usr/share/xt_geoip</pre></p></html> 
 +  - Install the Perl module (optional)<html><p><pre>sudo aptitude install libtext-csv-xs-perl</pre></p></html> 
 +  - Download GeoIP list<html><p><pre>sudo /usr/lib/xtables-addons/xt_geoip_dl</pre>This will download the list to the current directory, if you want to change this, do that before execution of this command!</p></html> 
 +  - Convert the GeoIP list<html><p><pre>sudo /usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip *.csv</pre>This will build the output files in /usr/share/xt_geoip and assumes the GeoIP list is located in the current directory. Please also note, that you have to specify "*.csv", otherwise nothing will happen.</p></html> 
 +  - Test everything<html><p><pre>sudo iptables -F && iptables -A OUTPUT -m geoip --dst-cc US -j DROP</pre> This will block all outgoing traffic to IP addresses located in the USA, next you can try to visit <a href="http://www.google.com" class="urlextern" title="http://www.google.com" rel="nofollow" target="_blank">Google</a>, this should not work anymore.</p></html> If you want your firewall changes to be undone, just enter ''sudo iptables -F''
 + 
 +__References:__ 
 + 
 +  - <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-11-03)
  • Last modified: 2020/09/16 20:57