Repository navigation
Re-address Networks: devices find the Console at its new address - #1370
Merged
Merged
Conversation
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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
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-informthroughDeviceSshRouter. 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 withip route add <console>/32 dev <if>.The SSH command calls
mca-cli-op set-inform.set-informis only an/etc/profilealias (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 forupgrade. Hand commands keep plainset-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
rule_index, CarryReservations, ContinueOnError on reservations, no-reply as the only expected path failure, alert-instead-of-revert, Roll Back write order.The 10-27 cutover, replayed against this branch
08c761639)af0d8991b)rule_indexcarried (363aa005b)set-informon each offline device whose inform host moved, and lists the rest with their commandsset-informto the IPset-informthrough 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 thereset-informto the IP by handset-informcannot connect, so the alert givesip route add <console>/32 dev <if>; set-inform http://<console-ip>:8080/informOutside 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 onrelease/2.11before, 1055 after, all passing. No existing test edited. New tests are inReaddressInformTests(one per verdict, the Pi-hole name, override already on with an IP, override order and its Roll Back, URL mapping, the host route) andPlanCoordinatorTests(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.