How to configure an IP address in the Windows Server

The article covers multiple ways to configure IP addresses in the Windows Server. By default, all connected interfaces try to get an IP address via DHCP.

Configuring IP address via GUI

The fastest way to open IP configuration settings is to right-click on the Start, then click on Run.

In the opened window type ncpa.cpl and click on OK.

Right-click on the interface where you want to set the IP address or DNS server and then click on Properties.

Double-click on Internet Protocol Version 4 (TCP/IPv4). In the opened window click on Use the following IP address and type the necessary information.

Afterward, click on OK in all windows. The IP configuration is done.

Configuring IP address via cmd

For configuring the IP address via the command line, it needs to open it and type

netsh interface ipv4 set address Ethernet0 static 192.168.100.200 255.255.255.0 192.168.100.254

To set up the primary DNS server type

netsh interface ipv4 set dnsserver Ethernet0 static 1.1.1.1 primary

To add additional DNS server type

netsh interface ipv4 add dnsserver Ethernet0 8.8.8.8

The IP configuration is done.

Configuring IP address via Powershell

Use the next script to configure the IP address via PowerShell

$InterfaceName="Ethernet0"
$ServerIP='192.168.100.200'
$ServerIpMaskLength=24
$ServerIpGateway='192.168.100.254'
$ServerDns=@('1.1.1.1','8.8.8.8')
$Interface=Get-NetAdapter -Name $InterfaceName | Where-Object Status -eq Up
New-NetIpAddress -IpAddress $ServerIP -InterfaceIndex $Interface.InterfaceIndex -PrefixLength $ServerIpMaskLength -DefaultGateway $ServerIpGateway
Set-DnsClientServerAddress -InterfaceIndex $Interface.InterfaceIndex -ServerAddress $ServerDns

Configuring IP address via Server Config script

Open the command prompt or PowerShell and type

sconfig 

Type 8 and press Enter. Then type the interface index number and press Enter again.

The menu shows IP settings and several options for configuring.

Type 1 for configuring an IP address.

Type 2 for setting a DNS settings.

Type 3 for removing DNS addresses.

When you are done with IP configuration type 4 and press Enter to return to the main menu.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
๐Ÿ’ฌDiscuss or ask a question in the Telegram๐Ÿ’ฌ

ะงะธั‚ะฐั‚ัŒ ัั‚ัƒ ะถะต ัั‚ะฐั‚ัŒัŽ ะฝะฐ ั€ัƒััะบะพะผ ๐Ÿ‘‰ https://dzen.ru/media/samsitblog/kak-nastroit-ip-adres-v-windows-server-64c50543c4272158381eb4ce


Posted

in

, ,

by