IP restriction (no hostnames) [bug or misconfiguration?]

These are old archives. They are kept for historic purposes only.
Post Reply
DaShizNit
Posts: 5
Joined: Fri Dec 10, 2004 1:38 pm

IP restriction (no hostnames) [bug or misconfiguration?]

Post by DaShizNit »

I have a question. How do I make it so Unreal only allows certain IPs to connect regardless of their hostnames?
In the /doc help file it says "Additionally, if you want to setup a block that only matches based on IP, then set the hostname to something invalid, such as "hostname NOBODY;", this will allow the block to only match based on IP.", so I have my .conf set up with:
allow {
ip *@111.111.111.*;
ip *@222.222.222.*;
ip *@333.333.333.*;
hostname NOBODY;
class clients;
password "mypasshere";
maxperip 5;
};
But if I try to connect from 111.111.111.111, which is on the allow list, it says that I can't connect to the ircd, it says "You are not authorized to connect to this server" but if I get rid of the ips and add only "ip *@*", I can connect.
Is this a bug, there's no way to make it restricted by IP only like the help file says, or am I missing something?
Thanks in advance for any help.
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post by Dukat »

I don't think you can add more than one "ip"-statement per allow block... Only add one and add another allow block instead.
DaShizNit
Posts: 5
Joined: Fri Dec 10, 2004 1:38 pm

Post by DaShizNit »

Well, I just removed all but 1, and still getting "You are not authorized to connect to this server" even though the ip is in the allow block.

Is this thing a bug or is there any other way to set that up?

Right now, the .conf looks like this:
allow {
ip *@111.111.111.*;
hostname NOBODY;
class clients;
password "mypasshere";
maxperip 5;
};
And connecting from 111.111.111.111 won't go through.

Any advices?
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post by Dukat »

You DID send the password, right?
DaShizNit
Posts: 5
Joined: Fri Dec 10, 2004 1:38 pm

Post by DaShizNit »

Dukat wrote:You DID send the password, right?
Give me some credit hehe ;)
yeah, I did send out the password.. not the only password protected ircd I connect to ;)
But just for the sake of it, I removed the password and restart it, and still the same "You are not authorized to connect to this server" message.
crazytoon
Posts: 20
Joined: Thu Jul 15, 2004 11:27 am
Location: Germany
Contact:

Post by crazytoon »

try this :


allow {
ip *@111.111.111.*;
hostname *@*;
class clients;
password "mypasshere";
maxperip 5;
};

is the host something like this :

someISP.123456.my.dom.com you can try this too :

hostname *@*.my.dom.com ;
DaShizNit
Posts: 5
Joined: Fri Dec 10, 2004 1:38 pm

Post by DaShizNit »

seems like it's working now... weirdly enough when I rehashed and restarted it, it would still not work. But when ./unreal stop and started it over, the ip protection kicked in.
Shouldn't that have worked with rehash or restart? I hope it was just this 1 time bug fluke thing, and that I won't have to kill the ircd again when I add another allow ip to the list. Though I just tested adding another one, and rehashed worked fine. So I guess it's just for the 1st time this thing is happening when u gotta kill the ircd for the new config to kick in, I don't know. Someone from dev team should take a look at it, cuz I didn't modify the .conf at all from when it wasn't working till I killed and restarted the ircd and all of a sudden it started working.
Anyways, thanks a lot for all your help everyone. Really appreciate it :)
Syzop
UnrealIRCd head coder
Posts: 2179
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Post by Syzop »

It works perfectly fine here, and yes after a rehash the changes are applied (tried your incorrect block-with-several-ip-items, rehash, remove them so only 1 is left, rehash, replace that item with the actual IP i wanted [192.168.*], rehash, got in).
I just assume you did something wrong (ha!), unless you can reproduce it again :p.
Ron2K

Post by Ron2K »

Hmm. I wonder if your IP had reverse DNS (which the IRCd then resolved), and the IRCd then attempted to match according to your hostname, decided that your hostname didn't match any allow blocks and denied you access. I'll give it a quick test just now and post the results when I come back tomorrow morning.
AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf »

Dukat wrote:I don't think you can add more than one "ip"-statement per allow block... Only add one and add another allow block instead.
Dukat is right, if you added more than one "ip"-statements in one single allow block, only one ip value, namely the first one would be used, the others would be simply ignored. (By the way, the next version of UnrealIRCd will warn you if there is a duplicate directive when shouldn't, including allow::ip.)
Ron2k wrote:Hmm. I wonder if your IP had reverse DNS (which the IRCd then resolved), and the IRCd then attempted to match according to your hostname, decided that your hostname didn't match any allow blocks and denied you access.
No, that's wrong. If there is a hostname/IP mismatch, Unreal skips checking if allow::hostname matches, however allow::ip is still checked (you know, "IP matches OR host matches"), and it's checked against the real IP of the client.
Ron2K

Post by Ron2K »

AngryWolf wrote:No, that's wrong. If there is a hostname/IP mismatch, Unreal skips checking if allow::hostname matches, however allow::ip is still checked (you know, "IP matches OR host matches"), and it's checked against the real IP of the client.
So I discovered when I tried it out this morning :P
Post Reply