Monday, June 15, 2015

How to Setup NIC Teaming in Windows Server 2012 R2


NIC Teaming is a new feature in Windows Server 2012 that allows multiple network adapters to be aggregated for load balancing and failover. Let's take a brief look at NIC Teaming and walk through an example of how to set it up.

NIC Teaming Overview

There are two fundamental configurations for NIC Teaming:

Switch Independent: Switch independent mode does not require the network switch to participate in the teaming. No switch side configuration is required and network adapters can be connected to multiple switches to protect against loss of availability do to a failed NIC or failed network switch. Load balancing works relatively well and is easy to deploy in this mode.

Switch independent teaming interacts with the three available load balancing algorithms in the following ways:

  • Address Hash: Address Hash mode creates a hash based on outbound packet address components and distributes traffic across all the active network adapters in the team. Inbound traffic is limited to one adapter only.
  • Hyper-V Port: Hyper-V Port mode is particularly useful with servers running multiple virtual machines none of which requires more bandwidth than any single network adapter can provide. Outbound and inbound traffic to each virtual machine is handled by one of the active adapters based on the Hyper-V switch port the virtual machine is on.
  • Dynamic: Dynamic mode is new as of Windows Server 2012 R2. The Dynamic algorithm combines the best of the other two load balancing algorithms into one mode. Outbound traffic is hashed across the active team members and inbound traffic is handled like the Hyper-V Port mode.

Switch Dependent: Switch dependent mode requires the network switch to be specifically configured to participate in the NIC teaming. There are two switch dependent modes Static Teaming and Link Aggregation Control Protocol (LACP). Both modes allow the teamed adapters to approach the practical speed of all of the teamed adapters combined.

The switch dependent teaming algorithms work in the following ways:

  • Address Hash: Outbound traffic is hashed and distributed across the team. Inbound traffic is manged by the network switch.
  • Hyper-V Port: The inbound load balancing is determined by the switch. Outbound traffic is determined by the Hyper-V switch port.
  • Dynamic: Again, the best of both worlds and the best algorithm for switch dependent NIC teaming in Server 2012 R2

For a more in depth explanation of NIC teaming, I urge you to read Microsoft's Windows Server 2012 R2 NIC Teaming (LBFO) Deployment and Management guide.



Setting Up NIC Teaming

We're going to take a look at setting up a LACP switch dependent NIC team with a Cisco network switch. In this example the network switch is a stack of two Cisco Catalyst 2960s.

Open Server Manger by clicking on the Server Manager icon on the task bar.


Click on Local Server.




Under the properties for the local server, click on the link Disabled next to NIC Teaming.




Click the Tasks drop down for Teams and select New Team.




Enter the Team name and check the boxes of the network adapters you want to include in the team. Expand the Additional properties, set Teaming mode to LACP and Load balancing mode to Dynamic.

Click the Primary team interface link.




Set the VLAN for the new teamed interface. This is highly dependent on how the rest of your system is configured. Leaving this set to Default works for this example. Click OK.




Click OK.




The new NIC team is configured. If you haven't already configured the switch, now's the time.




There should be a new network adapter under Network Connections that represents the new NIC team and can be managed much like any other network adapter.

Here's snippets of the relevant parts of  the configuration for a two switch stack of Cisco Catalyst 2960s using four network adapters.

!
interface Port-channel2
description Server NIC Team
switchport access vlan 100
switchport mode access


!
interface GigabitEthernet1/0/1
description Server NIC Team - Nic 1
switchport access vlan 100
switchport mode access
speed 1000
spanning-tree portfast
channel-group 2 mode active


!
interface GigabitEthernet1/0/3
description Server NIC Team  - Nic 2
switchport access vlan 100
switchport mode access
speed 1000
spanning-tree portfast
channel-group 2 mode active


!
interface GigabitEthernet2/0/1
description Server NIC Team  - Nic 3
switchport access vlan 100
switchport mode access
speed 1000
spanning-tree portfast
channel-group 2 mode active


!
interface GigabitEthernet2/0/3
description Server NIC Team  - Nic 4
switchport access vlan 100
switchport mode access
speed 1000
spanning-tree portfast
channel-group 2 mode active

Once both the switch and Windows Server are configured the new NIC team should be working as expected. Enjoy!

10 comments:

  1. Before setting up NIC teaming, do the participating NICs need to have valid IP addresses or can we leave them without IP configured and then set up the team with them?

    ReplyDelete
    Replies
    1. Nope. I'm not sure any of them need IP's, but I've only done it with one active, addressed, NIC.

      Delete
  2. Would the switch configuration be different if the teaming mode was static?

    ReplyDelete
    Replies
    1. I believe so. I've never used the static mode, but the switch configuration posted above sets up a Cisco port channel which uses LACP (Link Aggregation Control Protocol). I assume that using a port channel on a Cisco switch requires the Windows Server NIC team to be in LACP mode.

      Delete
    2. Yes, if you use mode static, then on cisco side switch portchannel mode would also change. Current switch interface is configured with LACP with command "channel-group 2 mode active", we will need to change that to static as well by command "channel-group 2 mode on". Regards, Harsh

      Delete
  3. I want to set up a NIC teaming on a CCTV Server. The scenario is that
    - there are 2 nos of D-Link Layer-2 Switches.
    - there are 12 cameras connected to each switch.
    - there are 2 GbE NIC on the Server Machine using Windows Server 2012 R2.
    - I want one NIC to connect to Switch#1 and one NIC to connect to Switch#2.
    - even if a Switch fails, the Server is still recording 12 cameras.

    Kindly advise.

    ReplyDelete
  4. i have done the same configuration..but there is no any difference in data flow speed (inbound and outbound). Although in my network adaptor setting status...i can see speed of 3Gbps.

    ReplyDelete
  5. Thanks, this is a very clear explanation of NIC teaming. I'm trying to get my MCSE cert and I needed to get the concept clear in my head. This app showed me that I was weak in this area - https://play.google.com/store/apps/details?id=com.abians.exam70_410&referrer=utm_source%3D9

    ReplyDelete