# Configuring preferred routing

## **Overview**

Preferred routing is a useful feature when Parallels RAS users with different geo located deployments are connecting to the same Parallels RAS Farm/Site. A common access layer usage (RAS Secure Gateway, HALB, or a third-party load balancer) is not optimal if a resource is located in a different data center in the same RAS Farm/Site. The solution is to configure a preferred access layer server for a specific published resource, in which case any user would connect to a default Secure Gateway, but would be redirected using proximity rules set by the administrator. Typically, using the Secure Gateway closest to the session host provides improved user experience, reduced internal network traffic and associated costs along with providing better use of resources.

{% hint style="info" %}
**Note:** Preferred routing doesn't apply to Azure Virtual Desktop published objects.
{% endhint %}

Here's how preferred routing works:

1. Parallels Client establishes a connection with a Secure Gateway using a standard authentication.
2. Through the RAS Connection Broker, the resource's preferred route (if configured) is identified.
3. Parallels Client receives the preferred public address to launch the resource.
4. Parallels Client then tries to launch the resource through the redirected address and falls back to the original Gateway if it fails.

## **Configure preferred routing**

To configure preferred routing for a published resource:

1. In the RAS Console, select the **Publishing** category.
2. Select an existing published resource and then select the **Routing** tab.
3. Select the **Enable preferred routing** option.
4. Click **Tasks** > **Add**. The **Add preferred route** dialog opens. Read on.

In the **Add preferred route** dialog:

1. Type a name for this route and an optional description.
2. From the **Type** drop-down list, select one of the following:
   * **HALB Virtual Server**: Select a RAS HALB virtual server from the list below the **Type** field. Note that for a RAS HALB virtual server to appear in the list, the HALB server must have a public address specified, as far as you cannot add HALB server here.
   * **Secure Gateway**: Same as for HALB virtual server (described above), the **Public address** field must have a value for the Gateway to appear in the list. See the **Public address** field when you create or configure a RAS Secure Gateway.
   * **Custom**: A third-party load balancer will be used. Select this option, then click **Tasks** > **Add** and specify the server properties in the list below the field. The properties include **Name**, **Description**, **Public address**, **Port**, and **SSL port**. You can add as many servers as required and then select one of them to be used for a given published resource.

When configuring preferred routing, please also consider the following:

* If routing fails, an automatic fallback to the originating address is carried out.
* If routing is enabled in the RAS Console, but not configured, the administrator will see an error message and will have to either configure or disable it.
* It is recommended to use Folders (configured for administrative purpose) in case routing needs to be configured on many resources. Routes are not inherited from parent folder if the routing is enabled on the child object, i.e. only one set of routes is used.
* Same user credentials will be used when redirecting the RDP traffic to the same RAS Site. Users will not be asked to re-enter credentials.
* If you had existing session tunneled in a particular Secure Gateway and using session sharing, the same session workflow path will be used (if a published resource is also available on the same session host) irrespective of configured routing.
* Routing is supported in SAML environments.
* Supported clients are Windows, macOS, Linux, Android, iOS, Web.

## **Specifying public address when inviting users**

When you use the **Invite Users** wizard, you can specify a public address on the second page where you specify target platforms and connection options. This way, you can set a preferred routing for a group of users in a specific geo location. For more information, see [**Invite users**](https://docs.parallels.com/landing/ras-admin-guide/v19-en-us/parallels-ras-19-administrators-guide/getting-started-with-parallels-ras/set-up-a-basic-parallels-ras-farm/invite-users).

## **Deleting or disabling Gateway or HALBs**

If an administrator tries to delete a Gateway or HALB when they are being used as preferred routing, the information about objects using it will be shown on the screen, so no accidental deletion takes place.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parallels.com/landing/ras-admin-guide/v19-en-us/parallels-ras-19-administrators-guide/publishing/configuring-preferred-routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
