It uses the following command:-
netsh interface ip set address local static <IP address> <netmask>
<default gateway> 1
Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
If I go into network connections, I can change the IP from there but
I
need to be able to run from script.
>Got a script that runs automatically to set the IP address of my
>win2000 servers.
Odd, it's always best to have serves configured with static IP
addresses.
>It uses the following command:-
>
>netsh interface ip set address local static <IP address> <netmask>
><default gateway> 1
>
>Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
>
>If I go into network connections, I can change the IP from there but
>I
>need to be able to run from script.
The account launching the script has the correct permissions?
I think this has been mentioned in 24HSHD before,
http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.windows.server%2C&
see the groups
microsoft.public.windows.server.scripting
microsoft.public.windows.server.networking
The specific Win2000 groups
http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.win2000%2C&
Plain old www.google.com
Results 1 - 10 of about 9,410 for
netsh windows 2000 ip 0.0.0.0
. (0.23 seconds)
Maybe even, also mentioned before Windows 2000 is a MS product so MS
Support / Technet / MSDN
http://technet.microsoft.com/en-us/library/cc778925(WS.10).aspx
Netsh overview: Networking and Comm...
Netsh commands for Interface IP
To view the command syntax, click a command:
* set address
Fix your syntax or cut less out so it doesn't look incorrect.
Assuming you renamed "Local Area Connection" to "local"
netsh interface ip set address local source=static addr=<IP address>
mask=<netmask> gateway=<default gateway> gwmetric=1
Bottom of the page the example....
Netsh Interface IP example
The following command configures the interface named Local Area
Connection with the static IP address 10.0.5.99, the subnet mask of
255.255.255.0, and a default gateway of 10.0.5.1:
set address name="Local Area Connection" source=static addr=10.0.5.99
mask=255.255.255.0 gateway=10.0.5.1 gwmetric=1
Took longer to write than find.
Me
Thanks for the reply.
Background info. We use these servers for a number of our customers
and restore a Ghost image so we have a standard build. The
InstallAnywhere script is then used to set up the specifics for the
type of application server so it does things like set IP address.
This script works on every other server and has worked in the past. In
this instance, this is a new server build on new hardware so we had to
install from scratch to produce a base ghost image. This is the
problem, though, for some reason the script doesnt work on this one.
I've tried the command from the command line - doesnt work.
I've even tried netsh interface ip set address name="<name>"l static
<IP address> <netmask> <default gateway> 1 and this gives me an OK but
doesnt do anything.
I noticed on my other servers this command takes a few seconds to run
successfully, but on this server the ok comes back almost instantly.
Is there a log file or output for the netsh command?
Some <snippage> may have helped.
>On May 28, 5:29�pm, why? <fgrirp*sgc@VAINY!Qznq.fpvragvfg.pbz> wrote:
>> On Thu, 28 May 2009 07:44:36 -0700 (PDT), BertieBigBol...@gmail.com
>> wrote:
>>
>> >Got a script that runs automatically to set the IP address of my
>> >win2000 servers.
>>
>> Odd, it's always best to have serves configured with static IP
>> addresses.
>>
>> >It uses the following command:-
>>
>> >netsh interface ip set address local static <IP address> <netmask>
>> ><default gateway> 1
>>
>> >Doesnt give an error but does nothing. Leaves IP as 0.0.0.0.
<snip>
>> netsh interface ip set address local source=static addr=<IP address>
>> mask=<netmask> gateway=<default gateway> gwmetric=1
>>
>> Bottom of the page the example....
>>
>> Netsh Interface IP example
>>
>> The following command configures the interface named Local Area
>> Connection with the static IP address 10.0.5.99, the subnet mask of
>> 255.255.255.0, and a default gateway of 10.0.5.1:
>>
>> set address name="Local Area Connection" source=static addr=10.0.5.99
>> mask=255.255.255.0 gateway=10.0.5.1 gwmetric=1
>>
>> Took longer to write than find.
>>
>> Me
>
>Thanks for the reply.
>
>Background info. We use these servers for a number of our customers
<snip>
>This script works on every other server and has worked in the past. In
>this instance, this is a new server build on new hardware so we had to
So it needs changed somewhere. Guess who gets that job.
>install from scratch to produce a base ghost image. This is the
Write a new script bits for new h/w.
>problem, though, for some reason the script doesnt work on this one.
So if it fails in the script....
>I've tried the command from the command line - doesnt work.
... and at the command line are the NIC drivers okay, or prior to that
is the nic detected correctly.
Then you start back at the basics.
If you can put in the same NIC tyle as before, verify it will still
works.
If the image is okay, then boot up as normal, remove the nic reboot and
see what auto detect does.
Build in script detection for the different h/w to conditionally change
drivers.
Build server manually from format, create partitions, do the script
steps manually.
Move server specific settings to end of process, perhaps even after
image, reboot, then run server specific settings.
>I've even tried netsh interface ip set address name="<name>"l static
><IP address> <netmask> <default gateway> 1 and this gives me an OK but
Still doesn't look exactly like the online example command syntax. Did
you see the newsgroup names earlier?
Me
These servers are, in fact, one slot server cards. We're changing over
from one type to another because the older ones are now obsolete.
We've got 5 different ghost images (different server types) for the
old cards.
So, what I did was restore the images one by one onto an old card.
Then I changed the driver for the IDE to the basic microsoft one
(rather than the hardware specific one) and resaved this as a base
image.
Because the IDE drivers were now using the generic one, I could load
this image onto a new type card, and it would boot. Then I loaded all
the necessary drivers (video, system, LAN etc) for the new hardware
and everything seems OK.
On 4 out of the 5 cards, our scripts runs OK and set the IP address
correctly, On one card, the NETSH part of the script just does nothing
as described. I dont think theres anything different at all on this
card.