Unrealircd 3.2.3 redirect user connection

These are old archives. They are kept for historic purposes only.
Post Reply
robbtek
Posts: 13
Joined: Mon Sep 12, 2005 8:36 am

Unrealircd 3.2.3 redirect user connection

Post by robbtek »

I want to redirect users from specific ip (or subnet) to a specific server .
I'm trying with :

Code: Select all

allow {
        ip              *@XXX.XXX.XXX.XXX;
        hostname        *@XXX.XXX.XXX.XXX;
        class           clients;
        redirect-server my.second.server;
};

allow {
        ip             *@*;
        hostname       *@*;
        class           clients;
};
But it dont work , where is the error ?

Thanks
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post by Dukat »

Please read the documentation about allow blocks, robbtek:
http://www.vulnscan.org/UnrealIRCd/unre ... allowblock

(especially the part "About matching" could be interesting for you...)
If you don't make mistakes, you aren't really trying.
- Coleman Hawkins
robbtek
Posts: 13
Joined: Mon Sep 12, 2005 8:36 am

Post by robbtek »

I've read it , but I dont understand .

I've tryed with :

Code: Select all

allow {
        ip             *@*;
        hostname       *@*;
        class           clients;
};

allow {
        ip              *@XXX.XXX.XXX.XXX;
        hostname        NOBODY;
        class           clients;
        redirect-server irc2.myserver.com;
};
and ...

Code: Select all

allow {
        ip             *@*;
        hostname       *@*;
        class           clients;
};

allow {
        ip              *@XXX.XXX.XXX.XXX;
        hostname      *@XXX.XXX.XXX.XXX;
        class           clients;
        redirect-server irc2.myserver.com;
};
and ...

Code: Select all

allow {
        ip             *@*;
        hostname       *@*;
        class           clients;
};

allow {
        ip              *@XXX.XXX.XXX.XXX;
        class           clients;
        redirect-server irc2.myserver.com;
};
It doesn't work :(
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

You need to make another class that is always full. The redirect-server ONLY works when that class is full, otherwise, clients will be able to connect.
robbtek
Posts: 13
Joined: Mon Sep 12, 2005 8:36 am

Post by robbtek »

Code: Select all

allow {
        ip              *@XXX.XXX.XXX.XXX;
        hostname        NOBODY;
        class           clients;
        maxperip 0;
        redirect-server irc2.myserver.com;
};

allow {
        ip              *@XXX.XXX.XXX.XXX;
        hostname        NOBODY;
        class           clients;
        redirect-server irc2.myserver.com;
};
?
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

No, you need to make another CLASS. The maxperip setting is not another class.
robbtek
Posts: 13
Joined: Mon Sep 12, 2005 8:36 am

Post by robbtek »

Code: Select all

class   redirect_user {
        pingfreq 90;
        maxclients 0;
        sendq 100000;
        recvq 8000;
};

allow {
        ip             *@XXX.XXX.XXX.XXX;
        hostname       NOBODY;
        class           redirect_user;
        maxperip 0;
        redirect-server irc2.myserver.com;
};
??

DOnt work :(
mexx3k
Posts: 17
Joined: Sun Apr 10, 2005 8:54 pm
Location: Chaoz-IRC
Contact:

Post by mexx3k »

checkout the module "m_jumpserver" ... with that you can redirect user, either new connections, all connections ... you can specify the new server with port and ssl-instructions ...


we're using that when upgrading servers to redirect users in the IRC on another server before the shutdown ... works great :D
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

mexx3k, please read his posts :)

The allow block that is redirecting users MUST BE THE LAST ALLOW BLOCK IN THE CONF! You obviously did NOT read the documentation about matching like we told you, and you said.
Syzop
UnrealIRCd head coder
Posts: 2112
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Post by Syzop »

Also, a class with maxclients set to 0 is illegal.

I'm afraid you are trying to (ab)using a feature for something it wasn't designed for ;). The redirect-server stuff is meant for when a class or server is full, not some means for users to choose the closest server or anything.

You are aware of DNS round robin? (irc.blah.net pointing to several ips)
robbtek
Posts: 13
Joined: Mon Sep 12, 2005 8:36 am

Post by robbtek »

I dont think that rr is a good idea , because I want to redirect certain kind of connection (like by nationality) .

example : usa user redirect to usa server , eu user to eu server , specific subnet user to specific server ... etc ...
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post by Dukat »

Use different DNS pools (eu.irc.yourdomain.com, usa.irc.yourdomain.com).

You could also use "views" in BIND 9, i guess (see the documentation of BIND).
BIND 9 Administrator Reference Manual wrote:The view statement is a powerful new feature of BIND 9 that lets a name server answer a DNS query
differently depending on who is asking.
If you don't make mistakes, you aren't really trying.
- Coleman Hawkins
robbtek
Posts: 13
Joined: Mon Sep 12, 2005 8:36 am

Post by robbtek »

I havent write that I have dns amministration , I've ask how to redirect user to another server .
mexx3k
Posts: 17
Joined: Sun Apr 10, 2005 8:54 pm
Location: Chaoz-IRC
Contact:

Post by mexx3k »

Stealth wrote:mexx3k, please read his posts :)
okay, "redirect by origin" doesn't work ... i just saw the "redirect"-aspect :oops:
Post Reply