你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzNetworkCloudNetworkAttachmentObject
为 NetworkAttachment 创建内存中对象。
语法
New-AzNetworkCloudNetworkAttachmentObject
-AttachedNetworkId <String>
-IPAllocationMethod <VirtualMachineIPAllocationMethod>
[-DefaultGateway <DefaultGateway>]
[-Ipv4Address <String>]
[-Ipv6Address <String>]
[-Name <String>]
[<CommonParameters>]
说明
为 NetworkAttachment 创建内存中对象。
示例
示例 1:为 NetworkAttachment 创建内存中对象。
New-AzNetworkCloudNetworkAttachmentObject -AttachedNetworkId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName" -IPAllocationMethod "Dynamic" -DefaultGateway "True" -Ipv4Address "198.51.100.1" -Ipv6Address "2001:0db8:0000:0000:0000:0000:0000:0001" -Name "netAttachName01"
AttachedNetworkId DefaultGateway IPAllocationMethod Ipv4Address Ipv6Address
----------------- -------------- ------------------ ----------- -----------
/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName True Dynamic 198.51.100.1 2001:0db8:0000:0000:0000:0000…
为 NetworkAttachment 创建内存中对象。
参数
-AttachedNetworkId
附加到虚拟机的关联网络的资源 ID。 它可以是 cloudServicesNetwork、l3Network、l2Network 或 trunkedNetwork 资源之一。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-DefaultGateway
指示这是否为默认网关。 单个计算机的附加网络(包括 CloudServicesNetwork 附件)只能指定为 True。
类型: | DefaultGateway |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-IPAllocationMethod
虚拟机的 IP 分配机制。 动态和静态仅适用于 l3Network,也可能指定“已禁用”。 否则,Disabled 是唯一允许的值。
类型: | VirtualMachineIPAllocationMethod |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Ipv4Address
虚拟机的 IPv4 地址。
This field is used only if the attached network has IPAllocationType of IPV4 or DualStack.
If IPAllocationMethod is:
Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network.
Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network.
Disabled - this field will be empty.
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Ipv6Address
虚拟机的 IPv6 地址。
This field is used only if the attached network has IPAllocationType of IPV6 or DualStack.
If IPAllocationMethod is:
Static - this field must contain an IPv6 address range from within the range specified in the attached network.
Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network.
Disabled - this field will be empty.
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
关联的网络的接口名称。 如果指定,则网络附件名称的最大长度为 15 个字符,并且必须对此虚拟机是唯一的。 如果用户未指定此值,将使用网络资源的默认接口名称。 对于 CloudServicesNetwork 资源,将忽略此名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |