Gestión de Redes desde la Línea de Comandos - PowerShell

PowerShell y las utilidades clásicas de Windows permiten inspeccionar y gestionar ajustes de red y habilitar acceso remoto. 💻✨


🧩 Diagnóstico básico de red

Ejemplo rápido:

ipconfig /all
arp -a
nslookup ACADEMY-ICL-DC
netstat -an

⚡ Cmdlets modernos de PowerShell (NetTCPIP / NetAdapter)

Ejemplo práctico:

# Desactivar DHCP
Set-NetIPInterface -InterfaceIndex 25 -Dhcp Disabled 🚫🏷️

# Asignar IP manual
Set-NetIPAddress -InterfaceIndex 25 -IPAddress 10.10.100.54 -PrefixLength 24 📝🖧

# Reiniciar adaptador
Restart-NetAdapter -Name 'Ethernet 3' 🔄

# Probar conexión
Test-NetConnection -ComputerName 8.8.8.8 ✅

🔐 Acceso remoto (SSH y WinRM)

🟢 Habilitar OpenSSH

# Instalar cliente y servidor SSH
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 🖥️🔑
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 🖥️🔑

# Iniciar servicio SSH y ponerlo automático
Start-Service sshd 🚀
Set-Service -Name sshd -StartupType Automatic 🕹️

🟢 Habilitar WinRM

# Configuración rápida de remoting
winrm quickconfig 🌐🔧
Enable-PSRemoting -Force ⚡
Test-WSMan -ComputerName <IP>             🔍
Test-WSMan -ComputerName <IP> -Authentication Negotiate ✅
Enter-PSSession -ComputerName <IP> -Credential <user> -Authentication Negotiate 💻🔑

⚠️ Seguridad: usar HTTPS, TrustedHosts limitados y Kerberos en dominio. 🛡️🔒