Edit

Share via


Load balance multiple SDN logical networks for Azure Local

Applies to: Azure Local 2311.2 and later

This article provides guidance on how to load balance multiple Software Defined Networking (SDN) logical networks for Azure Local. By using multiple logical networks for load balancing, you have more control over isolating workloads from each other.

For information about how to create and manage logical networks, see Manage tenant logical networks.

Prerequisites

Before you begin, make sure that the following prerequisites are completed:

Set up load balancing across multiple logical networks

Follow these steps to set up multiple SDN logical networks and add extra interfaces for load balancing using PowerShell:

  1. Create a new network adapter connected to the MUX to establish communication between the SLB MUX and the correct logical network. This adapter should have connectivity to the new logical network.

  2. Run the following command to define the VM and switch details:

    PowerShell
    $vm = Get-VM -Name'MUX_name'
    $switch = Get-VmSwitch -Name 'switch_name'
    
  3. Run the following command to stop the VM and add the adapter:

    PowerShell
    $vm | Stop-Vm
    $vnic = $vm | Add-VMNetworkAdapter -SwitchName $switch.Name -Name 'switch_name' -PassThru
    
  4. Run the following command to start the VM, which gives a dynamic MAC address:

    PowerShell
    $vm | Start-VM
    $FormattedMac = [regex]::matches($vnic.MacAddress.ToUpper().Replace(":","").Replace("-",""),'..').groups.value -join "-"
    
  5. Run the following command to stop the VM and configure the MAC address:

    PowerShell
    $vm | Stop-Vm
    $vnic | Set-VmNetworkAdapter -StaticMacAddress $FormattedMac
    
  6. Run the following command to set the port profile and VLAN information:

    PowerShell
    Set-SdnVMNetworkAdapterPortProfile -VMName $vm.Name -MacAddress $vnic.MacAddress -ProfileData2 -ProfileId $([Guid]::Empty)
    
    $vnic | Set-VMNetworkAdapterVLAN -Access -VLANID ####
    $vnic
    
  7. Run the following command to start the VM:

    PowerShell
    $vm | Start-Vm
    
  8. Run the following command to set the IP address within the MUX. MAC addresses are formatted with dashes within the guest OS. Find the correct MAC address that aligns with the output of step #4:

    PowerShell
    Get-NetAdapter
    
    $netAdapter = Get-NetAdapter | Where-Object {$_.MacAddress -eq 'MAC_address'}
    
    New-NetIPAddress -AddressFamilyIPv4 -InterfaceIndex $netAdapter.ifIndex -IPAddress 'IP_address' -PrefixLength 'prefix'
    

Troubleshoot

If you encounter any issues during setup, collect logs for troubleshooting purposes. For more information, see Collect logs for Software Defined Networking on Azure Local.

Next steps