Home All Groups Group Topic Archive Search About

Help with NETSH INTERFACE IP Please

Author
2 Sep 2006 6:31 PM
DaDuck
I'm trying to write a batch file to set the local IP address to static as
follows:

netsh interface ip set address name="Local Area Connection" source=static
addr=10.0.0.55 mask=255.255.255.0 gateway=10.0.5.1

I keep getting "the syntex for this command is not valid"  What's worng with
it... Any help would be much appreciated.
Alan

Author
2 Sep 2006 7:23 PM
Steve Winograd [MVP]
In article <6080722C-4FB4-41A6-972B-C2E1DFB32***@microsoft.com>,
DaDuck <DaD***@discussions.microsoft.com> wrote:
>
>I'm trying to write a batch file to set the local IP address to static as
>follows:
>
>netsh interface ip set address name="Local Area Connection" source=static
>addr=10.0.0.55 mask=255.255.255.0 gateway=10.0.5.1
>
>I keep getting "the syntex for this command is not valid"  What's worng with
>it... Any help would be much appreciated.
>Alan

When you specify a gateway address, you also have to specify a value
for the gateway metric.  For example:

   netsh interface ip set address name="Local Area Connection"   
   source=static addr=10.0.0.55 mask=255.255.255.0
   gateway=10.0.5.1 gwmetric=10
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see.  I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com