Ports and NAT¶
All IsardVDI reverse proxies (isard-portal, isard-video and isard-monitor-proxy) use the same HAProxy image. Each of them listens on exactly two ports and routes traffic by port and protocol. These two ports are enough to understand every port variable in isardvdi.cfg.
The two ports¶
| Port | Traffic | Destination | Present in |
|---|---|---|---|
HTTP_PORT |
Plain HTTP | ACME http-01 challenge and redirect to HTTPS |
Always |
HTTP_PORT |
Plain HTTP | Web bastion (HTTP) | Web |
HTTP_PORT |
HTTP CONNECT |
SPICE proxy (squid) | Video |
HTTP_PORT |
TLS | RDP gateway | Web |
HTTPS_PORT |
TLS | Web interface, /api/v4, /authentication, /socket.io, /isard-admin, /engine, /scheduler, /openapi, Guacamole |
Web |
HTTPS_PORT |
TLS with the name (SNI) of a bastion domain | Web bastion (HTTPS) | Web |
HTTPS_PORT |
TLS + Upgrade: websocket |
HTML5 viewers (noVNC, spice-web-client) | Video |
HTTPS_PORT |
TLS | /monitor (Grafana) |
Monitor |
HTTPS_PORT |
Data starting with SSH-2.0 |
SSH bastion, when BASTION_SSH_PORT equals HTTPS_PORT |
Web |
All other traffic is silently dropped.
Two consequences often surprise administrators:
- The RDP gateway has no port of its own. It is TLS traffic on
HTTP_PORT. There is no longer a dedicated9999port. - The SPICE proxy shares the same
HTTP_PORT, as anHTTP CONNECTtunnel. On an all-in-one, where a single HAProxy serves both the web and the video parts, the external SPICE port and the external RDP gateway port are the same.
Other containers publish their own ports:
isard-vpnpublishes UDP ports:WG_USERS_PORT(default443/UDP) for end users andWG_HYPERS_PORT(default4443/UDP) for remote hypervisors. The latter is not needed on an all-in-one.isard-bastionpublishesBASTION_SSH_PORTdirectly (TCP) whenBASTION_ENABLED=trueandBASTION_SSH_PORTis different fromHTTPS_PORT. If they are equal, SSH comes in through HAProxy as shown in the table above.
Which container publishes the ports¶
Only one HAProxy per host publishes ports. Which one depends on the flavour:
| Flavour | Publishing container | Published ports |
|---|---|---|
all-in-one, web, web+storage, web+storage+video, web+monitor, … |
isard-portal |
HTTP_PORT, HTTPS_PORT |
hypervisor, video-standalone |
isard-video |
VIEWER_SPICE, VIEWER_BROWSER |
monitor |
isard-monitor-proxy |
HTTP_PORT, HTTPS_PORT |
hypervisor-standalone, storage, backupninja, check |
None | None |
Compound web+… flavours do not include the video or monitor-proxy containers: their isard-portal serves those parts directly on HTTP_PORT and HTTPS_PORT.
Listening port and announced port¶
This is the distinction the variable names do not make.
A port can be listening (HAProxy listens on it, and it is published on the host) or announced (stored in the database when the hypervisor registers and, from there, written into every viewer file and URL the client receives). They are not always the same number: a router in between can translate one into the other.
| Component | Listening and published port | Port announced to the client |
|---|---|---|
| portal, HTTP | HTTP_PORT |
VIEWER_RDP_GW; if not set, HTTP_PORT |
| portal, HTTPS | HTTPS_PORT |
HTTPS_PORT (appended to the hypervisor's viewer.static) |
| video, HTTP | VIEWER_SPICE |
VIEWER_SPICE (stored as viewer.spice_ext_port) |
| video, HTTPS | VIEWER_BROWSER |
VIEWER_BROWSER (stored as viewer.html5_ext_port) |
VIEWER_SPICE and VIEWER_BROWSER are not independent concepts: they are the HTTP and HTTPS ports of the video proxy. In a video-only flavour (with no web part), the HAProxy entrypoint exports HTTP_PORT=$VIEWER_SPICE and HTTPS_PORT=$VIEWER_BROWSER.
Because the announced ports are stored per hypervisor, each hypervisor can publish its own ports. This way, several hypervisors can sit behind a single public IP, each NATed on a different external port.
The three announced ports are independent on purpose. Even when the RDP gateway and the SPICE proxy share the listening port, as on an all-in-one, announcing them separately lets the firewall handle each viewer protocol on its own, for example to apply QoS to SPICE traffic only. That is why VIEWER_RDP_GW never inherits VIEWER_SPICE: if it is not set, it takes the port the gateway actually listens on, HTTP_PORT.
What each variable does, by flavour¶
| Variable | hypervisor, video-standalone |
all-in-one, web, monitor |
hypervisor-standalone |
|---|---|---|---|
HTTP_PORT |
Replaced by VIEWER_SPICE |
Listens and publishes | Not used |
HTTPS_PORT |
Replaced by VIEWER_BROWSER |
Listens and publishes | Not used |
VIEWER_SPICE |
Listens, publishes and announces | Announces only | Announces only |
VIEWER_BROWSER |
Listens, publishes and announces | Announces only | Announces only |
VIEWER_RDP_GW |
Not read | Announces only | Not read |
The trap is in the middle column. On an all-in-one, setting VIEWER_SPICE=4104 opens nothing: HAProxy keeps listening on HTTP_PORT and the client is only told to connect to port 4104. If no NAT forwards 4104 to HTTP_PORT, the viewer fails, and it fails silently, because the desktop starts fine.
Conversely, if VIEWER_SPICE is not set on an all-in-one that listens on an HTTP_PORT other than 80, the client is told to connect to port 80.
How to do NAT properly¶
Keep the NAT outside IsardVDI:
- Leave
HTTP_PORTandHTTPS_PORTat their default values (80and443), so that IsardVDI listens where everyone expects it to. - Configure the router to forward the external ports to
80and443on the host. - Declare the external ports so that the client receives the right ports:
VIEWER_SPICE: external port forwarded to80.VIEWER_BROWSER: external port forwarded to443.VIEWER_RDP_GW: only if the RDP gateway is reached on a port other than theVIEWER_SPICEone.
Example: an all-in-one that listens on 80/443 but is reached from outside on ports 4104 and 4105 (the router does DNAT 4104 → 80 and 4105 → 80) sets VIEWER_SPICE=4104 and VIEWER_RDP_GW=4105.
Only change HTTP_PORT and HTTPS_PORT when the host really cannot serve IsardVDI on 80 and 443, for example when two IsardVDI installations share the same machine.
Listening outside port 80 breaks certificate renewal
The ACME http-01 challenge is answered by HAProxy on HTTP_PORT, and Let's Encrypt always validates on port 80. If HTTP_PORT (or, in a video-only flavour, VIEWER_SPICE) has a value other than 80, automatic renewal stops working unless the router forwards external 80 to that port. The NAT described above, or moving that host to a DNS-01 challenge, is preferable. See Certificates.
Removed and renamed¶
- Port
9999no longer exists. The RDP gateway used to be published on its own9999/TCPport; it is now served as TLS on the web HAProxy'sHTTP_PORT. Nothing listens on9999anymore, and forwarding it has no effect. VIEWER_RDPGWno longer exists: it was renamedVIEWER_RDP_GW. The old name is not read and is silently ignored. Ifisardvdi.cfgstill has it, delete the line: its value is almost certainly a leftover9999.VIEWER_HTML5has never existed. The HTML5 viewer port isVIEWER_BROWSER.