Set IP from command line

netsh interface ip

Usage:
set address [name=]
[[source=]dhcp | [source=] static [addr=]IP address [mask=]IP subnet mask]
[[gateway=]|none [gwmetric=]integer]

Parameters:
* name – The name of the interface.
* source – One of the following values:
o dhcp: Sets DHCP as the source for configuring IP addresses for the specific interface.
o static: Sets the source for configuring IP addresses to local static configuration.
* gateway – One of the following values:
o : A specific default gateway for the static IP address you are setting.
o none: No default gateways are set.
* gwmetric – The metric for the default gateway. This field should not be set if gateway is set to ‘none’.

The following options are used only if source is ‘static’:
* addr – An IP address for the specified interface.
* mask – The subnet mask for the specified IP address.

Remarks:
Used to change the IP address configuration mode from either DHCP to static mode or static mode to DHCP. Adds IP addresses on an interface with static IP address or adds default gateways.

Examples:

* set address name=”Local Area Connection” source=dhcp
* set address local static 10.0.0.9 255.0.0.0 10.0.0.1 1

netsh interface ip set address name=”Local Area Connection” static 192.168.0.250 255.255.255.0 192.168.0.1 1


Written by Komkid on April 16th, 2009 with 2 comments.
Read more articles on Admin and IT Tips and Networking.

Related articles

2 comments

Read the comments left by other users below, or:

Get your own gravatar by visiting gravatar.com Dirnov
#1. May 3rd, 2009, at 9:38 AM.

Can i get a one small picture from your blog?
Thank you

Get your own gravatar by visiting gravatar.com I Lost T h i r t y P o u n d s in Thirty Days
#2. May 6th, 2009, at 1:50 PM.

Hi, good post. I have been wondering about this issue,so thanks for blogging. I’ll likely be subscribing to your blog. Keep up the good work

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:

You have to be identified to write a comment.