> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/gateway/guides/devolutions-server/rulesets.md). Agents can also search and read this documentation through its [MCP server](https://docs.devolutions.net/~gitbook/mcp).

# Gateway rulesets in Devolutions Server

Create Gateway rulesets in Devolutions Server to allow or deny hosts by IP, subnet, range or DNS name, with their own permissions.

A Gateway Ruleset restricts what users can reach through an existing Devolutions Gateway or gateway farm, without installing another gateway. It adds allow and deny rules (IP address, subnet, IP range, DNS name) and its own permissions on top of a "physical" gateway. Entries select the ruleset like any gateway; sessions still go through the physical gateway, but only to the hosts the rules allow, and only for the users and vaults the ruleset allows.

Use rulesets to give a team access to one segment of a network, to keep contractors away from some hosts, or to turn on proxy-based credential injection for RDP.

## Create a Gateway ruleset

1. In the Devolutions Server web interface, go to ***Administration*** – ***Devolutions Gateway***.
2. Click ***Add*** – ***Gateway Ruleset***.
3. In ***General***, select the ***Physical Gateway*** and enter a ***Name***.
4. In ***Allow rules*** and ***Deny Rules***, click ***Add rules***, choose the ***Type*** and enter the value for each rule.
5. In ***Role assignments***, assign the ***Gateway user*** role to the users and user groups that can use the ruleset. In ***Security***, choose the vaults in which the ruleset can be used.
6. Save.

The ruleset appears in the gateway list with its own health indicator, and in the ***Devolutions Gateway*** picker of entries. Its menu has ***Delete*** only. Deleting the physical gateway deletes its rulesets: "{0} virtual gateways will be deleted. Do you want to continue?"

In Remote Desktop Manager, the same dialog opens from ***Administration*** – ***Privileged access*** – ***Devolutions Gateway*** – ***Add*** – ***Gateway Ruleset***. With PowerShell, use `New-DSGatewayRuleset`, `Update-DSGatewayRuleset` and `New-DSGatewayRulesetAccessRule` (`-Access`, `-Type` IP/Subnet/Range/DNS, `-Value`).

## General

<table><thead><tr><th width="250">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Physical Gateway</strong></td><td>The gateway or farm that carries the sessions. Gateways that belong to a farm are not listed: choose their farm. A ruleset not linked to a gateway shows "This gateway ruleset is not currently linked to an existing gateway: "{0}"".</td></tr><tr><td><strong>Name</strong></td><td>Name shown in gateway pickers. Required.</td></tr><tr><td><strong>Description</strong></td><td>Optional.</td></tr><tr><td><strong>Set as default</strong></td><td>Entries set to the default gateway use this ruleset. Only one gateway, farm or ruleset is the default.</td></tr></tbody></table>

## Allow and deny rules

<table><thead><tr><th width="150">TYPE</th><th width="250">EXAMPLE</th><th>MATCHES</th></tr></thead><tbody><tr><td><strong>IP</strong></td><td><code>10.0.0.15</code></td><td>One IP address.</td></tr><tr><td><strong>Subnet</strong></td><td><code>10.0.0.0/24</code></td><td>Every address in the subnet (CIDR notation).</td></tr><tr><td><strong>Range</strong></td><td><code>192.168.1.100-200</code> or <code>192.168.1.50-192.168.1.60</code></td><td>Every address from the first to the last, included. A short end gives only the last number.</td></tr><tr><td><strong>DNS</strong></td><td><code>server01.example.com</code> or <code>*.example.com</code></td><td>The host name of the entry. <code>*</code> matches any characters. Not case-sensitive.</td></tr></tbody></table>

How Devolutions Server applies the rules when a session opens:

1. If the host matches a deny rule, the session is refused.
2. If the ruleset has at least one allow rule, the host must match one of them.
3. A ruleset without any rule allows every host the physical gateway can reach.

IP, subnet and range rules compare the IP address of the host; DNS rules compare its name.

## Security

<table><thead><tr><th width="300">SETTINGS</th><th>DESCRIPTION</th></tr></thead><tbody><tr><td><strong>Permissions</strong> – <strong>Can use</strong></td><td>Users, user groups and application identities allowed to open sessions through the ruleset.</td></tr><tr><td><strong>Vaults</strong></td><td><em><strong>All</strong></em>, <em><strong>Custom</strong></em> (with <em><strong>Batch grant access</strong></em>) or <em><strong>Never</strong></em>.</td></tr><tr><td><strong>Allow user vault</strong></td><td>Entries in users' own vaults can use the ruleset.</td></tr><tr><td><strong>Allow dynamic connections</strong></td><td>Quick connect and other dynamic connections can use the ruleset.</td></tr><tr><td><strong>Allow RDP reconnection</strong>, <strong>RDP token reuse window (Minutes)</strong></td><td>Lets RDP clients reconnect after a brief network interruption, within 1 to 15 minutes. Leaving it off is recommended.</td></tr><tr><td><strong>Enable RDP proxy-based credential injection</strong></td><td>For RDP sessions through this ruleset, the gateway signs in to the target with the entry's credentials; the user's computer never receives the password. See <a href="https://docs.devolutions.net/gateway/guides/connect/credential-injection.md">Proxy-based credential injection</a>.</td></tr></tbody></table>

## Force users through rulesets

To make sure nobody uses a gateway without rules, edit the physical gateway or farm and select ***Force Gateway rulesets*** in ***General***. The gateway is then hidden from entry gateway pickers, cannot be the default, and only its rulesets can be used. An entry that still points to the gateway directly fails with "Access denied for "{0}" on Devolutions Gateway "{1}". Devolutions Gateway ruleset is enforced."

## Messages users can see

<table><thead><tr><th width="450">MESSAGE</th><th>MEANING</th></tr></thead><tbody><tr><td>"Network access denied for "{0}" ({1}) on Devolutions Gateway ruleset "{2}" Connection: {3}, Rule type: {4}, Value: {5}"</td><td>The host matches the deny rule shown.</td></tr><tr><td>"Host "{0}" ({1}) does not match any allowed rules on Devolutions Gateway ruleset "{2}". Connection: {3}"</td><td>The ruleset has allow rules and the host matches none of them.</td></tr><tr><td>"The connection was blocked because it did not comply with the network access rules configured on the Devolutions Gateway ruleset."</td><td>Same cause, as shown in Remote Desktop Manager.</td></tr><tr><td>"Access denied for "{0}" on Devolutions Gateway "{1}". Devolutions Gateway ruleset is enforced. Connection: {2}"</td><td>The entry uses a gateway set to <em><strong>Force Gateway rulesets</strong></em>. Select a ruleset in the entry.</td></tr><tr><td>"You do not have permission to use this gateway."</td><td>The user is not in the ruleset's <em><strong>Can use</strong></em> permission.</td></tr><tr><td>"Access denied: the configured Devolutions Gateway can't be used in the current vault."</td><td>The entry's vault is not allowed in the ruleset's <em><strong>Vaults</strong></em>.</td></tr></tbody></table>

***Check health*** in entries is not available for rulesets and for gateways set to ***Force Gateway rulesets***: check the physical gateway instead.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/gateway/guides/devolutions-server/rulesets.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
