| 2 2xod.com, on Jul 20, 2008 10:51:02 pm BSTOf course you can change the IP from the command prompt.
The command is:
to change IP and default gateway:
netsh int ip set address "local area connection" static 192.168.0.101 255.255.255.0 192.168.0.254 1
to change DNS:
netsh int ip set dns "local area connection" static 192.168.0.254 primary
This is assuming 3 things.
1) The network adapter you're trying to change the IP for is "local area connection". It could also be "local area connection 2" or "wireless network connection". Look in your control panel for the correct name
2) The IP you want to set is 192.168.0.101, change this to whatever IP to want to use.
3) The default gateway and dns are the same IP. If you are using some kind of router they usually are. Change this to match your network config found with the command ipconfig /all
You will need to run both commands to change the IP. Reply to 2xod.com | 3 ., on Jul 21, 2008 1:58:00 pm BSTHow to revert back? when i use your method my internet connection was lost. Reply to . | 122 Romulus, on Oct 28, 2009 8:26:12 pm GMTDid u regain the connection??? if not, go to network connections right click on the local area connection-properties-internet protocol properties.
now select-1. obtain ip address automatically
2. obtain dns automatically.
hope it helped... i also faced the same problem.. Reply to Romulus |
|
| 34 ryan, on Jan 13, 2009 4:45:31 pm GMTCan you please step by step explain how to change my wireless (connected to a router) ip address.
if you can thankyou very much Reply to ryan | 46 Koranteng alex, on Mar 1, 2009 11:48:48 am GMTI am using windows xp
ip 192.68.0.1
subnet 255.255.255.0
gateway 192.168.0.254
preferred dns 25.166.0.13
altenate dns 16.50.55.2
how can i configure this on windows98?
thank you Reply to Koranteng alex |
|
| 40 music, on Jan 31, 2009 1:15:50 am GMTHiii..
very very thanks for you, to give me the information about netsh and its application in changing the ip address through cmd promt Reply to music |
| 49 vivek tyagi, on Mar 24, 2009 5:20:04 am GMTHow to change IP address from command prompt and centos linux based server Reply to vivek tyagi | 67 san, on Jun 28, 2009 5:30:51 am BSTIn windows--------------type the command
ipconfig <ip address? <subnet mask>
in linux
netconfig Reply to san |
|
| 54 mandi7, on May 11, 2009 3:11:49 am BSTSo i tried to run the netsh .... came back as the requested operation requires elevation. help please Reply to mandi7 | 58 HerbCSO, on May 17, 2009 12:03:43 pm BSTYou are running Vista or Windows 7 - you need to run the command prompt as an Administrator. Go to Start menu, type cmd, right-click on cmd.exe at the top of the menu and select "Run as administrator". Then it will work in that command prompt. Reply to HerbCSO |
|
| 59 HerbCSO, on May 17, 2009 12:08:23 pm BSTOne thing I found in Windows 7 (and I assume it's the same in Vista and XP) - if you have the IPv6 stack installed, you need an additional parameter to specify whether you're changing IPv4 or IPv6 settings - simply insert ipv4 in between int and set and it'll work there, too. See the batch file I created for myself:
@echo off
if "%1"=="static" goto static
if "%1"=="dhcp" goto dhcp
echo Usage: %0 (static^|dhcp)
goto end2
:static
echo Setting static IP of 192.168.xxx.xxx
netsh int ipv4 set address "Local Area Connection" static 192.168.xxx.xxx 255.255.255.0 192.168.xxx.xxx 1
echo Setting primary DNS server to 192.168.xxx.xxx
netsh int ipv4 set dnsservers "Local Area Connection" static 192.168.xxx.xxx primary
goto end
:dhcp
echo Setting Dynamic (DHCP) IP
netsh int ipv4 set address "Local Area Connection" dhcp
echo Setting Dynamic (DHCP) DNS
netsh int ipv4 set dnsservers "Local Area Connection" dhcp
goto end
:end
echo Waiting for IP config to update...
@choice /c 12 /T 3 /d 1 > NUL
ipconfig /all
pause
:end2 Reply to HerbCSO | 63 Afzal, on Jun 19, 2009 11:39:06 am BST@herbCSO ... That was a great bit of code... But one issue came up while I tried it in Vista..
netsh int ipv4 set dnsservers "Local Area Connection" static 192.168.xxx.xxx primary was giving an error The following command was not found: int ipv4 set dnsservers "Local Area Connection" static 192.168.xxx.xxx primary
After a bit of debugging i found that a 's' is extra in that command for me... it worked when it was changed to
netsh int ipv4 set dnsserver "Local Area Connection" static 192.168.xxx.xxx primary
Thanks again Reply to Afzal | 64 HerbCSO, on Jun 19, 2009 6:33:20 pm BST@Afzal Thx for trying it on Vista and posting the correction! ;] Reply to HerbCSO |
|
| 119 ENER, on Oct 27, 2009 3:49:05 pm GMTCould you please help me, actually i took your notes posted in en.kioskea.net abotu change ip with one click, I've trying all ways possible to do so and can't in windows seven. That's how I'm using in XP which works perfectly, but in W7 even when chang int Ipv4 and anothers don't know wahy reason it doesn't work. Please help me to solve it. I do change to many other ip cos.. I have not a DHPC server configured and have to change the ip in any city o place I come across.
In XP works fine, but in windows 7 neither changes with Ipv4 nor another commands works
netsh interface ip set address name="LAN" source=static addr=10.175.5.181 mask=255.255.0.0 gateway=10.175.1.1 gwmetric1
netsh interface ip set dns name="LAN" source=static addr=10.10.1.46
netsh interface ip add dns name="LAN" addr=10.10.1.52
I thank you a lot for any support.
All the best
Rene Reply to ENER |
| Please could you help me on this matter, I've working around it changing Ipv4 and another commands but still rushing on that. also your own config I've ran but nothing change with windows 7.
This is my batch file which works fine in XP, so please I beg you support to get it works in windows 7
netsh interface ip set address name="LAN" source=static addr=10.175.5.181 mask=255.255.0.0 gateway=10.175.1.1 gwmetric1
netsh interface ip set dns name="LAN" source=static addr=10.10.1.46
netsh interface ip add dns name="LAN" addr=10.10.1.52
Thank you very much any support
All the best Reply to enermelo |
| 135 ultifish, on Nov 15, 2009 8:27:20 pm GMTI can set the IP from the command line, but when it's scripted in a .bat file I will get a pop-up about the interface is not enabled and the script waits for my manual click. I can't seem to get this command to work:
netsh interface set interaface name="Plugged Local Area Connection" admin=ENABLED
I've tried many variations and always get something like:
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.
Any suggestions?
Thanks in advance. Reply to ultifish |
|
| 70 PUTTI RAMESH, on Aug 1, 2009 5:13:23 am BSTDear Friend,
Information what you are provided is very use full for me thank you for that and one more how to remove ip address using dos command please send a mail.
Thank you
PUTTI RAMESH Reply to PUTTI RAMESH |
| 79 Tboy, on Sep 4, 2009 11:30:32 am BSTPlease I have forgotten the password to my wireless bridge and i need to log in. How do I go about it? Reply to Tboy |
| 128 Annachi, on Oct 31, 2009 6:12:14 am GMTHi
Im using dhcp and i want to configure static ip through command prompt, and i tried ur above command, it didn't work.
Pls Help
Annachi Reply to Annachi |
| 133 Prabhat Raghav, on Nov 11, 2009 3:17:29 am GMTHi Dear,
Kindly let me know
How to change IP address by command prompt in Windows XP and Windows Vista. Reply to Prabhat Raghav |
|