Skip to content

Commit 17cbac3

Browse files
committed
fix(ha): update for beta2
1 parent 2c49b12 commit 17cbac3

File tree

1 file changed

+77
-75
lines changed

1 file changed

+77
-75
lines changed

high_availability.rst

Lines changed: 77 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ Some key concepts to understand before setting up HA:
2626
- **Virtual IP (VIP)**: A shared IP address used by both nodes for each configured interface to ensure uninterrupted client access to services.
2727
Clients on the network should *always* use the VIP address (e.g., as their gateway, DNS server, or VPN endpoint) to ensure seamless failover.
2828

29-
Configuration changes must **always** be made on the **primary node**. The backup node should be considered read-only.
30-
Most configurations, such as firewall rules, VPN settings, or Threat Shield rules, are automatically synchronized from the primary to the backup node.
29+
Configuration changes must **always** be made on the **primary node**.
30+
The backup node should be considered read-only. The only exception is the network configuration of
31+
LAN interfaces that are part of the HA cluster.
32+
33+
All other relevant configurations, such as firewall rules, VPN settings, or Threat Shield rules, are automatically synchronized from the primary to the backup node.
3134

3235
This is how the HA system works:
3336

@@ -46,14 +49,11 @@ This is how the HA system works:
4649
it deactivates most services and connections.
4750

4851
While the HA system is designed to be as automatic as possible, some configurations require manual intervention.
49-
For example, if you add a new network interface or change an existing one, you need to inform the HA system about these changes.
50-
Specific actions are needed to ensure the backup node is aware of the new network configuration:
52+
For example, if you add a new LAN network interface or change an existing one, you need to inform the HA system about these changes.
5153

52-
- Beside the first LAN and WAN configured in the initial setup, all other interfaces must be explicitly added to the HA cluster.
53-
This is done using the ``ns-ha-config add-lan-interface`` or ``ns-ha-config add-wan-interface`` command.
54-
This command registers the new interface in the HA cluster configuration and associates a Virtual IP (VIP) with it for failover.
55-
- Similarly, when adding an IP alias to an interface on the primary node, you must also register this alias within the HA cluster configuration
56-
using ``ns-ha-config add-alias``.
54+
Beside the first LAN configured in the initial setup, all other LAN interfaces must be explicitly added to the HA cluster.
55+
This is done using the ``ns-ha-config add-lan-interface`` or ``ns-ha-config add-wan-interface`` command.
56+
This command registers the new interface in the HA cluster configuration and associates a Virtual IP (VIP) with it for failover.
5757

5858
Supported features and limitations
5959
===================================
@@ -80,13 +80,22 @@ The HA cluster supports synchronization for a wide range of features, including:
8080
- Active connections tracking (conntrackd)
8181
- Hotspot (dedalo)
8282

83+
The HA cluster supports the following WAN interface types and setups:
84+
85+
- Static IPv4 and static IPv6 addresses
86+
- IPv4 via DHCP
87+
- Physical Ethernet interfaces
88+
- Bonded interfaces (link aggregation) composed of physical interfaces
89+
- Bridge interfaces over physical interfaces
90+
- VLANs on physical interfaces, bond interfaces, or bridge interfaces
91+
- PPPoE on physical interfaces or on VLAN interfaces
92+
8393
Be aware of the following current limitations:
8494

85-
- IPv4 only (IPv6 is not supported).
86-
- VLANs are supported only on physical interfaces.
95+
- Only IPv4 is supported on LAN interfaces
8796
- Extra packages such as NUT are not supported.
8897
- Syslog daemon (rsyslog) configuration is not synced: if you need to send logs to a remote server, you must use the controller.
89-
- PPPoE or DHCP WAN is not supported (see Static IP requirement)
98+
9099

91100
Also note that after the first synchronization, the backup node will have the same hostname as the primary node.
92101
The web user interface will show the hostname of the primary node, but the dashboard will indicate the node's role (primary or backup).
@@ -100,7 +109,8 @@ Before setting up HA, ensure the following requirements are met:
100109

101110
- Two firewalls with identical network devices. Each device must have the exact same name and numbering (e.g., eth0, eth1, eth2, eth3)
102111
- Both nodes must be connected to the same LAN; connect the LAN interfaces to the same broadcast domain (usually the same switch).
103-
- Static IP addresses for all interfaces that will host a virtual IP.
112+
- Static IP addresses for all LAN interfaces that will host a virtual IP.
113+
- Primary LAN interface must be named ``lan`` in both firewalls
104114

105115
Setup and configuration
106116
========================
@@ -127,28 +137,28 @@ The setup process is as follows:
127137
otherwise the node may enter a fault state and the HA cluster will not work properly.
128138
See `Cluster initialization`_ section below for detailed instructions.
129139

130-
5. **Add WAN interface** to cluster configuration to ensure proper failover for internet connectivity.
131-
This step is crucial for maintaining internet access during failover scenarios.
132-
See `WAN Interfaces`_ section below for detailed instructions.
140+
5. **Configure WAN interface in primary node** using the ``Interfaces and devices`` page in the web interface.
141+
WAN interfaces will be automatically configured inside the cluster and synchronized to the backup node.
142+
See `WAN Interfaces`_ section below for more info.
133143

134144
6. **Verify the configuration** to ensure everything is set up correctly.
135145
Use the `ns-ha-config` commands to check the status and configuration of the HA cluster.
136146
See `Verify the configuration`_ section below for detailed instructions.
137147

138-
7. **Configure additional interfaces** for the cluster as needed (optional).
139-
This step is optional and depends on your network setup. You can add any additional interfaces that require HA support.
148+
7. **Configure additional LAN interfaces (optional)** for the cluster.
149+
This step is optional and depends on your network setup. You can add any additional LAN interface that require HA support.
140150
See `Additional interfaces`_ section below for detailed instructions.
141151
If you need to configure an hotspot, see `Hotspot support`_ section below for specific requirements.
142152

143-
8. **Add IP aliases** to the primary node on relevant interfaces (optional).
153+
8. **Add extra Virtual IPs (optional)** to the primary node on relevant LAN interfaces.
144154
This step is optional and allows you to add additional IP addresses to the primary node for services that require multiple IPs.
145-
See `Network aliases`_ section below for detailed instructions.
155+
See `Extra Virtual IPs`_ section below for detailed instructions.
146156

147157
The detailed steps for each of these points are covered in the sections below.
148158

149159
Sometimes, you may need to remove interfaces or aliases from the HA configuration.
150160
This can be done using the `ns-ha-config` commands.
151-
See `Remove interfaces and aliases`_ section below for detailed instructions.
161+
See `Remove interfaces and virtual IPs`_ section below for detailed instructions.
152162

153163
Network cabling
154164
---------------
@@ -213,32 +223,23 @@ Check requirements
213223

214224
For the primary node::
215225

216-
ns-ha-config check-primary-node [lan_interface] [wan_interface]
226+
ns-ha-config check-primary-node
217227

218228
This checks:
219229

220-
- LAN interface has a static IP. If the ``lan_interface`` parameter is not provided, it searches for a LAN interface named ``lan``.
221-
- At least one WAN interface exists. If the ``wan_interface`` parameter is not provided, it searches for a WAN interface named ``wan``.
222-
The WAN interface must be configured with a static IP address; PPPoE and DHCP are not supported.
230+
- LAN interface has a static IP. It searches for a LAN interface named ``lan``.
223231
- If DHCP server is running:
224232

225-
- ``Force DHCP server start`` option is enabled.
226233
- ``3: router`` DHCP option is set (should be the virtual IP).
227234
- ``6: DNS server`` DHCP option is set.
228235

229236
For the backup node::
230237

231-
ns-ha-config check-backup-node <backup_node_ip> [lan_interface]
232-
238+
ns-ha-config check-backup-node <backup_node_ip>
233239
This checks:
234240

235241
- Backup node is reachable via SSH on port 22 with root user.
236-
- LAN interface has a static IP. If the ``lan_interface`` parameter is not provided, it searches for a LAN interface named ``lan``.
237-
- At least one WAN interface exists.
238-
239-
WAN interface can be omitted on the backup node, but bear in mind that in case of failover, the UI of the backup node
240-
will show an unknown interface.
241-
It's recommended to configure the WAN interface on the backup node as well, even if it does not have a static IP address.
242+
- LAN interface has a static IP. It searches for a LAN interface named ``lan``.
242243

243244
The script will request the root password for the backup node. You can also pipe the password: ::
244245

@@ -251,12 +252,11 @@ Initialize nodes
251252

252253
Initialize the primary node::
253254

254-
ns-ha-config init-primary-node <primary_node_ip> <backup_node_ip> <virtual_ip> [lan_interface] [wan_interface]
255+
ns-ha-config init-primary-node <primary_node_ip> <backup_node_ip> <virtual_ip>
255256

256257
Where the ``primary_node_ip`` is the static IP of the primary node already set for the LAN interface,
257258
and ``backup_node_ip`` is the static LAN IP of the backup node
258259
The ``virtual_ip`` is the virtual IP address for the LAN interface where all LAN hosts should point to.
259-
The ``lan_interface`` parameter is optional and specifies the LAN interface name (default is `lan`).
260260

261261
This script will:
262262

@@ -265,7 +265,7 @@ This script will:
265265
- Generate a random password and public key for synchronization.
266266
- Configure `dropbear` (SSH server) to listen on port `65022` and allow only key-based authentication for sync.
267267

268-
Initialize the backup node (always execute the command on the primary node)::
268+
Initialize the backup node, always execute the command on the primary node::
269269

270270
ns-ha-config init-backup-node
271271

@@ -278,16 +278,17 @@ At this point, the nodes are configured to communicate over LAN, and the LAN vir
278278
WAN interfaces
279279
--------------
280280

281-
The WAN interface is the first interface to be added to the HA cluster.
282-
Remember that the WAN interface must be configured with a static IP address, so make sure also to setup :ref:`DNS forwarders <forwarding_servers-section>`.
281+
The system does not require any special configuration for the WAN interfaces.
282+
Just configure them inside the `Interfaces and devices` page and they will be automatically managed
283+
by the HA scripts.
283284

284-
Configure the WAN interface::
285+
WAN aliases can be added from the "Interfaces and devices" page and will be automatically synchronized to
286+
the secondary node.
285287

286-
ns-ha-config add-wan-interface <interface> <virtual_ip_address> <gateway>
287-
288-
Where ``<interface>`` is the name of the WAN interface (e.g., `wan`, `eth1`, etc.),
289-
Ensure you provide the virtual IP in CIDR notation (e.g., `192.168.1.100/24`) and the gateway IP.
290-
The script configures the interface on both nodes using fake IP addresses from the `169.254.x.0/24` range and sets up the virtual IP in `keepalived`.
288+
WAN interfaces are brought up on the primary node and kept down on the secondary node;
289+
the web interface on the secondary may not be consistent (it can display the IPs and show the interface as "up"),
290+
while at a low level the network interfaces are actually down.
291+
This is a known limitation and will be fixed in a future release.
291292

292293
Verify the configuration
293294
------------------------
@@ -304,13 +305,14 @@ Check the status of the HA cluster. The first sync may take up to 5 minutes. ::
304305

305306
Initial status might show `Last Sync Status: SSH Connection Failed`. After sync, it should show `Last Sync Status: Up to Date`.
306307

307-
Additional interfaces
308-
---------------------
308+
Additional LAN interfaces
309+
-------------------------
309310

310-
It's possible to add additional interfaces to the HA cluster after the initial setup.
311+
It's possible to add additional LAN interfaces to the HA cluster after the initial setup.
311312
Before adding an interface, ensure that the interface is configured with a static IP address on the primary node
312313
and on the secondary node, much like the LAN interface configured during the initial setup.
313-
Interfaces can be ethernets, bridges, VLANs, or bonds. Please note that VLANs over logical interfaces are not supported.
314+
Interfaces can be ethernets, bridges, VLANs, or bonds, but make sure the secondary node has the same interface with the same name
315+
and with the same device hierarchy (e.g., if the interface is a VLAN, the parent interface must also exist on the secondary node).
314316

315317
You can use this command to add any non-WAN interface, like a second LAN, DMZ or GUEST interface to the HA cluster.
316318

@@ -324,7 +326,6 @@ The following checks are performed:
324326
- make sure a device with given static IP address exists on the node
325327
- If DHCP server is running, the following
326328

327-
- ``Force DHCP server start`` option is enabled.
328329
- ``3: router`` DHCP option is set (should be the virtual IP).
329330
- ``6: DNS server`` DHCP option is set.
330331

@@ -348,28 +349,36 @@ The hotspot feature is supported in HA clusters, but there are important require
348349

349350
Note that active sessions are stored in RAM and will be lost during a switchover; clients must re-authenticate unless auto-login is enabled.
350351

351-
Network aliases
352-
----------------
352+
Virtual IPs
353+
-----------
354+
355+
A Virtual IP (VIP) is an additional IP address assigned to a network interface that
356+
will be migrated to the backup node in case of failover.
357+
You can add Virtual IPs to the primary node on relevant interfaces.
353358

354-
You can add IP aliases to the primary node on relevant interfaces.
355359
This is useful for services that require multiple IP addresses on the same interface, such as virtual servers or load balancing.
356-
First, on the primary node, access the web interface and add the alias to the network interface.
357360

358-
Then, use the `ns-ha-config` command to register the alias in the HA cluster configuration.
361+
Use the `ns-ha-config` command to register the virtual IP in the HA cluster configuration.
362+
363+
Virtual IPs must be explicitly set on the primary node. ::
364+
365+
ns-ha-config add-vip <interface> <vip_ip_cidr>
359366

360-
Aliases must be explicitly set on the primary node. ::
361367

362-
ns-ha-config add-alias <interface> <alias_ip_cidr>
368+
Example of a WAN virtual IP: ::
363369

370+
ns-ha-config add-vip lan2 192.168.122.66/24
364371

365-
Example of a WAN alias: ::
372+
**Note:** the virtual IP will appear as an extra IP address on the interface in the web interface.
366373

367-
ns-ha-config add-alias wan 192.168.122.66/24
374+
Aliases
375+
^^^^^^^
368376

369-
**Note:** the alias will not appear in the network configuration page of the backup node.
377+
You can add multiple IP addresses (aliases) to an interface on the primary node.
378+
But this aliases will not be added to the HA configuration.
370379

371-
Remove interfaces and aliases
372-
-----------------------------
380+
Remove interfaces and VIPs
381+
--------------------------
373382

374383
Remove an interface from HA configuration: ::
375384

@@ -383,16 +392,13 @@ This removes the interface from `keepalived` and from the backup node's network
383392
Also, the virtual IP address associated with the interface will be moved to the network interface of the primary node.
384393

385394

386-
Remove an alias from HA configuration: ::
395+
Remove a virtual IP from HA configuration: ::
387396

388-
ns-ha-config remove-alias <interface> <alias_ip_cidr>
397+
ns-ha-config remove-vip <interface> <vip_ip_cidr>
389398

390399
Example: ::
391400

392-
ns-ha-config remove-alias wan 192.168.122.66/24
393-
394-
This removes the alias from `keepalived` but not from the backup node's network configuration.
395-
Then, proceed to remove the alias using the primary node's web interface.
401+
ns-ha-config remove-vip lan2 192.168.122.66/24
396402

397403
Configuration example
398404
---------------------
@@ -402,28 +408,24 @@ Assuming:
402408
- Primary Node LAN IP: `192.168.100.238`
403409
- Backup Node LAN IP: `192.168.100.239`
404410
- LAN Virtual IP: `192.168.100.240/24`
405-
- WAN Interface: `wan` (e.g., `eth1`)
406-
- WAN Virtual IP: `192.168.122.49/24`
407-
- WAN Gateway: `192.168.122.1`
408411
- Backup Node Root Password: `backup_root_password`
409412

410413
Execute the following commands on the **primary node**:
411414

412-
1. Check requirements and initialize: ::
415+
1. Check requirements: ::
413416

414417
# Check requirements first
415418
ns-ha-config check-primary-node
416419
echo "backup_root_password" | ns-ha-config check-backup-node 192.168.100.239
417420

421+
2. Setup the cluster: ::
422+
418423
# Initialize primary
419424
ns-ha-config init-primary-node 192.168.100.238 192.168.100.239 192.168.100.240/24
420425

421426
# Initialize backup (run from primary node)
422427
echo "backup_root_password" | ns-ha-config init-backup-node
423428

424-
2. Add WAN interface: ::
425-
426-
ns-ha-config add-wan-interface wan 192.168.122.49/24 192.168.122.1
427429

428430
Alerting
429431
========

0 commit comments

Comments
 (0)