change proxmox host ip post install cli

shawzy007

New Member
Dec 11, 2025
1
0
1
Hi there, I searched and found info but I think I am missing something

My proxmox host was intalled on ip 192.168.50.xxx and after a router change my LAN range is now 192.168.88.xxx

I need to change the IP on proxmox host so I can access it. I have followed a post and edited /etc/network/interfaces and /etc/hosts. rebooted the machine completely. The login screen shows the new IP however I can still not access it on a web browser..

Any ideas? thanks
 
try this bash script:
Bash:
#!/bin/bash

# Verifica si se ejecuta como root
if [[ $EUID -ne 0 ]]; then
  echo "Este script debe ejecutarse como root"
  exit 1
fi

# Pedir la nueva IP y gateway
read -p "Nueva IP (ej: 192.168.1.200/24): " NUEVA_IP
read -p "Nueva Gateway (ej: 192.168.1.1): " NUEVA_GW

# Ruta al archivo de configuración
INTERFACES_FILE="/etc/network/interfaces"

# Crear backup del archivo original
cp "$INTERFACES_FILE" "${INTERFACES_FILE}.bak"

# Cambiar address y gateway usando sed
sed -i -E "s|^\s*address\s+.*|    address $NUEVA_IP|" "$INTERFACES_FILE"
sed -i -E "s|^\s*gateway\s+.*|    gateway $NUEVA_GW|" "$INTERFACES_FILE"

# Mostrar cambios realizados
echo "Cambio realizado!. Los nuevos valores son:"
grep -E 'address|gateway' "$INTERFACES_FILE"

# Confirmar antes de reiniciar
read -p "¿Reiniciar el servidor ahora? [s/N]: " CONFIRM

if [[ "$CONFIRM" =~ ^[sS]$ ]]; then
  echo "Reiniciando el servidor..."
  reboot
else
  echo "Reinicio cancelado. Cambios aplicados, pero se requiere reinicio para que tengan efecto."
fi
 
Last edited: