Skip to content

Re-address Networks: devices find the Console at its new address - #1370

Merged
tvancott42 merged 13 commits into
release/2.11from
feature/readdress-inform
Nov 9, 2026
Merged

tvancott42 merged 13 commits into
release/2.11from
feature/readdress-inform

Conversation

@tvancott42

@tvancott42 tvancott42 commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Change Control - Re-address Networks

After a re-address, devices find the UniFi Console at its new address without a manual set-inform.

  • Dry run and Review Plan say how each device finds the Console. A per-device verdict replaces the old "Point the Inform Host at ... first" warning (and its copy in the plan notes):

    Verdict When Shown
    Not affected Inform host outside every moved subnet Nothing
    Follows automatically Gateway-hosted Console or CloudKey (a UniFi OS console that is not UniFi OS Server), or the inform host is the gateway's own LAN address Nothing
    Follows by DNS A name the gateway's Local DNS serves and the plan moves, and the device asks the gateway (static DNS at a gateway address, or DHCP handing out the gateway, with no DNS DNAT) Nothing
    Plan re-points the Console UniFi OS Server (or a Console with no UniFi OS answer) in a moved subnet One warning when the plan adds the override write
    SSH fallback Anything else, such as a name a Pi-hole serves "re-pointed over SSH if it does not reconnect", or the hand command when Device SSH is off
  • Inform Host override write. With the override off, the plan turns it on at the Console's new IP (never a name). On with an IP: the existing rewrite moves it, with no extra write. On with a name: left alone. Either write now goes just before the console-path networks (99): the new address does not answer until the Console's host moves, so it waits until every device and network write that still needs the old one has gone. Before this, the rewrite of an override already on was the plan's first write (setting order 1). Roll Back takes the same order. A Console at a gateway LAN address never gets an override write.

  • set-inform over SSH for devices still offline. When the re-address watch raises "Network devices offline after", each offline device whose inform host moved gets set-inform through DeviceSshRouter. It is tried at the new static address, then the old one, once per device per plan, 10 s per try, four at a time. At the new address a name the gateway serves stays a name. At the old address, and for any other name, the URL carries the Console's new IP. A DHCP device with no new static is dialed at its last address with the Console's IP; one with no known address is listed. The gateway goes through Gateway SSH. With Device SSH off nothing is dialed. Each attempt is audited as Network Optimizer (change_control.device.inform_set).

  • A follow-up alert reports the pass. "Network devices offline after" goes out at once, as before; "Re-point over SSH after: " follows when the pass finishes. It gives the exact command for every device it did not re-point, including one reached at its old address that cannot connect: SSH to it from a host already on the new subnets and run set-inform <url>. When the Console's new IP is on the device's own network, the command starts with ip route add <console>/32 dev <if>.

  • The SSH command calls mca-cli-op set-inform. set-inform is only an /etc/profile alias (read on an AP and a UXG), which a non-interactive SSH command never loads, so the pass sends the same guarded form Firmware Rollout uses for upgrade. Hand commands keep plain set-inform. Checked on a live AP with the exact command: exit 0, the AP informed to the IP, and the Console handed back its Inform Host override (a name) within a second.

  • A Console on the Gateway is named as such. Review Plan's When to Apply line, its last Lockout item, and the offline alert say Network Devices drop until the Gateway provisions its new addresses, instead of "until the console moves too", which fits only UniFi OS Server. The flag is recorded when the Plan is built.

  • "Network Optimizer's host moves" also offers keeping both addresses until every Device is back, so Network Optimizer can reach Devices at their new and old addresses.

  • Copy capitalizes the app's terms (Network Devices, UniFi Console, Gateway, Network, Plan) in the re-address watch, Lockout, and alert sentences.

  • The Default network reads VLAN 1. Re-address Networks showed "Untagged" for it, and Migrate's name-match note said "untagged in the source". Untagged is a per-port setting; the network with no VLAN ID is VLAN 1. The Pattern tooltip drops its "(1 when untagged)" aside.

What does not change

  • Write order: honeypots off first and back last, devices leaves-first, gateway 45, static-home networks 50, console-path networks 100, reservations 101, honeypots 102. Only the Inform Host override write moves, to 99.
  • Built-in RADIUS profile skip, NAT rule_index, CarryReservations, ContinueOnError on reservations, no-reply as the only expected path failure, alert-instead-of-revert, Roll Back write order.
  • Every other plan kind: the classifier and the SSH pass run for re-address plans only.
  • The SSH pass runs off the watch tick. Watch timing, miss counts, alert severity, and plan status are unchanged. It never writes to the Console.

The 10-27 cutover, replayed against this branch

Step on 10-27 Then Now
Apply 1: honeypot refused Stopped at write 1 Unchanged: honeypots off before any network (08c761639)
Apply 2: built-in RADIUS profile refused Stopped at write 2 Unchanged: skipped (af0d8991b)
Apply 3: second NAT update refused Stopped part way Unchanged: rule_index carried (363aa005b)
Apply 4: networks refused, honeypot out of range 21/24 landed Unchanged: honeypots already off
Apply 4: every device offline, plan Watching Alert only Same alert. It now also runs set-inform on each offline device whose inform host moved, and lists the rest with their commands
Reservations dropped by the Console Moved by hand Unchanged: carried after the networks
Gateway half-provisioned, could not resolve the inform name SSH from a moved host, host route, set-inform to the IP Verdict: follows by DNS (it serves the name itself). Offline at the alert: one set-inform through Gateway SSH, name kept. That would not have fixed a gateway whose DNS forwarder pointed at the old resolver, so the alert's hand command is still the way in there
Switch at its old static, could not resolve the name Host route + set-inform to the IP by hand Dialed at the new static (fails, it never moved), then at the old static with the Console's IP. With no route that set-inform cannot connect, so the alert gives ip route add <console>/32 dev <if>; set-inform http://<console-ip>:8080/inform
AP isolated (wireless uplink lost), and a switch behind it Still out at the end Both dialed at new then old; neither is reachable. Both are listed with their commands. Network Optimizer cannot reach an isolated device
New: Inform Host override Not handled That site's override is on with a name, so no write and the name is kept. With it off, the plan writes the new IP at order 99
New: classifier on that site (UniFi OS Server, inform by name) "Point the Inform Host" warning Devices that ask the gateway: follows by DNS. Devices on networks behind a DNS DNAT or handing out the Pi-hole: SSH fallback. None: not affected

Outside Network Optimizer and still the runbook's job: the gateway's DNS forwarder boot script, the resolver's listen address, host interfaces and firewall, UniFi OS Server bindings.

Tests

FullyQualifiedName~ChangeControl: 1017 on release/2.11 before, 1055 after, all passing. No existing test edited. New tests are in ReaddressInformTests (one per verdict, the Pi-hole name, override already on with an IP, override order and its Roll Back, URL mapping, the host route) and PlanCoordinatorTests (new then old, once per plan, only moved devices, DHCP skipped, no Device SSH, no Gateway SSH, a non-re-address plan never dials, the hand command and host route).

Feature index: one line under Re-address Networks.

The dry run's "Point the Inform Host at ... first" warning is replaced by a
per-device verdict (ReaddressInform.Classify, no API calls): not affected,
follows automatically (gateway-hosted console, or the gateway's own LAN
address), follows by DNS (a name the gateway's Local DNS serves and the plan
moves, asked through the gateway), the plan re-points the console, or SSH
fallback. Console type is Firmware Rollout's IsStandaloneConsole.

- A UniFi OS Server in a moved subnet with the Inform Host override off gets
  the override written to its new IP, ordered just before the console-path
  networks (99). On with an IP, the existing rewrite moves it; on with a name,
  the name is kept. Roll Back takes the same order.
- When the re-address watch raises "Network devices offline after", each
  offline device gets set-inform over SSH (DeviceSshRouter), at its new static
  address and then its old one, once per device per plan, 10 s each. A name the
  gateway does not serve becomes its resolved address, mapped (10-27: the
  stranded switch could not resolve the name). DHCP devices with no known
  address and sites without Device SSH are listed with the command instead.
  Each attempt is audited as Network Optimizer. The pass runs off the tick,
  so the watch's timing, misses, severity, and plan status are unchanged, and
  it never writes to the console. Only re-address plans run it.
…ole is on the device's network

A device left on its old address has no route to the console's new one, but
on the same network a /32 route on its own interface reaches it. The alert's
hand command for such a device leads with ip route add <console>/32 dev <if>,
and the alert now says where to run it: SSH to the device at the address
shown, from a host already on the new subnets (the rewritten policies refuse
old-subnet sources). Network Optimizer itself still runs set-inform only.
- The SSH fallback skips a device whose inform host did not move, and a name
  is replaced by an IP only when it resolves into a moved subnet: set-inform
  would otherwise overwrite a working URL.
- A Console with no UniFi OS answer (a self-hosted Network Application, or
  unreadable) counts as needing re-pointing, not as following by itself.
- The dry run says when Device SSH is not configured instead of promising an
  SSH re-point.
- The gateway is checked against Gateway SSH, which carries its set-inform.
- At most four SSH sessions at once.
- The on-link check maps only the old address (a swap mapped the new one twice).
- A static device whose DNS is any gateway address follows by DNS.
- A DHCP device's hand line names its last address.
- A device reached at its old address on the Console's network still gets the
  hand command with the host route: set-inform runs there but cannot connect.
- The per-plan attempt record is dropped when the watch ends.
…ole's IP

A device that never got its new config keeps its old DNS server, the old
gateway address, which is gone after the move, so it cannot resolve any name.
set-inform dialed at the new static keeps a name the gateway serves; dialed at
the old static it sends the Console's new IP, taken from the moved Local DNS
record. The hand command with the host route uses the IP too.
… console path; no override at a gateway address

- An Inform Host override already on with an IP was rewritten as the plan's
  first write (setting order 1). Its new address is dead until the console's
  host moves, so devices lost the console before their own writes landed. It
  now takes the same slot as the new override write (99), and so does its
  Roll Back.
- A console whose inform address is a gateway LAN address never gets an
  override write, even when its type did not read.
Untagged is a per-port setting; the network with no VLAN ID is UniFi's
Default network, VLAN 1, which is also what the pattern's {vlan} uses.
…ip and the Migrate name-match note

Untagged is a per-port setting, not a network's. The Pattern tooltip drops
its "(1 when untagged)" aside; the note for a network matched by name onto
another VLAN says VLAN 1 for the Default network.
…d the copy says so

A Plan now records when the UniFi Console runs on the Gateway (or a
CloudKey). Review Plan's When to Apply line, its last Lockout item, and the
"Network devices offline after" alert then say Network Devices drop until the
Gateway provisions its new addresses, instead of "until the console moves too",
which only fits a UniFi OS Server. Plans built before this keep the old text.

The strings this branch added capitalize the app's terms (Plan, Device,
Network, Gateway, Console, Alert), FEATURES.md included.
- The "Network devices offline after" alert goes out at once, as on
  release/2.11. The set-inform outcome follows as its own alert
  ("Re-point over SSH after: <plan>") when the pass finishes.
- The background pass logs a failure to publish that outcome.
- A DHCP Device with no new static is dialed at its last address with the
  Console's IP; only one with no known address at all is listed instead.
- The Gateway-address checks read LAN networks only: a VPN server or WAN
  network's address no longer counts as the Gateway's.
- The per-Plan attempt record is dropped when the Plan is reverted or
  cancelled, not only when its watch ends.
…sses

"Network Optimizer's host moves" now also says it can keep both addresses
until every Device is back: Network Optimizer then reaches Devices at their
new and old addresses, so the SSH re-point can connect.
…ctly

set-inform is only an /etc/profile alias for mca-cli-op set-inform (read on
an AP and a UXG), and a non-interactive SSH command never loads it, so every
attempt would have failed with "not found". The SSH pass now sends the same
guarded form Firmware Rollout uses for upgrade. The hand commands in the
alert keep plain set-inform, which a person types in an interactive shell.

Checked on a main-site AP with the exact command: exit 0, "Adoption request
sent", the AP informed to the IP, and the Console answered with its Inform
Host override (a name), which the AP saved within a second.
…s terms

The older UniFi OS Server and management-move sentences in Review Plan's
When to Apply line, its Lockout items, and the "Network devices offline
after" alert now read Network Devices, UniFi Console, Gateway, Network, Plan,
and Re-address, like the strings this branch added. The management-network
Lockout detail capitalizes Devices.
…he Gateway

The Plan's on-the-Gateway flag now also holds when the Console's address is
a Gateway LAN address, the same test that already blocks the override write,
so a Gateway-hosted Console whose type did not read gets the Gateway wording.
Review Plan's commit-confirmed line says "every Network Device" and "the Plan".
@tvancott42
tvancott42 merged commit d56c0eb into release/2.11 Nov 9, 2026
6 checks passed
@tvancott42
tvancott42 deleted the feature/readdress-inform branch November 9, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant