How to change IP address from command prompt

  • avi_avadhut
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 01, 2004
  • Posts: 8
  • Loc: India
  • Status: Offline

Post June 1st, 2004, 12:55 am

Hi guys,
is there any way to change IP address of computer from Command prompt.

I use WinXP as OS and i would like to know if i can chage IP from Command prompt (in both cases - Static or automatic)

please reply


avi
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 1st, 2004, 12:55 am

Post June 1st, 2004, 4:12 am

//moved
- dM
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22454
  • Loc: Pittsburgh PA
  • Status: Online

Post June 1st, 2004, 4:42 am

There's no way to effectively change it from a command prompt. You could use the ipconfig release and renew commands, but chances are you're just going to get your old IP address back, especially if you are behind a router or static IP.

Why would you want to do this anyway out of curiosity? The answer might help you get better ideas.
"The web is a dominatrix. Every where I turn, I see little buttons ordering me to Submit."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • avi_avadhut
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 01, 2004
  • Posts: 8
  • Loc: India
  • Status: Offline

Post June 1st, 2004, 5:33 am

Hi thanks for reply but changeing IP from command prompt was just a chanllange for me from my senior.

i work in (1200 + comp. , 15 servers, 5 routers, 35 switches) network in india.

it is just 6th month for me in networking. but i had spend those 6 months like 3 years (around 16 hours a day)

anyway thanks for reply.

avi
  • DuckIT
  • Graduate
  • Graduate
  • User avatar
  • Joined: May 04, 2004
  • Posts: 155
  • Loc: London, UK
  • Status: Offline

Post June 1st, 2004, 5:53 am

Hi

The NETSH command does this. This is its helpfile:

Quote:
Commands in this context:
.. - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline mode.
add - Adds a configuration entry to a list of entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline mode.
delete - Deletes a configuration entry from a list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface' context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.

The following sub-contexts are available:
bridge diag firewall interface ras routing


Works in a batch file too. I used to use this all the time but I lost all my batch files :cry: .

Examples:

Quote:
netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1


to set a static address or

Quote:
netsh interface ip set address "Local Area Connection" dhcp


to set it to DHCP. Its a great command to have a link to on the desktop if you frequently move between static & DHCP networks etc. I used to use it a lot when i was configuring firewalls and needed to quickly switch my machine between outside & inside subnets.

Hope that helps!

S
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22454
  • Loc: Pittsburgh PA
  • Status: Online

Post June 1st, 2004, 6:31 am

I see. That makes more sense now. Looks like DuckIT provided the answer.
"The web is a dominatrix. Every where I turn, I see little buttons ordering me to Submit."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 6396
  • Loc: unflux.net
  • Status: Offline

Post June 1st, 2004, 11:18 am

great info DuckIT :thumbsup:

I learned something new today! yay! :handsup:
UNFLUX.net Hosting | Foto
Quality Web Hosting
  • midhat
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Apr 20, 2004
  • Posts: 10
  • Status: Offline

Post June 4th, 2004, 5:52 pm

Very nice ;)

Post April 20th, 2006, 8:14 am

i m confused. I m trying to change my ip address to flag a post on craigslist.org because they only allow 3 flags peron ip address so I m trying to get around that.
  • grinch2171
  • Moderator
  • Genius
  • User avatar
  • Joined: Feb 11, 2004
  • Posts: 6312
  • Loc: Martinsburg, WV
  • Status: Offline

Post April 20th, 2006, 9:27 am

We are not going to help you get around craiglists website set-up. If you have an issue contact the admins over there and see if they would be willing to change the rule.

By the way, this is on the subject of changing your LAN ip. Your external IP is set by your ISP and you cannot change it. That is the IP craigslist is seeing.

Post May 8th, 2006, 4:30 am

Hi all,

I have used the netsh command menssioned before. I also provide the proper ip address, mask and gateway then also got the following message :

"The syntax supplied for this command is not valid. Check help for the correct syntax.

Usage: set address[name]<string>[[source=]dhcp| static [addr=]IP address[mask=]IP subnet mask][[geteway=]<IP Address>|none [gwmetric=]integer]"

But when I used 'set address' command it work properly but the ip address doesn't changed.

Can any one help me to change ip address from command line. Thanks in advance.
  • lucassix
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 13, 2004
  • Posts: 2335
  • Loc: Living in a VAN DOWN BY THE RIVER!
  • Status: Offline

Post May 8th, 2006, 6:45 am

Which IP are you trying to change? You can not change the IP given to you by your ISP. You are probably tring to set an IP on an adapter that has already received an address from DHCP - that won't work.
  • chkevin82
  • Born
  • Born
  • No Avatar
  • Joined: Oct 08, 2007
  • Posts: 1
  • Status: Offline

Post October 8th, 2007, 10:57 am

Here is an example if you want to change IP to 192.168.142.102, subnet mask to 255.255.255.0 and gataway to 192.168.142.1
netsh interface ip set address "Local Area Connection" static 192.168.142.102 255.255.255.0 192.168.142.1 2

Let me know if you have question

Kevin
  • Prada
  • Born
  • Born
  • User avatar
  • Joined: Nov 26, 2007
  • Posts: 3
  • Loc: The Republic Georgia
  • Status: Offline

Post November 26th, 2007, 7:58 am

Hi :). I think this info also will be usefull for you :). Show that you can change dns server addresses from CMD as well as you can change an IP address :). Show your boss him you are a cute guy :).

To change DNS server addresses from cmd type next:

1.netsh
2.interface ip set dns "local area connection" static <IP address of a DNS server>

You can even add other DNS servers :) from cmd.
To do this type next:

1.netsh
2.interface ip add dns "local area connection" <IP address of a DNS server>

Screenshots:
Image
Image
  • bornfree
  • Born
  • Born
  • No Avatar
  • Joined: Dec 16, 2007
  • Posts: 1
  • Status: Offline

Post December 16th, 2007, 12:01 pm

grinch2171 wrote:
Your external IP is set by your ISP and you cannot change it. That is the IP craigslist is seeing.


You could actually use an ip changer service like http://www.iprivacytools.com to change your "external ip", which it does by routing your traffic so that your ip simply "appears" differently to websites.

To the guy that wanted to change your ip address to flag on craigslist: if the posting you wish to remove is a bad one, then others will flag it too, and it will get removed eventually. That's how the system works.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 16th, 2007, 12:01 pm

Post Information

  • Total Posts in this topic: 24 posts
  • Users browsing this forum: No registered users and 316 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.