Q. How do I use the command line to configure Windows Server 2008 and Windows Vista IPv4 static IP information?

A. The syntax used with the Netsh interface to configure Server 2008 and Vista static IP information has changed due to IPv6 inclusion. Here's how I used the command line to configure Server 2008 and Vista IPv4 static IP information.
  1. I determined the interface to configure (because Server 2008 and Vista have several). I listed the interfaces using the command

netsh interface ipv4 show interfaces

The output was:

I designated the physical adapter index 2.

  • Then I configured a static IP address.
  • netsh interface ipv4 set address name="2" source=static address=10.1.1.11 mask=255.255.255.0 gateway=10.1.1.10

  • Next I added the DNS servers. The primary DNS server's index is 1.
  • netsh interface ipv4 add dnsserver name="2" address=192.168.1.230 index=1

  • To add a secondary DNS server, I repeated the add dnsserver command but designated the new server's index as 2.
  • netsh interface ipv4 add dnsserver name="2" address=192.168.1.230 index=2

  • To configure primary and secondary WINS servers, I'd utilize exactly the same syntax I employed to add the DNS servers, but in the code I'd substitute winsserver for dnsserver. The first index would be the primary WINS server and the second index would be the secondary WINS server.
  • Please or Register to post comments.

    IT/Dev Connections

    Las Vegas
    September 30th - October 4th

    Paul ThurottYou'll have the opportunity to experience:
    • The Microsoft
    Technology Roadmap
    • Office 365 Implementation
    • Hyper-V Optimizing
    • Windows 8 Deployment
    and much more!

    Come See Paul Thurrott & Rod Trent in Person!

    Early Registration Now Open

    Upcoming Training

    Mastering System Center 2012

    During over 6 hours of training you can join John Savill from your computer as he will walk you through the key components and capabilities of System Center 2012, what’s involved in using the components, and the benefit they can bring to your environment.

    Register Now

    Current Issue

    May 2013 - The NameTranslate object is useful when you need to translate Active Directory object names between different formats, but it's awkward to use from PowerShell. Here's a PowerShell script that eliminates the awkwardness.

    CURRENT ISSUE / ARCHIVE / SUBSCRIBE

    Windows Forums

    Get answers to questions, share tips, and engage with the Windows Community in our Forums.