diff --git a/azure/services/scalesets/scalesets.go b/azure/services/scalesets/scalesets.go index e94425da0c2..c26e2aff411 100644 --- a/azure/services/scalesets/scalesets.go +++ b/azure/services/scalesets/scalesets.go @@ -594,10 +594,13 @@ func (s *Service) getVirtualMachineScaleSetNetworkConfiguration(vmssSpec azure.S nicConfig := compute.VirtualMachineScaleSetNetworkConfiguration{} nicConfig.VirtualMachineScaleSetNetworkConfigurationProperties = &compute.VirtualMachineScaleSetNetworkConfigurationProperties{} nicConfig.Name = pointer.String(vmssSpec.Name + "-nic-" + strconv.Itoa(i)) - if pointer.BoolDeref(n.AcceleratedNetworking, false) { - nicConfig.VirtualMachineScaleSetNetworkConfigurationProperties.EnableAcceleratedNetworking = pointer.Bool(true) + nicConfig.EnableIPForwarding = pointer.Bool(true) + if n.AcceleratedNetworking != nil { + nicConfig.VirtualMachineScaleSetNetworkConfigurationProperties.EnableAcceleratedNetworking = n.AcceleratedNetworking } else { - nicConfig.VirtualMachineScaleSetNetworkConfigurationProperties.EnableAcceleratedNetworking = pointer.Bool(false) + // If AcceleratedNetworking is not specified, use the value from the VMSS spec. + // It will be set to true if the VMSS SKU supports it. + nicConfig.VirtualMachineScaleSetNetworkConfigurationProperties.EnableAcceleratedNetworking = vmssSpec.AcceleratedNetworking } // Create IPConfigs