# Access control

**IP rules** exist at three levels: global (Security › Global), per listener and per endpoint. They work **exactly like CrushMFT's IP restrictions**:
- **First match wins**, in list order. Each rule is `allow` or `deny` plus a match and an optional note.
- **An empty list allows everyone.**
- **Any other list denies every client that no rule matches.** So a block list is its `deny` rules **followed by `allow *`**. A list with only `deny` rules denies everyone (warning RULES_DENY_ONLY; the editor offers "Add allow * at the end").
- **IPv4 and IPv6.** An `allow` rule that covers all of IPv4 (`0.0.0.0/0`, `0.0.0.0-255.255.255.255`, `*.*.*.*`) also admits every IPv6 client, as CrushMFT's allow row 0.0.0.0–255.255.255.255 does. No other IPv4 rule matches an IPv6 client, an IPv6 rule never matches an IPv4 client, a `deny` rule never widens, and `*` covers both. IPv4-mapped addresses (`::ffff:a.b.c.d`) are matched as IPv4.
- **Levels.** Global and listener lists are both checked when a client connects (both must allow). Endpoint lists then remove endpoints that may not serve the client; when none is left, `http`/`https` listeners answer 403 and other listeners reset the connection.
- **Match syntax:** an address (`203.0.113.7`, `2001:db8::1`), CIDR (`10.0.0.0/8`), a range (`10.0.0.1-10.0.0.99`), a CrushMFT pattern (`192.168.*` = 192.168.0.0–192.168.255.255; `10.*.*.5` = the range 10.0.0.5–10.255.255.5), or `*`. Host names are not allowed. One invalid entry makes the whole list fail closed (it denies everyone at startup; on a reload the previous list stays), and a save with one is refused.
- **When changes apply.** Global and listener rules apply to **new connections**; open sessions are not checked again. Endpoint rules apply from the next routing decision: the next new connection, or the **next request** of an open `http`/`https` session.
- **Examples:**
  - only two networks: `allow 10.20.0.0/16`, `allow 192.168.*` (everything else is denied);
  - a block list: `deny 203.0.113.0/24`, `deny 198.51.100.7`, `allow *`.
- **Test an IP** (Security) shows, for an address and optionally a listener, which rule decides at each level, on the saved configuration.
- **Block this IP** (Connections › a connection › Block this IP…) inserts a `deny` rule at the top of the global or the listener list; on an empty list it also appends `allow *`, so that only that address is denied. An IPv6 client is blocked as its /64. New connections are refused; open ones continue unless you also close them (Close all from this client…).
- **`admin_allowed_ips` and `trusted_proxies` are plain address lists, not rules:** IP literals and CIDR blocks only, no patterns, and an IPv4 entry, `0.0.0.0/0` included, never matches an IPv6 source.
- **Per-client caps.** `max_connections_per_client` (per listener) limits concurrent sessions per client (an IPv4 address or an IPv6 /64); extra connections are reset. It is off (0) by default. Set it on internet-facing listeners that have no upstream proxy and no large NAT in front. It is ignored on range listeners.
