SkillPilotAI

PowerShell NetLbfo module

NIC teaming (LBFO = Load Balancing and FailOver) combines several network adapters into one team with one IP, so traffic is spread across links and survives a cable or NIC failure. The NetLbfo module creates, inspects, changes and removes teams, members and VLAN team interfaces.

230.1 What it does, where it runs

  • Built into Windows 10/11 and Windows Server; PowerShell 5.1 and 7.
  • The module has 13 cmdlets; New/Add/Set/Remove change adapters and need Administrator.
  • On the office PC only Get-Command and Get-Help ran; the rest is from the Microsoft Learn docs (no sample output on those pages).
  • From Windows Server 2022 the Hyper-V virtual switch cannot be bound to an LBFO team: use Switch Embedded Teaming (SET).
PowerShell
Get-Command -Module NetLbfo | Measure-ObjectGet-Help New-NetLbfoTeam
Output
PS> Get-Command -Module NetLbfo | Measure-ObjectCount    : 13PS> Get-Help New-NetLbfoTeamName       : New-NetLbfoTeamModuleName : NetLbfoSynopsis   :New-NetLbfoTeam [-Name] <string> [-TeamMembers] <WildcardPattern[]> [[-TeamNicName] <string>][[-TeamingMode] <TeamingModes>] [[-LoadBalancingAlgorithm] <LBAlgos>] [[-LacpTimer] <LacpTimers>][-CimSession <CimSession[]>] [-ThrottleLimit <int>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]

230.2 How it works: load balancing and failover

Team1 = NIC1 + NIC2: load balancing
  1. 1.Server has NIC1 and NIC2; New-NetLbfoTeam makes Team1 with one IP 192.168.10.20

  2. 2.SwitchIndependent: no switch config, members can sit on different switches

  3. 3.Stream 1: NIC1 -> Switch 1 -> core switch -> client 192.168.10.50

  4. 4.Dynamic algorithm sends stream 2 via NIC2 -> Switch 2

  5. 5.Stream 2 also crosses the core switch to the client

NIC1 fails: failover to NIC2
  1. 1.NIC1 cable pulled, link goes down

  2. 2.Team detects the failure

  3. 3.NIC1's traffic moves to NIC2

  4. 4.Stream goes NIC2 -> Switch 2 -> core switch -> client without a break

  5. 5.A Standby member (AdministrativeMode Standby) becomes Active automatically

230.3 New-NetLbfoTeam (9)

OptionValuesMeaning
-Namestring (required)Team name
-TeamMembers"NIC1","NIC2" (required, wildcard OK)Member adapters
-TeamNicNamestringName of the team interface
-TeamingModeSwitchIndependent | Static | LacpRole of the switch: SwitchIndependent needs no switch config; Static/Lacp need switch config
-LoadBalancingAlgorithmDynamic | TransportPorts | IPAddresses | MacAddresses | HyperVPortHow traffic is spread across members
-LacpTimerSlow | FastLACP PDU interval
PowerShell
# Example (docs), admin only, NOT run here:New-NetLbfoTeam -Name "Team1" `  -TeamMembers "NIC1","NIC2" `  -TeamingMode LACP `  -LoadBalancingAlgorithm HyperVPortAdd-NetLbfoTeamNIC -Team "Team1" -VlanID 42Get-NetLbfoTeamMember -Team "Team1"# Team inside a VM (on the host, admin):Set-VMNetworkAdapter -VMName <VMname> `  -AllowTeaming On
  • Teaming adapters of different speeds is not supported.
  • Common parameters: -AsJob, -CimSession (remote), -ThrottleLimit; -Confirm/-WhatIf only on cmdlets that change something, not on Get.

230.4 Get cmdlets

  • Get-NetLbfoTeam (7): -Name (pattern like T*), -MemberOfTheTeam, -TeamNicForTheTeam.
  • Get-NetLbfoTeamMember (6): no parameter = all members of all teams; -Team or -TeamOfTheMember for one team.
  • Get-NetLbfoTeamNic (5): team interfaces; -Name "*VLAN*" -Team "T*" finds VLAN interfaces.
PowerShell
Get-NetLbfoTeam -Name Team1Get-NetLbfoTeamMember NIC1 | Get-NetLbfoTeamGet-NetLbfoTeamNic "Team1 - VLAN 42" |  Get-NetLbfoTeamGet-NetLbfoTeam -Name "Team1" |  Get-NetLbfoTeamMemberGet-NetLbfoTeamNic -Name "*VLAN*" -Team "T*"

230.5 Add, Set and Rename

  • Add-NetLbfoTeamMember (6): -AdministrativeMode Active (default) or Standby; at most one Standby member per team.
  • Add-NetLbfoTeamNic (4): extra team interface for one VLAN; -VlanID 0..4094 (0 also matches untagged); name = team + VLAN, e.g. "Team1 - VLAN 42".
  • Set-NetLbfoTeam (11): change -TeamingMode, -LoadBalancingAlgorithm, -LacpTimer.
  • Set-NetLbfoTeamMember (7): change role; Standby is used only on failover.
  • Set-NetLbfoTeamNic (9): change -VlanID; -Default works only on the interface created with the team.
  • Rename-NetLbfoTeam (4): -Name, -NewName; default-named team interfaces are renamed too (the docs example has a stray space after 'Rename').
PowerShell
Add-NetLbfoTeamMember -Name "NIC2" `  -Team "Team2" -AdministrativeMode StandbyAdd-NetLbfoTeamMember -Name "NIC*" `  -Team "Team1"Set-NetLbfoTeam -Name "Team1" `  -TeamingMode LACP `  -LoadBalancingAlgorithm HyperVPortSet-NetLbfoTeamMember -Name "NIC4" `  -AdministrativeMode StandbySet-NetLbfoTeamNIC -Name "Team1 - VlanID 42" `  -VlanID 15Rename-NetLbfoTeam -Name "Team1" `  -NewName "TeamA"

230.6 Remove cmdlets

CmdletRemovesLimitation
Remove-NetLbfoTeam (6)Whole team, disconnects all membersGet-NetLbfoTeam | Remove-NetLbfoTeam removes EVERY team on the server
Remove-NetLbfoTeamMember (5)One or more membersCannot remove the last member; remove the team instead
Remove-NetLbfoTeamNic (5)An extra VLAN interfaceThe primary interface goes only with the team
PowerShell
Remove-NetLbfoTeam -Name Team1$team = Get-NetLbfoTeam -Name Team1Remove-NetLbfoTeam -InputObject $teamRemove-NetLbfoTeamMember -Name "NIC1" `  -Team "Team1"Remove-NetLbfoTeamNIC -Team "Team1 - VLAN 42"

230.7 Linux equivalent: bonding

  • On Linux teaming is called bonding and it is a kernel driver module.
  • In the lab bonding was not loaded, CONFIG_BONDING=m and NET_TEAM not built; ip link add type bond was NOT run because it would auto-load the module.
Terminal
grep -E "^(bonding|team)" /proc/moduleszcat /proc/config.gz | grep -E \  "BONDING|NET_TEAM"ls /sys/class/net/bonding_masters
Output
$ grep -E "^(bonding|team)" /proc/modules(exit 1)$ zcat /proc/config.gz | grep -E "BONDING|NET_TEAM"CONFIG_BONDING=m# CONFIG_NET_TEAM is not set$ ls /sys/class/net/bonding_mastersls: /sys/class/net/bonding_masters: No such file or directory
Bonding modeNo.BehaviourWindows parallel
balance-rr (default)0Round-robin: load balancing + failover-
active-backup1Only one active member, failoverActive + Standby member
balance-xor2Member chosen by hashAddress hash algorithms
broadcast3Transmit on all members-
802.3ad4LACP, needs switch supportTeamingMode Lacp
balance-tlb5Transmit load balancing, no switch configSwitchIndependent
balance-alb6tlb + receive load balancing (ARP)SwitchIndependent
Terminal
# Syntax (kernel docs), NOT run here:modprobe bonding mode=balance-alb miimon=100ip link set eth0 master bond0ip link set eth1 master bond0

230.8 Common mistakes

  • Expecting a 2 x 1 Gbps team to give one download 2 Gbps: same hash = one member, so a single stream uses one NIC's speed.
  • Trying to remove the last member with Remove-NetLbfoTeamMember; use Remove-NetLbfoTeam.
  • Binding a Hyper-V vSwitch to LBFO on Server 2022+; use SET.
  • Choosing Static/Lacp without configuring the switch, or mixing adapters of different speeds.

230.9 Interview tips

  • NIC teaming on Windows Server: New-NetLbfoTeam -Name -TeamMembers -TeamingMode -LoadBalancingAlgorithm, verify with Get-NetLbfoTeamMember.
  • SwitchIndependent needs no switch config; Static and Lacp need switch config.
  • Hyper-V host: SET (Switch Embedded Teaming), not LBFO, from Windows Server 2022.
  • Teaming increases total capacity and gives failover, not more speed for one stream.
  • Linux: bonding driver modes (active-backup, 802.3ad, balance-alb...).