Add-SCNATConnection
添加 NAT 连接。
语法
Add-SCNATConnection
[-VMMServer <ServerConnection>]
[-VMNetworkGateway] <VMNetworkGateway>
[-Name <String>]
[-Description <String>]
[-MaximumBandwidthInboundKbps <UInt64>]
[-MaximumBandwidthOutboundKbps <UInt64>]
[-ExternalIPPool <StaticIPAddressPool>]
[-ExternalIPAddress <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
Add-SCNATConnection
[-VMMServer <ServerConnection>]
[-VMNetwork] <VMNetwork>
[-Name <String>]
[-Description <String>]
[-MaximumBandwidthInboundKbps <UInt64>]
[-MaximumBandwidthOutboundKbps <UInt64>]
[-ExternalIPPool <StaticIPAddressPool>]
[-ExternalIPAddress <String>]
[-PublicIPAddress <AllocatedIPAddress>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-OnBehalfOfUser <String>]
[-OnBehalfOfUserRole <UserRole>]
[<CommonParameters>]
说明
Add-SCNATConnection cmdlet (NAT) 连接添加网络地址转换。
示例
示例 1:使用外部 IP 将 NAT 连接添加到虚拟机网络
PS C:\> $VmNetwork = Get-SCVMNetwork -Name "NAT_VmNetwork"
PS C:\> $IpPool = Get-SCStaticIPAddressPool -Name "Private_IPPool"
PS C:\> Add-SCNATConnection -Name "NatConnection" -VMNetwork $VmNetwork -ExternalIPPool $IpPool
第一个命令按其名称获取虚拟机网络,并将其存储在$VmNetwork变量中。
第二个命令根据用于提供专用/公共 VIP 的逻辑网络的名称获取 IP 池,并将其存储在$IpPool变量中。
第三个命令使用名称 NatConnection 将 NAT 连接添加到虚拟机网络$VmNetwork,其中包含来自$IpPool的 IP。
参数
-Description
指定 NAT 连接的说明。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExternalIPAddress
指定外部 IP 地址。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ExternalIPPool
指定外部 IP 池。
Type: | StaticIPAddressPool |
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 |
-MaximumBandwidthInboundKbps
指定 kbps 的最大入站带宽。
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MaximumBandwidthOutboundKbps
指定 kbps 的最大出站带宽。
Type: | UInt64 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定网络对象的名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
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 |
-PublicIPAddress
指定分配的 IP 地址对象。
Type: | AllocatedIPAddress |
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
指定 Virtual Machine Manager (VMM) 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VMNetwork
指定 VMNetwork 对象。
Type: | VMNetwork |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMNetworkGateway
指定虚拟机网络网关对象。
若要获取 VMNetworkGateway 对象,请使用 Get-SCVMNetworkGateway cmdlet。
Type: | VMNetworkGateway |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |