Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Thursday, June 4, 2009

Set Static IP address on Server Core

Objective: Set a static IP Address

This example assumes that you want to configure a static IP addres of 10.10.1.10 with a subnet mask of 255.255.0.0 of a Windows 2008 Server Core.


Task 1: Get the name of the interface you want to set an IP address for.
· Type netsh interface ipv4 show interfaces
· Press Enter
· Record the name of the interface you want to set a static IP address for. Sample output is below.

Idx Met MTU State Name
--- --- ----- ----------- -------------------
3 5 1500 Connected Local Area Connection

· Local Area Connection is the name we are interested in.
· To simplify the typing, you can also user the Idx value of 3.

Task 2: Set the IP Address
· Type netsh interface ipv4 set address name=3 source=static address=10.10.1.10 mask=255.255.0.0
· Optionally, you can add a gateway address by appending gateway=address to the end of the command.
· In the Name parameter, we used the Idx value. We could have also typed “Local Area Network”.

Task 3: Verify the address change
· Type IPConfig /all and verify that all data is correct.

4 comments:

anu said...

I read this article and know how to set the static ip address on server core. Because i know only how to get the ip adddress for our own website from ip details

Jason Yoder, MCT said...

Anu,

I'm not sure if you have a question here or not. If you are wondering how to get the IP address of your server core, just log in to it and type IPCONFIG /ALL.

A said...

is there a way to change the network label of a specific ipv4 interface?

Jason Yoder, MCT said...

Yes there is:
netsh set interface name = "Old name" newname= "NewName"