Add-SCVMNetworkGateway
将虚拟机网络网关添加到 VMM。
语法
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>]
说明
Add-SCVMNetworkGateway cmdlet 将虚拟机网络网关添加到 Virtual Machine Manager (VMM) 。
示例
示例 1:创建虚拟机网关
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"
第一个命令获取名为 ContosoNetworkGateway 的网络网关,然后将其存储在 $ContosoNetworkGateway 变量中。
第二个命令为 $ContosoNetworkGateway 中的网关创建虚拟机网关。
示例 2: (IPv6) 创建虚拟机网关
注意
此示例适用于 VMM 2019 UR2 及更高版本。
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"
第一个命令获取名为 ContosoNetworkGateway 的网络网关,然后将其存储在 $ContosoNetworkGateway 变量中。
第二个命令为 $ContosoNetworkGateway 中的网关创建虚拟机网关。
参数
-AutonomousSystemNumber
指定 ASN) (自治系统编号。
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
指定虚拟机网络网关的说明。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableBGP
指示是否启用边界网关协议 (BGP) 。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FabricRole
指定结构角色。
Type: | FabricRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定 VMM 对象的名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NetworkGateway
指定网络网关对象。
若要获取网络网关对象,请使用 Get-SCNetworkGateway cmdlet。
Type: | NetworkServiceBase |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUser
指定用户名。 此 cmdlet 代表此参数指定的用户运行。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OnBehalfOfUserRole
指定用户角色。 若要获取用户角色,请使用 Get-SCUserRole cmdlet。 此 cmdlet 代表此参数指定的用户角色运行。
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RequiresNAT
指示连接需要网络地址转换 (NAT) 。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RequiresVPN
指示需要虚拟专用网络 (VPN) 。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RoutingIPSubnet
指定虚拟机网关的路由 IP 子网。
注意
从 2019 UR2 及更高版本开始,可将 IPV4 和 IPV6 地址(用“;”分隔)传递给此参数。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业以异步方式运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMNetwork
指定虚拟机网络对象。
若要获取虚拟机网络对象,请使用 Get-SCVMNetwork cmdlet。
Type: | VMNetwork |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |