Mask item

From UnrealIRCd documentation wiki
Jump to navigation Jump to search

In the configuration file there are various places where you can use a mask. A mask defines which host/IPs/users should be matched.

One or more mask entries[edit]

If you only need to match 1 entry then you can use the simple variant, eg:

    mask 127.*;

If you want to match multiple items, or if you just prefer this style, then you can use a list:

    mask { 10.*; 192.168.*; 127.0.0.0/8; }

Extended matching[edit]

In UnrealIRCd 5.2.1 and later Extended server bans syntax is also supported. This way you could, for example, add a second allow block with:

allow {
    mask ~a:TrustedUser;
    class clients;
    maxperip 10;
}

If TrustedUser is identified to services using SASL then that user will get a high maxperip restriction of 10.

Negative matching[edit]

Most people would use only normal (positive) matching, such as eg 127.*. However, it also positive to do negative matches, such as: !192.168.*.

If you use negative matching then the rules are as follows:

  • If all your entries use negative matching then we match by default, such as with mask { !192.168.*; !10.*; }:
    • 192.168.1.1: not a match
    • 10.1.1.1: not a match
    • Anything else: match!
  • If you mix both positive and negative matches then we do not match by default, example: mask { *.com; !irc1.*; !irc2.*; }:
    • irc1.example.com: not a match
    • irc2.example.com: not a match
    • irc3.example.com: match!
    • anything else: not a match