fix: IP del modo VPS via interfaz de la ruta por defecto #5
No files matched your search
@@ -96,8 +96,12 @@ if ($Mode -eq 'local') {
|
|||||||
Write-Host " URL: ${Cyan}http://localhost:${WebUiPort}${NC}"
|
Write-Host " URL: ${Cyan}http://localhost:${WebUiPort}${NC}"
|
||||||
} else {
|
} else {
|
||||||
Warn 'Modo: VPS (accesible desde fuera)'
|
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 |
|
$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
|
Select-Object -First 1).IPAddress
|
||||||
if (-not $Ip) { $Ip = 'TU_IP' }
|
if (-not $Ip) { $Ip = 'TU_IP' }
|
||||||
Write-Host " URL: ${Cyan}http://${Ip}:${WebUiPort}${NC}"
|
Write-Host " URL: ${Cyan}http://${Ip}:${WebUiPort}${NC}"
|
||||||
|
|||||||
@@ -131,8 +131,12 @@ if ($Mode -eq 'local') {
|
|||||||
Write-Host " IA (chat): ${Cyan}http://localhost:${WebUiPort}${NC}"
|
Write-Host " IA (chat): ${Cyan}http://localhost:${WebUiPort}${NC}"
|
||||||
} else {
|
} else {
|
||||||
Warn 'Modo: VPS (accesible desde fuera)'
|
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 |
|
$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
|
Select-Object -First 1).IPAddress
|
||||||
if (-not $Ip) { $Ip = 'TU_IP' }
|
if (-not $Ip) { $Ip = 'TU_IP' }
|
||||||
Write-Host " WordPress: ${Cyan}http://${Ip}:${WpPort}${NC}"
|
Write-Host " WordPress: ${Cyan}http://${Ip}:${WpPort}${NC}"
|
||||||
|
|||||||
Reference in new issue
Block a user