Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to change a machine ip address vi CMD with this code:

netsh int ip set address name="Local Area Connection" source=static addr=???.???.???.??? mask=

The problem that the IP doesn't changed (checked by ipconfig) but doesn't not changed on the DHCP. Thus when i restart the machine, the IP is returned to DHCP. I need a pay to change the ip permanently via CMD.

Any ideas?

share|improve this question
You need to specify the default gateway and metric as well as the address and mask. See the examples in the answers already posted. (The help syntax says these are optional, but they're not.) – Harry Johnston Mar 26 '12 at 23:04
up vote 1 down vote accepted

Most of the examples I've seen of setting a static IP through netsh don't use the source= and addr= parts. Have you tried like this?

netsh int ip set address name="Local Area Connection" static 1

Where is your IP, is your default gateway, and 1 is the metric?

share|improve this answer

Try this: netsh interface ip set address name=”<network connection name>” static <static IP> <network mask> <default gateway>

which looks like:

netsh interface ip set address name=”Ethernet Network Connection” static

Information from here

share|improve this answer
Thanks but when I reboot the server I get back the previous IP Addresses. – edotan Mar 27 '12 at 6:40
Why can't you just open up the settings manually? – cutrightjm Mar 27 '12 at 12:07
@Elad: did the address change successfully, then go back again when the server was rebooted? That shouldn't happen; perhaps something (group policy?) is reconfiguring the server on reboot? – Harry Johnston Mar 27 '12 at 23:37
sorry, I thought he answered before you did. now I see I was wrong. – edotan Nov 24 '14 at 8:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.