Allow certain country's

These are old archives. They are kept for historic purposes only.
Post Reply
JimmyBoom
Posts: 36
Joined: Mon Oct 02, 2006 2:09 pm

Allow certain country's

Post by JimmyBoom »

Hey

How do you only allow certain country's to your server?
My solution was:

Code: Select all

allow {
	ip             LALA;
	hostname       *@*.nl;
	class           clients;
	maxperip 5;
};
and

Code: Select all

allow {
	ip             LALA;
	hostname       *@*.be;
	class           clients;
	maxperip 5;
};
But if someone connects and his IP cannot be resolved he can't get on the server, so that's not a solution for it.

Anyone else got a solution for this?
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Allow certain country's

Post by Stealth »

You would need to look up the IPs of the countries you wish to allow, get their CIDR, and make allow blocks for each CIDR in the IP setting.
JimmyBoom
Posts: 36
Joined: Mon Oct 02, 2006 2:09 pm

Re: Allow certain country's

Post by JimmyBoom »

And where can you look up the IP's of the country?
I've found a site there is it in a *.txt file and that are too many. :x

What is CIDR?
Sorry if that's a lame question..

And where can you look up the IP's of the country?
I've found a site there is it in a *.txt file and that are too many. :x

What is CIDR?
Sorry if that's a lame question..

Is it like this:

196.32.208.0/21
199.7.70.0/24
199.7.82.0/24
etc..

So then it is:

Code: Select all

allow {
   ip             196.32.208.0/21;
   hostname       LALA;
   class           clients;
   maxperip 5;
};
Or is this wrong?
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Allow certain country's

Post by Stealth »

The only way I know of to look up a country's CIDR ranges is to search for a list on Google. There are many for each country, even small ones

About CIDR: http://www.unrealircd.com/files/docs/un ... ature_cidr

Code: Select all

allow {
   ip             196.32.208.0/21;
   hostname       *.be;
   class           clients;
   maxperip 5;
};
JimmyBoom
Posts: 36
Joined: Mon Oct 02, 2006 2:09 pm

Re: Allow certain country's

Post by JimmyBoom »

And there's no faster way?
Because if there's not I'm busy a couple of days. :P

Can't it be:

Code: Select all

allow {
   ip            196.32.208.0/21
   ip            199.7.70.0/24
   ip            etc
  hostname       *.nl;
   class           clients;
   maxperip 3;
};
?
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Allow certain country's

Post by Stealth »

There is only 1 IP and 1 hostname allowed per allow block.
JimmyBoom
Posts: 36
Joined: Mon Oct 02, 2006 2:09 pm

Re: Allow certain country's

Post by JimmyBoom »

Ok, too bad.
So I'm busy for a couple of days then..
But thx for the info ;)
JimmyBoom
Posts: 36
Joined: Mon Oct 02, 2006 2:09 pm

Re: Allow certain country's

Post by JimmyBoom »

Aren't many IP's added each day to a country?
because if that's true, I must update it everytime..
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Re: Allow certain country's

Post by Jobe »

Yes, IP's do change from country to country but not that often, Either way it still means you will need to keep yourself up to date and change your configs every time.
Your IP: Image
Your Country: Image
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Allow certain country's

Post by Stealth »

The best way to do this would probably be adding a feature on a website to request access or report the lack of access for IP ranges. Then tell your users to do this if they cannot access your server.
JimmyBoom
Posts: 36
Joined: Mon Oct 02, 2006 2:09 pm

Re: Allow certain country's

Post by JimmyBoom »

Stealth wrote:The best way to do this would probably be adding a feature on a website to request access or report the lack of access for IP ranges. Then tell your users to do this if they cannot access your server.
Yeah, was thinking about that, to add to the forum of my site if they can't connect.
Because I've already ahd some problems with CIDR, because not every IP-range is on it.
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Re: Allow certain country's

Post by Stealth »

Actually all Internet IP ranges should be on CIDR. Some ranges it's a little harder to get the CIDR for
santa2452
Posts: 29
Joined: Thu Jun 14, 2007 7:23 pm
Location: Columbus
Contact:

Re: Allow certain country's

Post by santa2452 »

wouldnt it be easier to use a wild card for the ip.

Code: Select all

allow {
ip *;
host *@*.fr;
class clients;
maxperip 3;
};
Casper
Posts: 338
Joined: Sun Jul 08, 2007 7:44 am
Location: The Netherlands

Re: Allow certain country's

Post by Casper »

It would be if all hosts could resolve.
Ex Network-Administrator
santa2452
Posts: 29
Joined: Thu Jun 14, 2007 7:23 pm
Location: Columbus
Contact:

Re: Allow certain country's

Post by santa2452 »

true just thought it would be easier but not all host resolve so it would be a bit difficult
Post Reply