Created
March 29, 2022 16:09
-
-
Save epjuan21/75c2399e038443a7d500009b7764b9d9 to your computer and use it in GitHub Desktop.
Configurar IP y DNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################## | |
### ### | |
### Prerrequisitos Instalacion Directorio Activo ### | |
### ### | |
######################################################## | |
### __ Identificar Tarjeta de Red Principal ___ ### | |
### _______________________________________________ ### | |
## ---------------------------------------------- | |
## Usar el Comando Get-NetAdapter | |
## ---------------------------------------------- | |
## | |
## Variables Tarjeta de Red | |
## ______________________________________________ | |
$AliasTarjetaDeRedActual = "Ethernet 1" | |
$AliasTarjetaDeRedNuevo = "LAN" | |
### __ Cambiar nombre del Adaptador de Red ___ ### | |
### _______________________________________________ ### | |
Get-NetAdapter -Name $AliasTarjetaDeRedActual | Rename-NetAdapter -NewName $AliasTarjetaDeRedNuevo -PassThru | |
### __ Cambiar Direccionamiento IP ___ ### | |
### _______________________________________________ ### | |
## | |
## Variables Direccionamiento IP | |
## ______________________________________________ | |
$IpAdress = "192.168.1.100" | |
$DefaultGateway = "192.168.1.254" | |
# Para ello debemos tener el nombre o el alias que pusimos a la tarjeta de red en el paso anterior | |
New-NetIPAddress -InterfaceAlias $AliasTarjetaDeRedNuevo -IPAddress $IpAdress -PrefixLength 24 -DefaultGateway $DefaultGateway | |
# Cambiar Direcciones DNS | |
Set-DnsClientServerAddress -InterfaceAlias $AliasTarjetaDeRedNuevo -ServerAddresses $IpAdress, $DefaultGateway | |
### __ Deshabilitar IPv6 ___ ### | |
### _______________________________________________ ### | |
Disable-NetAdapterBinding -Name $AliasTarjetaDeRedNuevo -ComponentID ms_tcpip6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment