Posts by Tags

Gateway

Creating a Gateway Router on Windows Server 2016 Core

Created: May 09, 2017 2 minute read

I seem to spin up a lot of Virtual Labs. To make sure my lab doesn’t interfere with the rest of my network, and to simulate a larger enterprise environment you should use a virtual router.

I normally use pfSense as my virtual router of choice, but decided recently to create a router on Windows Server 2016 Core.

This isn’t the first time I’ve installed or used Windows Server Core - in a previous lab I have used it for a DC but I haven’t had much experience with it. This is the first time I’ve used Windows Server for a router let alone on Core.

Assumptions:

  • You’ve configured your Virtual Switches with one connected to your host’s network and at least one private\internal network
  • You’ve created the virtual machine with the associated NICs attached
  • You’ve installed Windows Server 2016 Core selecting the none GUI option

Setting up the server

  1. On first boot you’ll be presented with a prompt asking to configure the Administrator password.

    FirstBoot

  2. We’ll be doing most of the work in Powershell so we need to launch it.

    > Powershell.exe
    

    FirstBoot

  3. First lets name the computer (ignore the prompt about rebooting, we’ll do this after configuring the machine).

    > Rename-Computer -NewName GW
    
  4. We now want to rename the network adaptors, but to do this, we first need to find out the current names. Use the output from this to double check the MAC addresses with the NICs inside your virtualization software.

    > Get-NetIPConfiguration
    

    GetNetIPConfig

  5. We then want to rename the adaptors using Rename-NetAdaptor. Using the -Name switch to pass the current names that we found in the previous step. Then use Get-NetIPConfiguration again to confirm.

    > Rename-NetAdapter -Name Ethernet -NewName External
    > Rename-NetAdapter -Name "Ethernet 2" -NewName Internal
    > Get-NetIPConfiguration
    

    RenameNetAdaptor

  6. Next we’ll configure and validate the internal network adaptors IP details, DNS Addresses, and disable IPv6 for both adaptors. I’m setting my DNS addresses to 172.0.0.10 as this will be my DC, and 192.168.1.254 as this is my external router.

    > New-NetIPAddress -InterfaceAlias Internal -IPAddress 172.0.0.1 -PrefixLength 24
    > Set-DnsClientServerAddress -InterfaceAlias Internal -ServerAddresses 172.0.0.10, 192.168.1.1
    > Disable-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetIPConfiguration
    > Test-NetConnection
    

    SetAdaptorSettings

  7. The last step is to reboot the computer.

    > Restart-Computer
    

Installing and configuring the Gateway

  1. After boot, login, and launch Powershell.
  2. First, we need to enable a firewall rule used by routing.

    > Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"
    
  3. Next, we need to install the Routing Windows Feature, plus the management tools and then reboot the computer.

    > Install-WindowsFeature Routing -IncludeAllSubFeature -IncludeManagementTools
    > Restart-Computer
    

    InstallFeature

  4. Once rebooted, re-login and launch Powershell to install the router.

    > Install-RemoteAccess -VpnType Vpn
    

    InstallRemoteAccess

  5. We now need to enter a NETSH session.

    > NETSH
    
  6. The final step is to add some routing rules, were going to add the two interfaces, and configure the external mode.

    > routing ip nat add interface External
    > routing ip nat set interface External mode=full
    > routing ip nat add interface Internal
    

    NETSH

Validation

We can validate the config by creating a second VM with or without a GUI. Configuring the IP address inside the 172.0.0.0/24 range with a default gateway of the GW we’ve just configured (172.0.0.1), and the DNS address of your external router. We then use the the Test-NetConnection Powershell command to confirm external access.

ConfigInternet

Thats it, you should have now configured a Virtual Router on Windows Server 2016 Core. Let me know how it goes!

Thanks to the 2012 Core Survival Guide and Deployment Researches guides on setting up a virtual router and setting up a virtual router using powershell.

General

Welcome!

Created: May 03, 2017 less than 1 minute read

I’ve finally decided to make a blog where I can share my techy thoughts and provide some tutorials. I keep having to figure out how to do some awesome, but equally challenging things, and have found that help doesn’t seem to exist in a simple and concise way! Everyone works differently and I think that it would be useful if I share some of my ideas with the community.

I’m a SQL DBA by trade, so, expect my posts to mostly be about: SQL, Powershell and Microsoft technologies. However, I do use a Mac as my main machine outside of work so they could swing that way as well. Whatever is piquing my interest!

When looking at a blogging platforms I decided to go with a Jekyll based website hosted on GitHub Pages, and I used it as an excuse to finally learn GitHub since I use SVN at work.

It’s also been a good excuse to use VSCode for the first time, and so far, I’m loving it!

Anyway… Welcome!

PowerShell

Quick Tip: Multi-line editing in PowerShell ISE!

Created: May 17, 2017 less than 1 minute read

A friend showed me this tip the other day. It’s really useful for adding multi-line comments in PowerShell ISE. It can also be used for typing the same thing on multiple lines.

  1. While holding alt and Shift press the up or down arrows to select multiple lines.
  2. Add your desired text.

ISE Multi Line Commenting

Powershell

Creating a Gateway Router on Windows Server 2016 Core

Created: May 09, 2017 2 minute read

I seem to spin up a lot of Virtual Labs. To make sure my lab doesn’t interfere with the rest of my network, and to simulate a larger enterprise environment you should use a virtual router.

I normally use pfSense as my virtual router of choice, but decided recently to create a router on Windows Server 2016 Core.

This isn’t the first time I’ve installed or used Windows Server Core - in a previous lab I have used it for a DC but I haven’t had much experience with it. This is the first time I’ve used Windows Server for a router let alone on Core.

Assumptions:

  • You’ve configured your Virtual Switches with one connected to your host’s network and at least one private\internal network
  • You’ve created the virtual machine with the associated NICs attached
  • You’ve installed Windows Server 2016 Core selecting the none GUI option

Setting up the server

  1. On first boot you’ll be presented with a prompt asking to configure the Administrator password.

    FirstBoot

  2. We’ll be doing most of the work in Powershell so we need to launch it.

    > Powershell.exe
    

    FirstBoot

  3. First lets name the computer (ignore the prompt about rebooting, we’ll do this after configuring the machine).

    > Rename-Computer -NewName GW
    
  4. We now want to rename the network adaptors, but to do this, we first need to find out the current names. Use the output from this to double check the MAC addresses with the NICs inside your virtualization software.

    > Get-NetIPConfiguration
    

    GetNetIPConfig

  5. We then want to rename the adaptors using Rename-NetAdaptor. Using the -Name switch to pass the current names that we found in the previous step. Then use Get-NetIPConfiguration again to confirm.

    > Rename-NetAdapter -Name Ethernet -NewName External
    > Rename-NetAdapter -Name "Ethernet 2" -NewName Internal
    > Get-NetIPConfiguration
    

    RenameNetAdaptor

  6. Next we’ll configure and validate the internal network adaptors IP details, DNS Addresses, and disable IPv6 for both adaptors. I’m setting my DNS addresses to 172.0.0.10 as this will be my DC, and 192.168.1.254 as this is my external router.

    > New-NetIPAddress -InterfaceAlias Internal -IPAddress 172.0.0.1 -PrefixLength 24
    > Set-DnsClientServerAddress -InterfaceAlias Internal -ServerAddresses 172.0.0.10, 192.168.1.1
    > Disable-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetIPConfiguration
    > Test-NetConnection
    

    SetAdaptorSettings

  7. The last step is to reboot the computer.

    > Restart-Computer
    

Installing and configuring the Gateway

  1. After boot, login, and launch Powershell.
  2. First, we need to enable a firewall rule used by routing.

    > Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"
    
  3. Next, we need to install the Routing Windows Feature, plus the management tools and then reboot the computer.

    > Install-WindowsFeature Routing -IncludeAllSubFeature -IncludeManagementTools
    > Restart-Computer
    

    InstallFeature

  4. Once rebooted, re-login and launch Powershell to install the router.

    > Install-RemoteAccess -VpnType Vpn
    

    InstallRemoteAccess

  5. We now need to enter a NETSH session.

    > NETSH
    
  6. The final step is to add some routing rules, were going to add the two interfaces, and configure the external mode.

    > routing ip nat add interface External
    > routing ip nat set interface External mode=full
    > routing ip nat add interface Internal
    

    NETSH

Validation

We can validate the config by creating a second VM with or without a GUI. Configuring the IP address inside the 172.0.0.0/24 range with a default gateway of the GW we’ve just configured (172.0.0.1), and the DNS address of your external router. We then use the the Test-NetConnection Powershell command to confirm external access.

ConfigInternet

Thats it, you should have now configured a Virtual Router on Windows Server 2016 Core. Let me know how it goes!

Thanks to the 2012 Core Survival Guide and Deployment Researches guides on setting up a virtual router and setting up a virtual router using powershell.

Powershell ISE

Quick Tip: Multi-line editing in PowerShell ISE!

Created: May 17, 2017 less than 1 minute read

A friend showed me this tip the other day. It’s really useful for adding multi-line comments in PowerShell ISE. It can also be used for typing the same thing on multiple lines.

  1. While holding alt and Shift press the up or down arrows to select multiple lines.
  2. Add your desired text.

ISE Multi Line Commenting

Quick Tip

Quick Tip: Multi-line editing in PowerShell ISE!

Created: May 17, 2017 less than 1 minute read

A friend showed me this tip the other day. It’s really useful for adding multi-line comments in PowerShell ISE. It can also be used for typing the same thing on multiple lines.

  1. While holding alt and Shift press the up or down arrows to select multiple lines.
  2. Add your desired text.

ISE Multi Line Commenting

Routing

Creating a Gateway Router on Windows Server 2016 Core

Created: May 09, 2017 2 minute read

I seem to spin up a lot of Virtual Labs. To make sure my lab doesn’t interfere with the rest of my network, and to simulate a larger enterprise environment you should use a virtual router.

I normally use pfSense as my virtual router of choice, but decided recently to create a router on Windows Server 2016 Core.

This isn’t the first time I’ve installed or used Windows Server Core - in a previous lab I have used it for a DC but I haven’t had much experience with it. This is the first time I’ve used Windows Server for a router let alone on Core.

Assumptions:

  • You’ve configured your Virtual Switches with one connected to your host’s network and at least one private\internal network
  • You’ve created the virtual machine with the associated NICs attached
  • You’ve installed Windows Server 2016 Core selecting the none GUI option

Setting up the server

  1. On first boot you’ll be presented with a prompt asking to configure the Administrator password.

    FirstBoot

  2. We’ll be doing most of the work in Powershell so we need to launch it.

    > Powershell.exe
    

    FirstBoot

  3. First lets name the computer (ignore the prompt about rebooting, we’ll do this after configuring the machine).

    > Rename-Computer -NewName GW
    
  4. We now want to rename the network adaptors, but to do this, we first need to find out the current names. Use the output from this to double check the MAC addresses with the NICs inside your virtualization software.

    > Get-NetIPConfiguration
    

    GetNetIPConfig

  5. We then want to rename the adaptors using Rename-NetAdaptor. Using the -Name switch to pass the current names that we found in the previous step. Then use Get-NetIPConfiguration again to confirm.

    > Rename-NetAdapter -Name Ethernet -NewName External
    > Rename-NetAdapter -Name "Ethernet 2" -NewName Internal
    > Get-NetIPConfiguration
    

    RenameNetAdaptor

  6. Next we’ll configure and validate the internal network adaptors IP details, DNS Addresses, and disable IPv6 for both adaptors. I’m setting my DNS addresses to 172.0.0.10 as this will be my DC, and 192.168.1.254 as this is my external router.

    > New-NetIPAddress -InterfaceAlias Internal -IPAddress 172.0.0.1 -PrefixLength 24
    > Set-DnsClientServerAddress -InterfaceAlias Internal -ServerAddresses 172.0.0.10, 192.168.1.1
    > Disable-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetIPConfiguration
    > Test-NetConnection
    

    SetAdaptorSettings

  7. The last step is to reboot the computer.

    > Restart-Computer
    

Installing and configuring the Gateway

  1. After boot, login, and launch Powershell.
  2. First, we need to enable a firewall rule used by routing.

    > Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"
    
  3. Next, we need to install the Routing Windows Feature, plus the management tools and then reboot the computer.

    > Install-WindowsFeature Routing -IncludeAllSubFeature -IncludeManagementTools
    > Restart-Computer
    

    InstallFeature

  4. Once rebooted, re-login and launch Powershell to install the router.

    > Install-RemoteAccess -VpnType Vpn
    

    InstallRemoteAccess

  5. We now need to enter a NETSH session.

    > NETSH
    
  6. The final step is to add some routing rules, were going to add the two interfaces, and configure the external mode.

    > routing ip nat add interface External
    > routing ip nat set interface External mode=full
    > routing ip nat add interface Internal
    

    NETSH

Validation

We can validate the config by creating a second VM with or without a GUI. Configuring the IP address inside the 172.0.0.0/24 range with a default gateway of the GW we’ve just configured (172.0.0.1), and the DNS address of your external router. We then use the the Test-NetConnection Powershell command to confirm external access.

ConfigInternet

Thats it, you should have now configured a Virtual Router on Windows Server 2016 Core. Let me know how it goes!

Thanks to the 2012 Core Survival Guide and Deployment Researches guides on setting up a virtual router and setting up a virtual router using powershell.

Server Core

Creating a Gateway Router on Windows Server 2016 Core

Created: May 09, 2017 2 minute read

I seem to spin up a lot of Virtual Labs. To make sure my lab doesn’t interfere with the rest of my network, and to simulate a larger enterprise environment you should use a virtual router.

I normally use pfSense as my virtual router of choice, but decided recently to create a router on Windows Server 2016 Core.

This isn’t the first time I’ve installed or used Windows Server Core - in a previous lab I have used it for a DC but I haven’t had much experience with it. This is the first time I’ve used Windows Server for a router let alone on Core.

Assumptions:

  • You’ve configured your Virtual Switches with one connected to your host’s network and at least one private\internal network
  • You’ve created the virtual machine with the associated NICs attached
  • You’ve installed Windows Server 2016 Core selecting the none GUI option

Setting up the server

  1. On first boot you’ll be presented with a prompt asking to configure the Administrator password.

    FirstBoot

  2. We’ll be doing most of the work in Powershell so we need to launch it.

    > Powershell.exe
    

    FirstBoot

  3. First lets name the computer (ignore the prompt about rebooting, we’ll do this after configuring the machine).

    > Rename-Computer -NewName GW
    
  4. We now want to rename the network adaptors, but to do this, we first need to find out the current names. Use the output from this to double check the MAC addresses with the NICs inside your virtualization software.

    > Get-NetIPConfiguration
    

    GetNetIPConfig

  5. We then want to rename the adaptors using Rename-NetAdaptor. Using the -Name switch to pass the current names that we found in the previous step. Then use Get-NetIPConfiguration again to confirm.

    > Rename-NetAdapter -Name Ethernet -NewName External
    > Rename-NetAdapter -Name "Ethernet 2" -NewName Internal
    > Get-NetIPConfiguration
    

    RenameNetAdaptor

  6. Next we’ll configure and validate the internal network adaptors IP details, DNS Addresses, and disable IPv6 for both adaptors. I’m setting my DNS addresses to 172.0.0.10 as this will be my DC, and 192.168.1.254 as this is my external router.

    > New-NetIPAddress -InterfaceAlias Internal -IPAddress 172.0.0.1 -PrefixLength 24
    > Set-DnsClientServerAddress -InterfaceAlias Internal -ServerAddresses 172.0.0.10, 192.168.1.1
    > Disable-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetIPConfiguration
    > Test-NetConnection
    

    SetAdaptorSettings

  7. The last step is to reboot the computer.

    > Restart-Computer
    

Installing and configuring the Gateway

  1. After boot, login, and launch Powershell.
  2. First, we need to enable a firewall rule used by routing.

    > Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"
    
  3. Next, we need to install the Routing Windows Feature, plus the management tools and then reboot the computer.

    > Install-WindowsFeature Routing -IncludeAllSubFeature -IncludeManagementTools
    > Restart-Computer
    

    InstallFeature

  4. Once rebooted, re-login and launch Powershell to install the router.

    > Install-RemoteAccess -VpnType Vpn
    

    InstallRemoteAccess

  5. We now need to enter a NETSH session.

    > NETSH
    
  6. The final step is to add some routing rules, were going to add the two interfaces, and configure the external mode.

    > routing ip nat add interface External
    > routing ip nat set interface External mode=full
    > routing ip nat add interface Internal
    

    NETSH

Validation

We can validate the config by creating a second VM with or without a GUI. Configuring the IP address inside the 172.0.0.0/24 range with a default gateway of the GW we’ve just configured (172.0.0.1), and the DNS address of your external router. We then use the the Test-NetConnection Powershell command to confirm external access.

ConfigInternet

Thats it, you should have now configured a Virtual Router on Windows Server 2016 Core. Let me know how it goes!

Thanks to the 2012 Core Survival Guide and Deployment Researches guides on setting up a virtual router and setting up a virtual router using powershell.

Windows Server 2016

Creating a Gateway Router on Windows Server 2016 Core

Created: May 09, 2017 2 minute read

I seem to spin up a lot of Virtual Labs. To make sure my lab doesn’t interfere with the rest of my network, and to simulate a larger enterprise environment you should use a virtual router.

I normally use pfSense as my virtual router of choice, but decided recently to create a router on Windows Server 2016 Core.

This isn’t the first time I’ve installed or used Windows Server Core - in a previous lab I have used it for a DC but I haven’t had much experience with it. This is the first time I’ve used Windows Server for a router let alone on Core.

Assumptions:

  • You’ve configured your Virtual Switches with one connected to your host’s network and at least one private\internal network
  • You’ve created the virtual machine with the associated NICs attached
  • You’ve installed Windows Server 2016 Core selecting the none GUI option

Setting up the server

  1. On first boot you’ll be presented with a prompt asking to configure the Administrator password.

    FirstBoot

  2. We’ll be doing most of the work in Powershell so we need to launch it.

    > Powershell.exe
    

    FirstBoot

  3. First lets name the computer (ignore the prompt about rebooting, we’ll do this after configuring the machine).

    > Rename-Computer -NewName GW
    
  4. We now want to rename the network adaptors, but to do this, we first need to find out the current names. Use the output from this to double check the MAC addresses with the NICs inside your virtualization software.

    > Get-NetIPConfiguration
    

    GetNetIPConfig

  5. We then want to rename the adaptors using Rename-NetAdaptor. Using the -Name switch to pass the current names that we found in the previous step. Then use Get-NetIPConfiguration again to confirm.

    > Rename-NetAdapter -Name Ethernet -NewName External
    > Rename-NetAdapter -Name "Ethernet 2" -NewName Internal
    > Get-NetIPConfiguration
    

    RenameNetAdaptor

  6. Next we’ll configure and validate the internal network adaptors IP details, DNS Addresses, and disable IPv6 for both adaptors. I’m setting my DNS addresses to 172.0.0.10 as this will be my DC, and 192.168.1.254 as this is my external router.

    > New-NetIPAddress -InterfaceAlias Internal -IPAddress 172.0.0.1 -PrefixLength 24
    > Set-DnsClientServerAddress -InterfaceAlias Internal -ServerAddresses 172.0.0.10, 192.168.1.1
    > Disable-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetAdaptorBinding -Name Internal, External -ComponentID ms_tcpip6
    > Get-NetIPConfiguration
    > Test-NetConnection
    

    SetAdaptorSettings

  7. The last step is to reboot the computer.

    > Restart-Computer
    

Installing and configuring the Gateway

  1. After boot, login, and launch Powershell.
  2. First, we need to enable a firewall rule used by routing.

    > Enable-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)"
    
  3. Next, we need to install the Routing Windows Feature, plus the management tools and then reboot the computer.

    > Install-WindowsFeature Routing -IncludeAllSubFeature -IncludeManagementTools
    > Restart-Computer
    

    InstallFeature

  4. Once rebooted, re-login and launch Powershell to install the router.

    > Install-RemoteAccess -VpnType Vpn
    

    InstallRemoteAccess

  5. We now need to enter a NETSH session.

    > NETSH
    
  6. The final step is to add some routing rules, were going to add the two interfaces, and configure the external mode.

    > routing ip nat add interface External
    > routing ip nat set interface External mode=full
    > routing ip nat add interface Internal
    

    NETSH

Validation

We can validate the config by creating a second VM with or without a GUI. Configuring the IP address inside the 172.0.0.0/24 range with a default gateway of the GW we’ve just configured (172.0.0.1), and the DNS address of your external router. We then use the the Test-NetConnection Powershell command to confirm external access.

ConfigInternet

Thats it, you should have now configured a Virtual Router on Windows Server 2016 Core. Let me know how it goes!

Thanks to the 2012 Core Survival Guide and Deployment Researches guides on setting up a virtual router and setting up a virtual router using powershell.