Page 1 of 1
Allow certain country's
Posted: Sun Feb 17, 2008 5:46 pm
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?
Re: Allow certain country's
Posted: Sun Feb 17, 2008 9:13 pm
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.
Re: Allow certain country's
Posted: Mon Feb 18, 2008 9:07 am
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.
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.
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?
Re: Allow certain country's
Posted: Mon Feb 18, 2008 4:18 pm
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;
};
Re: Allow certain country's
Posted: Mon Feb 18, 2008 7:41 pm
by JimmyBoom
And there's no faster way?
Because if there's not I'm busy a couple of days.
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;
};
?
Re: Allow certain country's
Posted: Mon Feb 18, 2008 7:46 pm
by Stealth
There is only 1 IP and 1 hostname allowed per allow block.
Re: Allow certain country's
Posted: Mon Feb 18, 2008 8:49 pm
by JimmyBoom
Ok, too bad.
So I'm busy for a couple of days then..
But thx for the info

Re: Allow certain country's
Posted: Tue Feb 19, 2008 2:06 pm
by JimmyBoom
Aren't many IP's added each day to a country?
because if that's true, I must update it everytime..
Re: Allow certain country's
Posted: Tue Feb 19, 2008 2:17 pm
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.
Re: Allow certain country's
Posted: Tue Feb 19, 2008 5:11 pm
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.
Re: Allow certain country's
Posted: Thu Feb 21, 2008 6:00 pm
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.
Re: Allow certain country's
Posted: Thu Feb 21, 2008 6:37 pm
by Stealth
Actually all Internet IP ranges should be on CIDR. Some ranges it's a little harder to get the CIDR for
Re: Allow certain country's
Posted: Thu Mar 27, 2008 6:39 pm
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;
};
Re: Allow certain country's
Posted: Thu Mar 27, 2008 8:21 pm
by Casper
It would be if all hosts could resolve.
Re: Allow certain country's
Posted: Thu Mar 27, 2008 8:37 pm
by santa2452
true just thought it would be easier but not all host resolve so it would be a bit difficult