Thursday, March 13, 2008

Define IP Address via Commandline

A very interesting situation i came across when migrating a server into ESX.
I coudlnt’t change the ip address through network connections as they weren’t appearing there and the network connections panel would lockup.
The server was showing them in ipconfig but i coudln’t change the ip adresses to define them, my only choice was to do it via commandline.
This is where the netshell comes into its own, the following command was what i used. As soon as i made the specific change the adaptors became available in the network connections menu.
I cant explain why this was an issue but due to migrating from a physical install to a virtualised one i was willing to go with it.
The source=static part is to define static instead of dhcp.

Command
netsh interface ip set address name=“local area connection” source=static addr=10.0.0.1 mask=255.255.255.0

unfortunately the vlan my servers sit in dont have dhcp or the following command would help at least get an ip on the NIC and allow me to administer it that way, but maybe you want to so here it is.
netsh interface ip set address “Local Area Connection” dhcp
netsh interface ip set dns “Local Area Connection” dhcp

Determining which NIC to alter
luckily i could still access the commandline so i can do an ipconfig and find the name of the NIC, you may want to change a different one than the primary and say its the second one you can use the command below to give you an idea of how that should be put in.
“local area connection 3”


Posted by admin in • Netsh
Permalink
Page 1 of 1 pages