From a2037ee290fd65c41a3c1226bc2bab1f522d1dd0 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sat, 12 Sep 2026 20:49:16 +0200 Subject: [PATCH] fix: IP del modo VPS via interfaz de la ruta por defecto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 10.5.0.2 (vEthernet WSL) salia como URL: el filtro por rango 172.16-31 no cubre las IPs internas 10.x de WSL/Hyper-V. Ahora se coge la IP de la interfaz que tiene la ruta 0.0.0.0/0 — la que de verdad va a la LAN. Fallback TU_IP si no hay ruta. --- openwebui/deploy.ps1 | 6 +++++- wordpress/deploy.ps1 | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/openwebui/deploy.ps1 b/openwebui/deploy.ps1 index c552880..f30e00d 100644 --- a/openwebui/deploy.ps1 +++ b/openwebui/deploy.ps1 @@ -96,8 +96,12 @@ if ($Mode -eq 'local') { Write-Host " URL: ${Cyan}http://localhost:${WebUiPort}${NC}" } else { Warn 'Modo: VPS (accesible desde fuera)' + # IP real de LAN: la de la interfaz con la ruta por defecto (evita vEthernet + # WSL/Hyper-V, Docker, VPN — que son 172.16-31.*, 10.x internos, etc.) + $GwIf = (Get-NetRoute -DestinationPrefix '0.0.0.0/0' -ErrorAction SilentlyContinue | + Sort-Object RouteMetric | Select-Object -First 1).ifIndex $Ip = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue | - Where-Object { $_.IPAddress -notlike '127.*' -and $_.IPAddress -notlike '169.254.*' -and $_.IPAddress -notmatch '^172\.(1[6-9]|2[0-9]|3[01])\.' } | + Where-Object { $_.ifIndex -eq $GwIf -and $_.IPAddress -notlike '127.*' } | Select-Object -First 1).IPAddress if (-not $Ip) { $Ip = 'TU_IP' } Write-Host " URL: ${Cyan}http://${Ip}:${WebUiPort}${NC}" diff --git a/wordpress/deploy.ps1 b/wordpress/deploy.ps1 index 8d7c5cb..5fdc677 100644 --- a/wordpress/deploy.ps1 +++ b/wordpress/deploy.ps1 @@ -131,8 +131,12 @@ if ($Mode -eq 'local') { Write-Host " IA (chat): ${Cyan}http://localhost:${WebUiPort}${NC}" } else { Warn 'Modo: VPS (accesible desde fuera)' + # IP real de LAN: la de la interfaz con la ruta por defecto (evita + # vEthernet WSL/Hyper-V, Docker, VPN) + $GwIf = (Get-NetRoute -DestinationPrefix '0.0.0.0/0' -ErrorAction SilentlyContinue | + Sort-Object RouteMetric | Select-Object -First 1).ifIndex $Ip = (Get-NetIPAddress -AddressFamily IPv4 -ErrorAction SilentlyContinue | - Where-Object { $_.IPAddress -notlike '127.*' -and $_.IPAddress -notlike '169.254.*' -and $_.IPAddress -notmatch '^172\.(1[6-9]|2[0-9]|3[01])\.' } | + Where-Object { $_.ifIndex -eq $GwIf -and $_.IPAddress -notlike '127.*' } | Select-Object -First 1).IPAddress if (-not $Ip) { $Ip = 'TU_IP' } Write-Host " WordPress: ${Cyan}http://${Ip}:${WpPort}${NC}"