Next Previous Contents

2. Introduction

The purpose of this package of programs is to assist the webmaster in blocking out entire countries from having access to his/her computer. Even small time webmasters, someone running a website on a single computer connected to a dsl or cable modem while using the same computer for online access will find this package useful.

If your website runs on a remote host, you might have limited use of this package. It all depends on the type of hosting package you have. For a 'dedicated' server, you should have all the functionality provided here. For a VPS (Virtual Private Server) setup, you might also have full functionality, provided your host allows access to the 'iptables' command on your server. If you're on a 'shared' server, then you will have limited use of this package. In that case, you will only be able to use the 'iptocountry.php' utility for looking up the countries that ip addresses belong to.

The core of this package makes use of the iptables functionality in the Linux kernel. The included countryiptables.php program will generate a file containing a list of iptables rulesets that may be loaded into the kernel. Every possible range of addresses identified as belonging to each country that you select will be in this file. To do this manually would be a daunting task. That's why we have programs such as this to do the work for us.

This package also includes a handy utility called iptocountry.php that lets you look up an IP address and identify the country it belongs to as well as the entire range of addresses it falls within.

Next Previous Contents