Skip to content

Make a subnet highly available

This guide keeps a network reachable when the gateway asset in front of it fails. You publish the same Subnet through two gateway assets and grant both in one policy. Each client then uses one of the two; when one gateway goes offline, the clients that used it move to the other.

In short

Put a second gateway asset in the network, create the same Subnet (same Network / Mask) on it, and add both Subnets as destinations to the same policy. Clients spread over both gateways. If one goes offline, its clients switch to the other within about a minute. Connections that went through the failed gateway are interrupted; new ones work.

Before you start

  • Two gateway assets, each a Linux or Windows asset with the agent in Asset mode and Online, that can both reach the network. Put them on separate hosts, ideally on separate power and network paths, or one failure takes both. See Gateway Assets. Windows is a public beta; for high-traffic networks use Linux.
  • A Subnet that works with one gateway asset, as in Reach an office network, and the policy that grants it.
  • Administrator rights in the Admin Console.
  • Background: Failover and Gateway Assets.

Which objects can be made highly available:

Object How Described here
Subnet The same network on two gateway assets Yes, the rest of this page
Exit Node The same Exit Node on two gateway assets, same mechanism Exit Nodes
Virtual Asset Two Virtual Assets with the same DNS name, one per gateway asset Single devices

1. Add the second gateway asset

Install the agent in Asset mode on a second host in the network and wait until it reads Online in the Assets list. The steps are those of Reach a server.

The second gateway asset must reach the same addresses as the first one, for example the same LAN or a routed path to it.

2. Create the same Subnet on the second gateway asset

The simplest way is to clone the existing Subnet:

  1. In Assets, open the Subnet and choose the Clone icon in its detail panel. The create form opens with the services, policy assignments and settings of the Subnet.
  2. Enter a new Name, for example office-lan-b.
  3. Under Gateway Asset, choose the second gateway asset. Keep Network / Mask exactly as it is, for example 10.10.1.0/24.
  4. Check the Hosts, Exceptions and Advanced tabs: they must match the first Subnet. Choose Apply.

Without a clone, use Assets → Create → Subnet and enter the same values by hand, see Reach an office network.

Keep the two Subnets identical over time. A client decides per network, not per gateway, which gateway asset it uses (see How clients choose). If you add a Host or an exception to one Subnet only, clients that use the other gateway do not get it.

Note

Leave No NAT off on both Subnets. With No NAT on, the router of the network must send the traffic for the tunnel network back through the gateway asset the client uses, and that is a different one for different clients. See No NAT.

3. Grant both Subnets in the same policy

The two Subnets are two destinations from the policy's point of view. A client only gets a path through a gateway asset whose Subnet a policy grants to it.

  1. Open Policies, select the policy that grants the first Subnet and choose Edit.
  2. On the Access tab, under Destinations, tick the second Subnet with the same services as the first.
  3. Choose Apply.

Do this for every policy that grants the first Subnet. If you cloned the Subnet in step 2, its Policy Assignments were copied with it; check them on the Access tab. The policy form is described in Create and edit.

A second gateway asset needs no other change to policies or conditions.

How clients choose

This is what the agent does with a network that two gateway assets offer:

  • One gateway per network, per client. A client sends the traffic for the network through one of the two gateway assets, never through both at once.
  • The choice is stable. It depends only on the client's tunnel IP, the network and the gateway assets that are online. The same client gets the same gateway after a restart and when its configuration is refreshed.
  • Clients are spread over both. Both gateway assets carry traffic all the time, so a second gateway that has quietly broken shows up before you depend on it. There is no standby that stays idle.
  • A failure moves only the clients that used the failed gateway. The others stay where they are.

The switch follows the status of the gateway asset: when the server sees no heartbeat from it any longer, it takes the gateway out of the configuration of its clients. A gateway asset that is Online but cannot reach the network behind it is not detected; clients keep using it.

How fast this happens, with the default settings of the server: the server marks an asset offline after 30 seconds without a heartbeat and checks every 12 seconds. The clients receive the changed configuration with their next heartbeat, at most 6 seconds later. Plan for 30 to 50 seconds between the failure and the first working new connection.

What clients notice: connections that went through the failed gateway asset are interrupted, because the gateway asset that carried them is gone. After the switch, new connections work and need no action from the user. When the gateway asset comes back, the clients whose choice it was go back to it, and the connections through the other gateway asset that these clients have open are interrupted once more. Plan maintenance for a quiet time.

The console does not show which of the two gateway assets a client uses at the moment. You see it in Access Insights, in the column via Gateway, for gateway assets with Access Tracking on (Linux and Windows).

Exit Nodes

An Exit Node is the network 0.0.0.0/0, so two Exit Nodes on two gateway assets behave like two Subnets with the same network: each client uses one, and a failed gateway asset moves its clients to the other. Create the second Exit Node as in Send internet traffic through a site and add it to the same policy. The Clone icon is not offered for an Exit Node, so enter the settings by hand.

The public address of a client's internet traffic is that of the gateway asset it uses, so it can change when the client switches.

Single devices (Virtual Assets)

A single device that cannot run the agent can have a second path too: create a Virtual Asset for it on each gateway asset, give both the same DNS name, and grant both in the same policy. Each Virtual Asset has its own tunnel IP, so this is a second address for the same name, not the same network twice. How this works, what it protects against and what it needs is described in Failover. The creation steps are those of Reach a printer, NAS or camera.

Verify

Test with at least two clients: with two gateway assets, about half of your clients use each, and you want to take down the one that your test client uses.

  1. Connect a client with the app and reach a device in the network, for example ssh user@10.10.1.20. See Home.
  2. Open Insights → Access Insights and filter for the client. The column via Gateway names the gateway asset this client used. If the client does not show up, wait a few minutes: the gateway assets report every few minutes.
  3. Take that gateway asset offline: on Linux stop the agent with sudo systemctl stop xtna-service, or shut the host down. On Windows, stop the agent service or shut the host down.
  4. In Assets, watch the status of the gateway asset. Its Online symbol turns into an outlined square with a dash after about 30 seconds. See Assets.
  5. Reach the device again from the client. The old session is interrupted; a new connection works after the switch, about 30 to 50 seconds after step 3.
  6. Open Access Insights again. New rows for the client now show the other gateway asset under via Gateway.
  7. Start the agent again. The gateway asset reads Online again, and its clients move back to it.

What to monitor

  • Gateway status. Assets shows each gateway asset as Online or Offline, with the time since when. The dashboard counts them as Offline Assets, see Dashboard.
  • Events. A gateway asset going offline and coming back raises client_status.asset_offline and client_status.asset_online. Look for them in Insights → Events (Event Class Asset / Client status) or send them to your SIEM with Event Forwarding. See Event reference. There is no separate event for the switch itself: it is the client's decision, not a server action.
  • Alert on the offline event for gateway assets. With a redundant pair nobody notices the first failure, and the second one takes the network down. Treat asset_offline of a gateway asset as something to repair, not to note.
  • Capacity. After a failure one gateway asset carries all clients. Size each one for the whole load, see Sizing the gateway asset.

If it doesn't work

  • Clients stay on one gateway asset only. Check the policy: both Subnets must be destinations, with the services, for the client's user group. A policy that grants only one Subnet gives the client only one path. The Access Diagnostic checks it per destination.
  • After the failure nothing works for more than a minute. The gateway asset may still read Online if it is up but cannot reach the network. The switch follows the status of the gateway asset, not the reachability of the network behind it. Check the host's own connection to the LAN.
  • Both gateway assets read Online but the client cannot reach the network. The two Subnets do not match, for example a different Network / Mask or a missing Exceptions entry, or one gateway asset cannot reach the addresses. Compare both Subnets and test from each gateway asset itself.
  • A client in the office network does not use any gateway. A client with an address in the network's range uses its local interface. See Check the overlap.
  • The agent on the gateway asset does not come back. See Repair the installation.

Next

See also