Add-SCVMNetworkGateway

Adds a virtual machine network gateway to VMM.

Syntax

Add-SCVMNetworkGateway
   [-VMMServer <ServerConnection>]
   -VMNetwork <VMNetwork>
   [-RequiresVPN]
   [-RequiresNAT]
   [-EnableBGP <Boolean>]
   [-AutonomousSystemNumber <UInt32>]
   -Name <String>
   [-Description <String>]
   [-RoutingIPSubnet <String>]
   [-FabricRole <FabricRole>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]
Add-SCVMNetworkGateway
   [-VMMServer <ServerConnection>]
   -VMNetwork <VMNetwork>
   -NetworkGateway <NetworkServiceBase>
   [-EnableBGP <Boolean>]
   [-AutonomousSystemNumber <UInt32>]
   -Name <String>
   [-Description <String>]
   [-RoutingIPSubnet <String>]
   [-FabricRole <FabricRole>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-OnBehalfOfUser <String>]
   [-OnBehalfOfUserRole <UserRole>]
   [<CommonParameters>]

Description

The Add-SCVMNetworkGateway cmdlet adds a virtual machine network gateway to Virtual Machine Manager (VMM).

Examples

Example 1: Create a virtual machine network gateway

PS C:\> $ContosoNetworkGateway = Get-SCNetworkGateway -Name "ContosoNetworkGateway"
PS C:\> $VmNetworkGateway = Add-SCVMNetworkGateway -Name "VMNetworkGateway" -EnableBGP $True -NetworkGateway $ContosoNetworkGateway -VMNetwork $VmNetwork -AutonomousSystemNumber "1000" -RoutingIPSubnet "10.251.251.0/29"

The first command gets a network gateway named ContosoNetworkGateway, and then stores it in the $ContosoNetworkGateway variable.

The second command creates a virtual machine network gateway for the gateway in $ContosoNetworkGateway.

Example 2: Create a virtual machine network gateway (IPv6)

Note

This example is applicable from VMM 2019 UR2 and later.

PS C:\> $ContosoNetworkGateway = Get-SCNetworkGateway -Name "ContosoNetworkGateway"
PS C:\> $VmNetworkGateway = Add-SCVMNetworkGateway -Name "VMNetworkGateway" -EnableBGP $True -NetworkGateway $ContosoNetworkGateway -VMNetwork $VmNetwork -AutonomousSystemNumber "1000" -RoutingIPSubnet "10.251.251.0;FD4A:293D:184F:382C::/64"

The first command gets a network gateway named ContosoNetworkGateway, and then stores it in the $ContosoNetworkGateway variable.

The second command creates a virtual machine network gateway for the gateway in $ContosoNetworkGateway.

Parameters

-AutonomousSystemNumber

Specifies an Autonomous System Number (ASN).

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

Specifies a description for the virtual machine network gateway.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableBGP

Indicates whether Border Gateway Protocol (BGP) is enabled.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FabricRole

Specifies a fabric role.

Type:FabricRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of a VMM object.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkGateway

Specifies a network gateway object.

To obtain a network gateway object, use the Get-SCNetworkGateway cmdlet.

Type:NetworkServiceBase
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RequiresNAT

Indicates that the connection requires network address translation (NAT).

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RequiresVPN

Indicates that a virtual private network (VPN) is required.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RoutingIPSubnet

Specifies a routing IP subnet for a virtual machine network gateway.

Note

From 2019 UR2 and later, IPV4 and IPV6 address separated by ‘;’ can be passed to this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VMNetwork

Specifies a virtual machine network object.

To get a virtual machine network object, use the Get-SCVMNetwork cmdlet.

Type:VMNetwork
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False