Monday, January 13, 2020

Extending Multiple VLANs over trunk interface to Windows Server

Physical setup:

A Microsoft windows server with two NICs connected to a Network switch. There is a requirement to extend multiple VLANs to the server.


Configure the network switch interfaces connected to the server as trunk ports. Trunk ports allow multiple VLANs to pass-through. Technically, All the packets passing through trunk ports must have an VlanID in the ethernet packet. the receiving switch decides where to forward the packet based on the VlanID tag. If any packet arrives without VlanID, it is considered as packet belonging to the VLAN marked as "Native VLAN". In cisco switches, "Vlan 1" is the default "Native VLAN".
Cisco Switch commands:

Interface Gig0/0/1
switchport trunk encapsulation dot1q
switchport mode trunk
Now create a Team of the both NICs in the server side. I will use Powershell commands for all the configuration in server side. All the teaming related commands come under Network Load balancing and Fail Over NetLbfo module of Powershell
This will list the server NICs which are to be teamed. Create a Team/Bond using the listed NICs named "LAN" :
New-NetLbfoTeam -Name "LAN" -TeamMembers NIC1, NIC2
Now create virtual NICs over the top of the teamed NIC for each VLAN. I am creating two VLANS , 10 and 11.
Add-NetLbfoTeamNic -Team LAN -VlanID 10 -Name LAN10
Add-NetLbfoTeamNic -Team LAN -VlanID 11 -Name LAN11
Now add IP addresses as required for the VLAN NICs :
New-NetIPAddress -InterfaceAlias "LAN10" -IPAddress -PrefixLength 24 -DefaultGateway
New-NetIPAddress -InterfaceAlias "LAN11" -IPAddress -PrefixLength 24 -DefaultGateway
That’s it. We have extended VLANs 10 and 11 to the server.

No comments:

Post a Comment