From 046a8159624a0eceed80bb322e2f67656543d45a Mon Sep 17 00:00:00 2001 From: Alejandro Rosales Date: Thu, 1 Oct 2026 15:48:04 -0600 Subject: [PATCH] Resolve Sala Inmersiva workgroup names from CED --- docs/ced-network-operations.md | 52 +++++++++++++++++++-- scripts/Set-SguCedAdminDns.ps1 | 28 +++++++++++ scripts/Sync-SguSalaWorkgroupDns.ps1 | 69 ++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 scripts/Set-SguCedAdminDns.ps1 create mode 100644 scripts/Sync-SguSalaWorkgroupDns.ps1 diff --git a/docs/ced-network-operations.md b/docs/ced-network-operations.md index 0ce084c..d4507da 100644 --- a/docs/ced-network-operations.md +++ b/docs/ced-network-operations.md @@ -237,9 +237,55 @@ From LCI-77 with live SSID **Centro de Experiencia Digital**, TCP 3389 to that address succeeded. An actual RDP connection negotiation returned a 19-byte reply with negotiation response type 2 and selected protocol 2 (HYBRID/NLA). This validates the RDP endpoint across the VLANs, not an authenticated desktop session. -Before domain enrollment, use the current IP address and an authorized local -SI-04 account. The bare name alone is not a reliable cross-subnet connectivity -test. No domain enrollment or domain DNS record was created for this test. +This initial test did not enroll SI-04 or create a domain DNS record. Before +enrollment, an authenticated RDP login still requires an authorized local SI-04 +account. + +#### Workgroup names available from CED + +The subsequent DNS repair publishes A records in the existing secure AD DNS +zone `lci.lasalle.mx`, without creating AD computer objects. The router's Sala +Inmersiva client list identified six additional Windows workgroup names: +`SI-02`, `SI-04`, `SI-05`, `SI-06`, `SI-07`, and `SI-08`. Each address was verified +with a direct DNS query to `192.168.55.1` before publication. SI-04 currently +resolves to `192.168.55.138`. + +On SGU-DC02, task **LCI - Sala Inmersiva workgroup DNS** runs +`scripts/Sync-SguSalaWorkgroupDns.ps1` as SYSTEM every five minutes, using the +protected folder `C:\ProgramData\LCI-Admin\Sala-DNS`. No credentials are stored. +Its `manifest.json` contains the approved names and their last published +addresses. Only router answers in `192.168.55.0/24` are accepted. The sync refuses +to overwrite records changed by another administrator and stops managing a name +once it has an AD computer object. New names require explicit approval and an +entry in this manifest; arbitrary guest/IoT clients are not imported. + +Records have a five-minute TTL. A failed router query preserves the last record +and reports an error in `last-result.json` and the task result; the TTL does not +expire the server record. Review these errors if an address becomes stale. +The first two SYSTEM runs completed successfully with all six records current. +The zone continues to allow secure dynamic updates only. + +Domain clients use their domain suffix and existing **CED - DNS de dominio** GPO. +The workgroup administrator PC LCI-77 additionally needed the Wi-Fi connection +suffix `lci.lasalle.mx` and an NRPT rule for that namespace pointing to +`192.168.54.211`; `scripts/Set-SguCedAdminDns.ps1` reproduces this local setup. +The prior suffix is saved in `LCI77-Sala-DNS-before.json` in the protected private +folder. The rule applies only to this DNS namespace; existing Tailscale rules +remain intact. The adapter suffix persists across Wi-Fi profile changes. + +Validation used Windows' application resolver (`System.Net.Dns.GetHostAddresses`), +not just an explicit DNS-server query. All six short names resolved on LCI-77 +while its live SSID was **Centro de Experiencia Digital**. AF-02, at +`192.168.54.130`, also resolved SI-04 correctly. A TCP connection opened using +the name **SI-04** from LCI-77 reached port 3389 and received a successful RDP +HYBRID/NLA negotiation response. This verifies name resolution and the RDP +endpoint across networks; it does not assert an authenticated desktop session. + +To undo this DNS repair, disable the sync task first. Remove only manifest-owned +A records that still match their last published IP and have no AD computer object. +On LCI-77, restore the saved Wi-Fi suffix and remove only the NRPT rule with the +comment `CED domain DNS for local administrator Wi-Fi`. Keep the domain GPO and +unrelated DNS rules. These DNS changes require no router apply or radio restart. To recover the previous Wi-Fi, first provision an existing known-good profile and reconnection task on SGU-DC02 and affected PCs. Then restore Aula Flexible on diff --git a/scripts/Set-SguCedAdminDns.ps1 b/scripts/Set-SguCedAdminDns.ps1 new file mode 100644 index 0000000..18d43b4 --- /dev/null +++ b/scripts/Set-SguCedAdminDns.ps1 @@ -0,0 +1,28 @@ +# Local elevated setup for the workgroup administration PC, LCI-77. +# Domain computers receive the existing CED DNS GPO instead. +[CmdletBinding()] +param( + [string]$InterfaceAlias = 'Wi-Fi', + [string]$BackupPath = 'C:\Users\alex\Documents\CED-Network-Private\LCI77-Sala-DNS-before.json' +) +$ErrorActionPreference = 'Stop' +if ($env:COMPUTERNAME -ne 'LCI-77') { throw 'This setup is only for LCI-77.' } +$client = Get-DnsClient -InterfaceAlias $InterfaceAlias +if (-not (Test-Path -LiteralPath $BackupPath)) { + $client | Select-Object InterfaceAlias, ConnectionSpecificSuffix | + ConvertTo-Json | Set-Content -LiteralPath $BackupPath -Encoding UTF8 +} +Set-DnsClient -InterfaceAlias $InterfaceAlias -ConnectionSpecificSuffix 'lci.lasalle.mx' +$rules = @(Get-DnsClientNrptRule | Where-Object { $_.Namespace -contains '.lci.lasalle.mx' }) +if ($rules.Count -gt 0 -and ($rules.Count -ne 1 -or $rules[0].NameServers -ne '192.168.54.211')) { + throw 'An existing domain DNS rule needs review; it was not overwritten.' +} +if ($rules.Count -eq 0) { + Add-DnsClientNrptRule -Namespace '.lci.lasalle.mx' -NameServers '192.168.54.211' -Comment 'CED domain DNS for local administrator Wi-Fi' +} +Clear-DnsClientCache +[pscustomobject]@{ + Computer = $env:COMPUTERNAME + Suffix = (Get-DnsClient -InterfaceAlias $InterfaceAlias).ConnectionSpecificSuffix + SI04 = @([Net.Dns]::GetHostAddresses('SI-04') | ForEach-Object IPAddressToString) +} diff --git a/scripts/Sync-SguSalaWorkgroupDns.ps1 b/scripts/Sync-SguSalaWorkgroupDns.ps1 new file mode 100644 index 0000000..a2e8c5f --- /dev/null +++ b/scripts/Sync-SguSalaWorkgroupDns.ps1 @@ -0,0 +1,69 @@ +# Run locally on SGU-DC02 as SYSTEM. The protected manifest owns only explicitly +# approved workgroup names; never import arbitrary router clients into AD DNS. +[CmdletBinding()] +param( + [string]$ManifestPath = 'C:\ProgramData\LCI-Admin\Sala-DNS\manifest.json' +) + +$ErrorActionPreference = 'Stop' +Import-Module DnsServer +Import-Module ActiveDirectory +if ($env:COMPUTERNAME -ne 'SGU-DC02') { throw 'Run this sync on SGU-DC02.' } +$manifest = Get-Content -LiteralPath $ManifestPath -Raw | ConvertFrom-Json +if ($manifest.Zone -ne 'lci.lasalle.mx' -or $manifest.RouterDns -ne '192.168.55.1') { + throw 'Unexpected DNS zone or router in the manifest.' +} +$results = @() +$failed = $false +foreach ($entry in $manifest.Records) { + $result = [ordered]@{ Name = $entry.Name; Status = ''; IP = $null; Error = $null } + try { + if ($entry.Name -notmatch '^si-\d{2}$') { throw 'Name is outside the approved SI naming pattern.' } + # After domain enrollment, leave DNS management to the machine's secure + # registration. Do not fight a domain client or overwrite someone else's A. + $adObject = Get-ADComputer -Server $env:COMPUTERNAME -Filter "Name -eq '$($entry.Name)'" + if ($adObject) { + $result.Status = 'DomainManaged' + } else { + $records = @(Get-DnsServerResourceRecord -ZoneName $manifest.Zone -Name $entry.Name -ErrorAction SilentlyContinue) + if ($records.Count -gt 0 -and ($records.Count -ne 1 -or $records[0].RecordType -ne 'A' -or + $records[0].RecordData.IPv4Address.IPAddressToString -ne $entry.LastPublishedIP)) { + throw 'DNS record differs from the owned record; refusing to overwrite it.' + } + $addresses = @(Resolve-DnsName -Name "$($entry.Name)." -Server $manifest.RouterDns -Type A -DnsOnly -QuickTimeout | + Where-Object Type -eq A | Select-Object -ExpandProperty IPAddress -Unique) + if ($addresses.Count -ne 1 -or $addresses[0] -notmatch '^192\.168\.55\.(\d{1,3})$' -or + [int]$Matches[1] -lt 2 -or [int]$Matches[1] -gt 254) { + throw 'Router did not return a single host address in Sala Inmersiva.' + } + $address = $addresses[0] + if ($records.Count -eq 0) { + Add-DnsServerResourceRecordA -ZoneName $manifest.Zone -Name $entry.Name -IPv4Address $address -TimeToLive ([TimeSpan]::FromMinutes(5)) + $result.Status = 'Created' + } elseif ($address -ne $entry.LastPublishedIP) { + $updated = $records[0].Clone() + $updated.RecordData.IPv4Address = [Net.IPAddress]::Parse($address) + $updated.TimeToLive = [TimeSpan]::FromMinutes(5) + Set-DnsServerResourceRecord -ZoneName $manifest.Zone -OldInputObject $records[0] -NewInputObject $updated + $result.Status = 'Updated' + } else { + $result.Status = 'Current' + } + $entry.LastPublishedIP = $address + $result.IP = $address + } + } catch { + $result.Status = 'Error' + $result.Error = $_.Exception.Message + $failed = $true + } + $results += [pscustomobject]$result +} +# A failed router query preserves the last record. TTL limits client caching, +# not record lifetime: operators must review errors instead of assuming freshness. +$manifest | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath "$ManifestPath.next" -Encoding UTF8 +Move-Item -LiteralPath "$ManifestPath.next" -Destination $ManifestPath -Force +[pscustomobject]@{ Time = (Get-Date).ToString('o'); Records = $results } | + ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path (Split-Path $ManifestPath) 'last-result.json') -Encoding UTF8 +$results +if ($failed) { throw 'One or more Sala DNS records could not be synchronized. See last-result.json.' }