How to change IP address from command prompt

  • avi_avadhut
  • Newbie
  • Newbie
  • avi_avadhut
  • Posts: 8
  • Loc: India

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

//moved
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

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.
  • avi_avadhut
  • Newbie
  • Newbie
  • avi_avadhut
  • Posts: 8
  • Loc: India

Post 3+ Months Ago

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
  • Posts: 155
  • Loc: London, UK

Post 3+ Months Ago

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
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I see. That makes more sense now. Looks like DuckIT provided the answer.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

great info DuckIT :thumbsup:

I learned something new today! yay! :handsup:
  • midhat
  • Newbie
  • Newbie
  • midhat
  • Posts: 10

Post 3+ Months Ago

Very nice ;)
  • oneourplaygirl
  • Born
  • Born
  • oneourplaygirl
  • Posts: 1

Post 3+ Months Ago

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
  • Posts: 6807
  • Loc: Martinsburg, WV

Post 3+ Months Ago

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.
  • Ashirwad Vyawahare
  • Born
  • Born
  • Ashirwad Vyawahare
  • Posts: 1

Post 3+ Months Ago

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
  • Posts: 2350
  • Loc: Indiana

Post 3+ Months Ago

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
  • chkevin82
  • Posts: 1

Post 3+ Months Ago

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
  • Posts: 3
  • Loc: The Republic Georgia

Post 3+ Months Ago

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
  • bornfree
  • Posts: 1

Post 3+ Months Ago

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.
  • stechkov
  • Novice
  • Novice
  • stechkov
  • Posts: 22
  • Loc: philippines

Post 3+ Months Ago

run>
cmd>
type this command>
ipconfig /release
ipconfig /flush(is it correct?)
ipconfig /renew
  • hideip
  • Born
  • Born
  • hideip
  • Posts: 1

Post 3+ Months Ago

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


Until recently i used putty and ssh tunnel, but as you know ssh can not do UDP traffic tunneling that is why i've been searching other solution for myself and i found it. I recommend you SmartHide by Arovax http://www.smarthide.com - one click of a mouse and no settings headache :) You push a button and a tcp/udp tunnel is created and you don't need setup the software. All the programs work through tunnel... p2p, email, web surfing, skype, adult sites, online games and casino.

Hide and change IP!
  • Allwyna
  • Novice
  • Novice
  • Allwyna
  • Posts: 20

Post 3+ Months Ago

Hi,

I read all your posts, but I am not very familiar with some of the commands.

I want to change my IP address because I live in Mexico and I am forbidden to acess a lot of American sites. I don't think my purpose is illegal (maybe theirs is! :lol: )

Could you tell me about that NETSH thing? I also saw a way with a RUN command (ipconfig release) that changes it, but I am not sure. I work in a small network (2 computers) through a modem. I use Win XP and browse with Firefox

Thank you very much
  • tomatoehead
  • Born
  • Born
  • tomatoehead
  • Posts: 1

Post 3+ Months Ago

To Allwyna,

You don't just need to change your IP -- you need to change it to a different location than your own. The only real way to do this is through the use of proxy services.

A good one is at: http://www.iprivacytools.com (I know they have U.S. based servers, which is what you mentioned).

:)
  • boyblackcat
  • Born
  • Born
  • boyblackcat
  • Posts: 2

Post 3+ Months Ago

thank you
  • Allwyna
  • Novice
  • Novice
  • Allwyna
  • Posts: 20

Post 3+ Months Ago

Thanks a lot. I find that IP address scary! THAT shouldn't be permitted. I knew the IP was not enough to appear in a different country,

I have installed Tor, but it is disabled, I would need time to learn how to use it, as well as yours. Which I don't now, and I feel very frustrated.
  • jenicun
  • Born
  • Born
  • jenicun
  • Posts: 1

Post 3+ Months Ago

hi all , how can i change only my ip address without changing the gateway using netsh..
  • blueberry62
  • Novice
  • Novice
  • blueberry62
  • Posts: 34

Post 3+ Months Ago

I thought you can change your ip if you are hooked into the modum?
  • Allwyna
  • Novice
  • Novice
  • Allwyna
  • Posts: 20

Post 3+ Months Ago

"Modem" you mean? of course no!
  • espritje
  • Born
  • Born
  • espritje
  • Posts: 1

Post 3+ Months Ago

i type in cmd but get an error u know what the problem is?

grtz espritje
Attachments:
Naamloos.jpg
  • LINE71X
  • Beginner
  • Beginner
  • LINE71X
  • Posts: 53

Post 3+ Months Ago

You're going to get a new ip if your isp uses dhcp dynamic allocation: well at least for me

Mine does and i can get a new ip without trying too hard, All i do is go to windows network settings and put a different ip and save it then go back and click "obtain address automatically and within a minute i have a new ip
  • medilo06
  • Born
  • Born
  • medilo06
  • Posts: 1

Post 3+ Months Ago

http://mycommercialsite.blogspot...com/2010/03/how-to-set-ip-address-subnet-mask.html

This is coded by JOHN IAN R. MEDILO
:dated March 17, 2010 05:35am
:Usage: set address[name][[source=]dhcp| static [addr=]IP address[mask=]IP subnet mask][[geteway=]|none [gwmetric=]integer]"
:netsh interface ip show config

You can also get OPEN DNS. see yah..

netsh interface ip delete dns "Local Area Connection" all
  • KevinPO
  • Born
  • Born
  • KevinPO
  • Posts: 1

Post 3+ Months Ago

Cmd is great, but I recommend you to use some tool for that. I'm using Maxidix IP Switcher for example, it is the simplest way for fast switching between IP settings. I that the other program Wifi Suite can switch settings even automatically when you connecting to wireless network.

Post Information

  • Total Posts in this topic: 28 posts
  • Users browsing this forum: No registered users and 69 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.