From the course: Windows Server 2016: Installation and Configuration

Command-line IPv4 - Windows Server Tutorial

From the course: Windows Server 2016: Installation and Configuration

Start my 1-month free trial

Command-line IPv4

- When we went through the initial configuration in chapter one, we configured the network address using tools that are only available through the desktop. If you are taking advantage of the space and performance improvements of not installing the desktop experience, then you will need to do these initial configurations. And any continued management of the network settings from the command line. Let's review the actions that we need to be able to do and then we'll take a look at how to get them done. First, we need to be able to look at our configuration, we need to see where we're starting, and we need to have a way to verify it once it's done. Second, we'll need to switch between dynamic or automatic configuration and static or a manually assigned IP address. Third, we'll need to change our address, mask, and gateway. And finally we'll need to specify our name servers. And we'll need to do all of these from a command shell. So let's switch over to our server that does not have the desktop experience, let me log in and let's get to it. There are a few commands worth getting to know for network configuration. The most important of which are probably Ipconfig and netSH, let's take each one separately and look at the most common uses of these important commands. First let's look at Ipconfig, this is probably the most common command for looking up your current IP configuration. On our newly installed server, let's enter the command Ipconfig with the all switch and see what output it provides us. I'm going to scroll back up and we can see here the computer name that was assigned to us during the installation, we will probably be typing the computer name from time to time so it makes sense that we're going to want to change this up pretty soon. But we'll get to that before this chapter is over. For now let's focus on the network configuration. Down below, we see our network adapter, we see that it is currently configured to receive an address automatically from a DHCP server. And we can also see that in the absence of a DHCP server for now our server auto configured itself. These are the things that we need to change. I'm going to go ahead and clear the screen, before we get started with the netSH command. The netSH command is most commonly used to set your network configuration. Before we go making any changes, let's see for sure how Windows has identified our network cards and we can do that by using netSH interface to specify that we're looking at the IP version four interfaces and we want this command to show the interfaces. And this tells us the index number and the name of the network interfaces that are installed. Loopback being an interface that Windows uses internally. It's not the adapter we're looking for, this index number three named ethernet, that's the one we need to set, so if we want to change this interface to a static address that we've selected. The command would be, again netSH and specify that we're setting the interface for IP version four. The next thing we need to specify is that we are going to set the address after that we specify what adapter we want to set the address for. And the name can be either the index number or the text name of ethernet. They should both work equally well since three has fewer keystrokes than ethernet, I'm going with the shorter option for now. We need to specify that the source of the IP address from now on needs to be static. And we need to specify what that address is. In chapter one, we used a planning worksheet to organize the important information before doing these types of configurations. And we've selected to give it the IP configuration of 10.3.66.124, so I'm going to add that here. The address is 10.3.66.124 you can input the subnet mask as well. And finally the gateway. All three elements of the address, the address itself, the mask, and the gateway should be applied in this single command. Remember that there was one more thing that is important in an IP configuration and that is DNS or a name server. If you don't specify a name server, neither you nor the computer will ever be able to find anything on other computers. And you can assign a DNS server or two or more using a very similar command, it's netSH interface IP version four and we're going to add a DNS server, again specify which controller we're going to configure, we're going to add the address of our DNS server and we need to specify the priority of this DNS server. If you're only adding one DNS server, specifying an index of one may seem like a no-brainer. But if you're going to add additional DNS servers then each one needs to be assigned a value so that they have a priority that Windows will use when deciding who to ask for information. So you can run this command more than once if you need to add multiple DNS servers. And after you press enter, it will verify that DNS server before it adds it to the list. Now you may get this error message. Don't put too much stock in it. You can always test it using the ping command. And I'm going to ping the server that is the DNS server by name to see if it resolves and receives an IP address. And sure enough, it is, it resolved it to an IP address. So that was successful. We could now run Ipconfig again, let me clear the screen. And run Ipconfig with that all switch. And I can now see my network adapter with DHCP not enabled, my IP address assigned with all of the other details that we specified. In the next video we'll take a look at using these same commands to view and manage information in IPv6.

Contents