Virtual Lab – Adapter Setup

This is part of a series where I set up a virtual lab for testing and misc. work. The other parts in the series are here: Building a Virtual Lab with Hyper-V.

Once I had the machine up and running, I knew I needed to get the networking setup. One of the things I’ll do is do some clustering tests, and for that, I need to have static IP addresses. I’m an older, IPv4 guy, so that’s what I’ll use here.

I decided to put all my machines in the 192.168.1.x space. I’ll use these addresses:

  • DenverDC – 192.168.1.200
  • Broncos – 192.168.1.201
  • Nuggets – 192.168.1.202
  • Rockies – 192.168.1.203
  • Avalanche – 192.168.1.204

I’ll deal with the client machine when I get there. For now this is what I need to worry about.

The machines are set up and passwords changed. I now need to start them and get networking configured. I googled and found this TechNet article on using PowerShell to configure a NIC. There’s also the Configure a Core Server. I know you can use sconfig to do this easily, but I wanted to see how hard it is in PoSh. In the Standard edition, it’s easy to use the GUI as well.

First I needed to know what adapters I have. I ran

Get-NetAdapter

This told me my main adapter was “Ethernet 2”. So I ran this:

$netadapter = Get-NetAdapter -Name “Ethernet 2”

The first step is to remove DHCP. You’d do this by changing a radio button on the adapter settings. In this case, we do it with PowerShell.

$netadapter | Set-NetIPInterface -DHCP Disabled

Next we want to set up our IP address. In my case, I’m going to use the 10.10.10 address space.

$netadapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress 192.168.1.200 -PrefixLength 24 -Type Unicast -DefaultGateway 192.168.1.1

Once that is done, we can then look at DNS. In this case, I’m going to point it to my gateway, which doesn’t really resolve to anything (yet).

Set-DnsClientServerAddress -InterfaceAlias “Ethernet 2” -ServerAddresses 192.168.1.200

I repeat this for all my servers, getting them all set up with their proper IP addresses. Once I’m done, I have 5 servers running with the IPs above.

However none of them can ping each other. That’s strange, but not unexpected. The mindset to increase security by default is likely to blame. I don’t know what the exploits that can come through ping (DOS I guess), but I know more and more companies avoid allowing ping responses.

Turn off the firewall

I decide that I need to turn off the firewall to check. Since I have 2 Standard installations and 4 Core installations, I go to the Standard ones first and use the GUI to kill the firewall for my networks. It was at this point that I realized that by default my connections saw the network as public connections, not private.

I turn off the public connection firewall and pings work from one of the Core servers. Then I turn that on and disable the private firewall. Pings fail.

Now I know what to do. First, I use a security change in the GUI to set my Server with the Local Security Policy app in Windows. Once this is done, I set things to private, disable that firewall and verify pings work. I know this works, and now I’m ready to change the other servers.

I find a script on MSDN Blogs that shows me how to do this in PoSh. It’s a strange script, and it doesn’t give any results, but it seemed to work.

$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]”{DCB00C01-570F-4A9B-8D69-199FDBA5723B}”))
$connections = $networkListManager.GetNetworkConnections()
# Set network location to Private for all networks
$connections | % {$_.GetNetwork().SetCategory(1)}

Once I ran this, I then needed to turn off the firewall. I found this link and then ran this command.

netsh advfirewall set private state off

virtlab_ab

That worked, and then you can see my ping worked.

virtlab_ac

The top image above is from the machine I was working on. The bottom one shows the ping failing from my SQL machine to the DC, and then working once I’d disabled the firewall for the private network.

Update: I originally wanted to work in the 10.x.x.x space, but I kept confusing myself, so I moved all the machines to the 192.168.1.x network.

Rinse, repeat for all machines. Eventually I have every machine pinging every other machine and able to connect.

Networking working.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , , , , . Bookmark the permalink.

6 Responses to Virtual Lab – Adapter Setup

  1. I want to to thank you for this excellent read!!
    I absolutely loved every bit of it. I have you saved as a favorite to check out new stuff you post…

    Like

  2. I was wondering if you ever considered changing the page layout of your website?
    Its very well written; I love what youve got to
    say. But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having one or 2 pictures.
    Maybe you could space it out better?

    Like

    • way0utwest says:

      I’m not sure what you mean? Spacing the text out? How much more space would you want? PIctures aren’t necessarily much of what I do here, as I’m writing about topics and using code in there. Perhaps your browser isn’t rendering it well?

      Like

  3. www says:

    What’s up to every one, the contents existing at this website are in fact remarkable for
    people experience, well, keep up the good work fellows.

    Like

  4. Spot on with this write-up, I seriously believe that this web site needs far more
    attention. I’ll probably be returning to read through more, thanks for
    the info!

    Like

Comments are closed.