A familiar tool helps you do the necessary tinkering
| Executive Summary:|
To get Server Coreâ€™s network stack set up, you can use the Netsh utility, which has gone through some recent changes. Hereâ€™s how to use the latest incarnation.
If youâ€™re like me, youâ€™re excited about the prospect of Server Core, Windows Server 2008â€™s GUI-less alternative. In this space, Iâ€™ve tackled a few aspects of Server Core configuration. Now, itâ€™s time to get Server Coreâ€™s network stack set up. To do that, Iâ€™ll use Netsh, a tool that Iâ€™ve described in the past but thatâ€™s changed enough to warrant a new look.
IP and DNS
Netsh can accomplish many tasks, and one of those is to set a systemâ€™s IP address and DNS servers. Like the IPv4 Properties GUI that youâ€™ll find in the full Server 2008 installation, Netsh lets you choose to either assign a static IP address or get IP information from a DHCP server. Using DHCP makes for a simpler command, so letâ€™s start with that:
netsh int ip set address â€ślocal area connectionâ€ť dhcpDHCP is the default setting, so itâ€™s more likely that youâ€™ll want to set a static IP address. To do so, assemble a Netsh command as follows:
address> <netmask> \[<gateway IP address> \[<metric>\]\]
Notice that the gateway is now optional. Some older versions of Netsh complained if you left the default gatewayâ€™s IP address off a Netsh command. For example, to assign a static IP address of 192.168.2.2 on a /24 network with a default gateway address of 192.168.2.1, youâ€™d type
192.168.2.2 255.255.255.0 192.168.2.1
First, Second, Thirdâ€¦
Finally, youâ€™ll want to specify one or more DNS serversâ€™ IP addresses that your Server Core system can use for resolving names. Netsh can do that, but the syntax is a bit unexpected: You use netsh int ip set dns to set the preferred DNS server and netsh int ip add dns to specify your additional choices. The syntax for setting the first DNS server is easier than for setting the IP address:
netsh int ip set dns â€ś<adapter name>â€ť static <IP address> | dhcpFor example, to give your Server Core system a preferred DNS server with an IP address of 10.50.50.4, youâ€™d type
netsh int ip set dns â€ślocal area connectionâ€ť static 10.50.50.4
To add subsequent DNS servers to search, youâ€™d use the syntax
netsh int ip add dns â€ś<adapter name>â€ť <IP address>No static keyword is necessary in this command; you canâ€™t tell your system to accept a statically assigned, preferred DNS address but then get the subsequent DNS server IP addresses from DHCP. So, for example, to tell your Server Core system to look to the DNS server at 10.50.50.1 when the DNS server at 10.50.50.4 doesnâ€™t respond, you would type
netsh int ip add dns â€ślocal area connectionâ€ť 10.50.50.1Assemble a Batch File
By now, youâ€™re pretty far along in the process of setting up your Server Core system. I recommend assembling a batch file that contains all your setup commandsâ€”it would be a great tool either for rebuilding after a disaster or building a test network that parallels your real network!