Welcome to WebmasterWorld Guest from 54.227.52.24

Forum Moderators: bakedjake

Message Too Old, No Replies

Firewall configuration

How to restrict access to the server from several countries?

     

ainars

12:23 am on May 18, 2003 (gmt 0)

10+ Year Member



I just installed Kiss My Firewall which is available here:
[geocities.com...]

It was easy to setup this script, but I am wondering how it's possible to restrict access to my server from some countries. For example, I don't have any business with Korea or China and all what I get from these countries is a huge amount of spam, different scans etc. So, I would like to put these countries in my black list.

Kiss My Firewall allows to create block list in the following form:

################################################################################
# #
# CONFIG #4 (of 5): BLOCK_LIST #
# #
# This is where you can specify IP Addresses that you wish to block. If you #
# add a new one, simply restart this script for the changes to take effect. #
# #
# NOTE: More than one IP can be specified by separating with a space: #
# Ex. BLOCK_LIST="111.11.111.111 222.22.222.222 333.33.333.333" #
# #
################################################################################

What if I want to put a range of addresses in this list, for example: 61.4.64.0 - 61.4.79.255

What will be the right form? Like this:

61.4.64.*

or like this:

61.4.64.0/20

Lists of Chinese and Korean Ip addresses can be found here (if anyone interested):
[okean.com...]
[okean.com...]

Air

2:24 am on May 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had a look at KMF and it is a bash script that issues commands to IPTABLES, so the syntax rules of IPTABLES are what you want to use. i.e your second example (CIDR notation) is what you want.

There is a handy table here [ralphb.net] that may be useful to you or others. It shows for example, that if you wanted to block an entire class "c" (254 addresses) you would use "/24" as in xxx.xxx.xxx.xxx/24

Anyway hope this helps.

ainars

1:20 pm on May 18, 2003 (gmt 0)

10+ Year Member



Thank you, Air! It works.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month