Set-AzVirtualNetworkGateway
가상 네트워크 게이트웨이를 업데이트합니다.
구문
Set-AzVirtualNetworkGateway
-VirtualNetworkGateway <PSVirtualNetworkGateway>
[-GatewaySku <String>]
[-GatewayDefaultSite <PSLocalNetworkGateway>]
[-VpnClientAddressPool <String[]>]
[-VpnClientProtocol <String[]>]
[-VpnAuthenticationType <String[]>]
[-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>]
[-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
[-Asn <UInt32>]
[-PeerWeight <Int32>]
[-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>]
[-EnableActiveActiveFeature]
[-EnablePrivateIpAddress <Boolean>]
[-DisableActiveActiveFeature]
[-RadiusServerAddress <String>]
[-RadiusServerSecret <SecureString>]
[-RadiusServerList <PSRadiusServer[]>]
[-AadTenantUri <String>]
[-AadAudienceId <String>]
[-AadIssuerUri <String>]
[-RemoveAadAuthentication]
[-CustomRoute <String[]>]
[-NatRule <PSVirtualNetworkGatewayNatRule[]>]
[-BgpRouteTranslationForNat <Boolean>]
[-MinScaleUnit <Int32>]
[-MaxScaleUnit <Int32>]
[-VirtualNetworkGatewayPolicyGroup <PSVirtualNetworkGatewayPolicyGroup[]>]
[-ClientConnectionConfiguration <PSClientConnectionConfiguration[]>]
[-AdminState <String>]
[-AllowRemoteVnetTraffic <Boolean>]
[-AllowVirtualWanTraffic <Boolean>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[-ResiliencyModel <String>]
[<CommonParameters>]
Set-AzVirtualNetworkGateway
-VirtualNetworkGateway <PSVirtualNetworkGateway>
[-GatewaySku <String>]
[-GatewayDefaultSite <PSLocalNetworkGateway>]
[-VpnClientAddressPool <String[]>]
[-VpnClientProtocol <String[]>]
[-VpnAuthenticationType <String[]>]
[-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>]
[-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
[-Asn <UInt32>]
[-PeerWeight <Int32>]
[-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>]
[-EnableActiveActiveFeature]
[-EnablePrivateIpAddress <Boolean>]
[-DisableActiveActiveFeature]
[-RadiusServerAddress <String>]
[-RadiusServerSecret <SecureString>]
[-RadiusServerList <PSRadiusServer[]>]
[-AadTenantUri <String>]
[-AadAudienceId <String>]
[-AadIssuerUri <String>]
[-RemoveAadAuthentication]
[-CustomRoute <String[]>]
[-NatRule <PSVirtualNetworkGatewayNatRule[]>]
[-BgpRouteTranslationForNat <Boolean>]
[-MinScaleUnit <Int32>]
[-MaxScaleUnit <Int32>]
[-VirtualNetworkGatewayPolicyGroup <PSVirtualNetworkGatewayPolicyGroup[]>]
[-ClientConnectionConfiguration <PSClientConnectionConfiguration[]>]
[-AdminState <String>]
[-AllowRemoteVnetTraffic <Boolean>]
[-AllowVirtualWanTraffic <Boolean>]
-Tag <Hashtable>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[-ResiliencyModel <String>]
[<CommonParameters>]
Description
Set-AzVirtualNetworkGateway cmdlet은 가상 네트워크 게이트웨이를 업데이트합니다.
예제
예제 1: 가상 네트워크 게이트웨이의 ASN 업데이트
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -Asn 1337
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway이라는 변수에 저장합니다. 두 번째 명령은 변수 $Gateway 저장된 가상 네트워크 게이트웨이를 업데이트합니다. 또한 이 명령은 ASN을 1337로 설정합니다.
예제 2: 가상 네트워크 게이트웨이에 IPsec 정책 추가
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$vpnclientipsecpolicy = New-AzVpnClientIpsecPolicy -IpsecEncryption AES256 -IpsecIntegrity SHA256 -SALifeTime 86472 -SADataSize 429497 -IkeEncryption AES256 -IkeIntegrity SHA256 -DhGroup DHGroup2 -PfsGroup None
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientIpsecPolicy $vpnclientipsecpolicy
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway이라는 변수에 저장합니다. 두 번째 명령은 지정된 ipsec 매개 변수에 따라 Vpn ipsec 정책 개체를 만듭니다. 세 번째 명령은 변수 $Gateway 저장된 가상 네트워크 게이트웨이를 업데이트합니다. 또한 이 명령은 가상 네트워크 게이트웨이의 $vpnclientipsecpolicy 개체에 지정된 사용자 지정 vpn ipsec 정책을 설정합니다.
예제 3: 기존 가상 네트워크 게이트웨이에 태그 추가/업데이트
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -Tag @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }
Name : Gateway001
ResourceGroupName : ResourceGroup001
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
Name Value
============ ============
testtagValue SomeKeyValue
testtagKey SomeTagKey
IpConfigurations : [
{
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/GatewaySubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/Gateway001Ip"
},
"Name": "vng1ipConfig",
"Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/Gateway001IpConfig"
}
]
GatewayType : Vpn
VpnType : RouteBased
EnableBgp : False
ActiveActive : False
GatewayDefaultSite : null
Sku : {
"Capacity": 2,
"Name": "VpnGw1",
"Tier": "VpnGw1"
}
VpnClientConfiguration : null
BgpSettings : {
"Asn": 65515,
"BgpPeeringAddress": "1.2.3.4",
"PeerWeight": 0
}
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway이라는 변수에 저장합니다. 두 번째 명령은 @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }태그로 가상 네트워크 게이트웨이 Gateway01을 업데이트합니다.
예제 4: 기존 가상 네트워크 게이트웨이의 VpnClient에 대한 AAD 인증 구성 추가/업데이트
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -AadTenantUri "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuerUri "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudienceId "a21fce82-76af-45e6-8583-a08cb3b956f9"
Name : Gateway001
ResourceGroupName : ResourceGroup001
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
Name Value
============ ============
testtagValue SomeKeyValue
testtagKey SomeTagKey
IpConfigurations : [
{
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/GatewaySubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/Gateway001Ip"
},
"Name": "vng1ipConfig",
"Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/Gateway001IpConfig"
}
]
GatewayType : Vpn
VpnType : RouteBased
EnableBgp : False
ActiveActive : False
GatewayDefaultSite : null
Sku : {
"Capacity": 2,
"Name": "VpnGw1",
"Tier": "VpnGw1"
}
vpnClientConfiguration : {
"vpnClientProtocols": [
"OpenVPN"
],
"vpnClientAddressPool": {
"addressPrefixes": [
"101.10.0.0/16"
]
},
"vpnClientRootCertificates": "",
"vpnClientRevokedCertificates": "",
"radiusServerAddress": "",
"radiusServerSecret": "",
"aadTenantUri": "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4\",
"aadAudienceId": "a21fce82-76af-45e6-8583-a08cb3b956g9\",
"aadIssuerUri": "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/\"
},
BgpSettings : {
"Asn": 65515,
"BgpPeeringAddress": "1.2.3.4",
"PeerWeight": 0
}
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientRootCertificates $rootCert -RemoveAadAuthentication
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway이라는 변수에 저장합니다. 두 번째 명령은 AAD 인증 구성 params:aadTenantUri, aadAudienceId, aadIssuerUri for VpnClient를 사용하여 가상 네트워크 게이트웨이 Gateway01을 업데이트합니다. 세 번째 명령은 가상 네트워크 게이트웨이의 VpnClient에서 AAD 인증 구성을 제거합니다.
예제 5: 기존 가상 네트워크 게이트웨이에 IpConfigurationBgpPeeringAddresses 추가/업데이트
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$ipconfigurationId1 = '/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default'
$addresslist1 = @('169.254.21.25')
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -IpConfigurationBgpPeeringAddresses $gw1ipconfBgp1
Name : Gateway001
ResourceGroupName : ResourceGroup001
Location : westcentralus
Id : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState : Succeeded
Tags :
IpConfigurations : [
{
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
},
"Name": "default",
"Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
}
]
GatewayType : Vpn
VpnType : RouteBased
EnableBgp : False
ActiveActive : False
GatewayDefaultSite : null
Sku : {
"Capacity": 2,
"Name": "VpnGw1",
"Tier": "VpnGw1"
}
VpnClientConfiguration : null
BgpSettings : {
"Asn": 65515,
"BgpPeeringAddress": "10.1.255.30",
"PeerWeight": 0,
"BgpPeeringAddresses": [
{
"IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
"DefaultBgpIpAddresses": [
"10.1.255.30"
],
"CustomBgpIpAddresses": [
"169.254.21.55"
],
"TunnelIpAddresses": [
"13.78.146.151"
]
}
]
}
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway 두 번째 명령은 가상 네트워크 게이트웨이 Gateway01 IpConfiguration ID의 값을 변수 ipconfigurationId1에 할당하는 변수에 저장합니다. 세 번째 명령은 주소 목록을 addresslist1에 할당합니다. 네 번째 명령은 PSIpConfigurationBgpPeeringAddress 개체를 만들었습니다. 다섯 번째 명령은 새로 만든 PSIpConfigurationBgpPeeringAddress를 IpConfigurationBgpPeeringAddresses로 설정하고 게이트웨이를 업데이트합니다.
예제 6: 가상 네트워크 게이트웨이의 기존 IpConfigurationBgpPeeringAddresses에 대한 CustomAddress 업데이트/제거
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$ipconfigurationId1 = '/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default'
$addresslist1 = @()
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -IpConfigurationBgpPeeringAddresses $gw1ipconfBgp1
Name : Gateway001
ResourceGroupName : ResourceGroup001
Location : westcentralus
Id : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState : Succeeded
Tags :
IpConfigurations : [
{
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
},
"Name": "default",
"Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
}
]
GatewayType : Vpn
VpnType : RouteBased
EnableBgp : False
ActiveActive : False
GatewayDefaultSite : null
Sku : {
"Capacity": 2,
"Name": "VpnGw1",
"Tier": "VpnGw1"
}
VpnClientConfiguration : null
BgpSettings : {
"Asn": 65515,
"BgpPeeringAddress": "10.1.255.30",
"PeerWeight": 0,
"BgpPeeringAddresses": [
{
"IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
"DefaultBgpIpAddresses": [
"10.1.255.30"
],
"CustomBgpIpAddresses": [],
"TunnelIpAddresses": [
"13.78.146.151"
]
}
]
}
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway 두 번째 명령은 가상 네트워크 게이트웨이 Gateway01 IpConfiguration ID의 값을 변수 ipconfigurationId1에 할당하는 변수에 저장합니다. 세 번째 명령은 주소 목록을 addresslist1에 할당합니다. 네 번째 명령은 PSIpConfigurationBgpPeeringAddress 개체를 만들었습니다. 다섯 번째 명령은 새로 만든 PSIpConfigurationBgpPeeringAddress를 IpConfigurationBgpPeeringAddresses로 설정하고 게이트웨이를 업데이트합니다.
예제 7: 기존 가상 네트워크 게이트웨이에 NatRules 추가/업데이트
$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$vngNatRules = $Gateway.NatRules
$natRule = New-AzVirtualNetworkGatewayNatRule -Name "natRule1" -Type "Static" -Mode "IngressSnat" -InternalMapping @("25.0.0.0/16") -ExternalMapping @("30.0.0.0/16")
$vngNatRules.Add($natrule)
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -NatRule $vngNatRules.NatRules -BgpRouteTranslationForNat $true
Name : Gateway001
ResourceGroupName : ResourceGroup001
Location : westcentralus
Id : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState : Succeeded
Tags :
IpConfigurations : [
{
"PrivateIpAllocationMethod": "Dynamic",
"Subnet": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
},
"PublicIpAddress": {
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
},
"Name": "default",
"Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
}
]
GatewayType : Vpn
VpnType : RouteBased
EnableBgp : False
ActiveActive : False
GatewayDefaultSite : null
Sku : {
"Capacity": 2,
"Name": "VpnGw1",
"Tier": "VpnGw1"
}
VpnClientConfiguration : null
BgpSettings : {
"Asn": 65515,
"BgpPeeringAddress": "10.1.255.30",
"PeerWeight": 0,
"BgpPeeringAddresses": [
{
"IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
"DefaultBgpIpAddresses": [
"10.1.255.30"
],
"CustomBgpIpAddresses": [
"169.254.21.55"
],
"TunnelIpAddresses": [
"13.78.146.151"
]
}
]
}
NatRules : [
{
"VirtualNetworkGatewayNatRulePropertiesType": "Static",
"Mode": "IngressSnat",
"InternalMappings": [
{
"AddressSpace": "25.0.0.0/16"
}
],
"ExternalMappings": [
{
"AddressSpace": "30.0.0.0/16"
}
],
"ProvisioningState": "Succeeded",
"Name": "natRule1",
"Etag": "W/\"5150d788-e165-42ba-99c4-8138a545fce9\"",
"Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/natRules/natRule1"
}
]
EnableBgpRouteTranslationForNat : True
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져오고 $Gateway이라는 변수에 저장합니다. 두 번째 명령은 기존 natrules를 변수 vngNatRules에 할당합니다. 세 번째 명령은 새로 만든 PSVirtualNetworkGatewayNatRule 개체 natrule 값을 변수 natRule에 할당합니다. 네 번째 명령은 이 PSVirtualNetworkGatewayNatRule 개체를 vngNatRules 목록에 추가합니다. 다섯 번째 명령은 새로 만든 PSVirtualNetworkGatewayNatRule을 게이트웨이의 NatRules로 설정하고 게이트웨이를 업데이트합니다.
예제 8: 기존 가상 네트워크 게이트웨이의 만료된 여러 VpnClientRootCertificates 삭제
$Gateway=Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$rootCerts=$Gateway.VpnClientConfiguration.VpnClientRootCertificates
$rootCerts.Count
$rootCerts[0]
$rootCerts[1]
$rootCerts.Remove($rootCerts[1])
$Gateway1 = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientRootCertificates $rootCerts
첫 번째 명령은 리소스 그룹 ResourceGroup001에 속하는 Gateway01이라는 가상 네트워크 게이트웨이를 가져와서 $Gateway이라는 변수에 저장합니다. 두 번째 명령은 VirtualNetworkGateway의 모든 루트 인증서를 가져와서 다른 변수에 저장합니다$rootCerts 세 번째 명령은 VirtualNetworkGateway의 총 기존 루트 인증서를 표시합니다. 다음 & 다섯 번째 명령은 고객이 삭제하려는 인증서를 확인하기 위해 해당 인덱스에 루트 인증서를 인쇄합니다. 여섯 번째 명령은 해당 인덱스(예: 여기 1)를 사용하여 만료된 루트 인증서를 제거합니다. 동일한 단계를 반복하여 변수에서 만료된 여러 인증서를 제거합니다. $rootCerts 일곱 번째 명령은 VirtualNetworkGateway를 업데이트하여 유효한 루트 인증서(예: 변수에 있는 인증서)를 설정합니다. $rootCerts
예제 9: Virtual Wan 네트워크의 다른 ExpressRoute 가상 네트워크 게이트웨이와 ExpressRoute를 통한 통신을 허용하도록 ExpressRoute 가상 네트워크 게이트웨이를 구성합니다.
# Option 1 - Retrieve the gateway object, modify the property and save the changes.
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowVirtualWanTraffic = $true
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway
# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowVirtualWanTraffic $true
두 경우 모두 첫 번째 명령은 게이트웨이를 검색합니다. 그런 다음 개체에서 직접 속성을 수정하고 유지하거나 Set-AzVirtualNetworkGateway cmdlet에서 스위치를 사용할 수 있습니다.
예제 10: Virtual Wan 네트워크의 다른 ExpressRoute 가상 네트워크 게이트웨이와의 ExpressRoute 통신을 차단하도록 ExpressRoute 가상 네트워크 게이트웨이를 구성합니다.
# Option 1 - Retrieve the gateway object, modify the property and save the changes.
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowVirtualWanTraffic = $false
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway
# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowVirtualWanTraffic $false
두 경우 모두 첫 번째 명령은 게이트웨이를 검색합니다. 그런 다음 개체에서 직접 속성을 수정하고 유지하거나 Set-AzVirtualNetworkGateway cmdlet에서 스위치를 사용할 수 있습니다.
예제 11: ExpressRoute 가상 네트워크 게이트웨이를 구성하여 다른 VNet의 다른 ExpressRoute 가상 네트워크 게이트웨이와 ExpressRoute를 통한 통신을 허용합니다.
# Option 1 - Retrieve the gateway object, modify the property and save the changes.
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowRemoteVnetTraffic = $true
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway
# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowRemoteVnetTraffic $true
두 경우 모두 첫 번째 명령은 게이트웨이를 검색합니다. 그런 다음 개체에서 직접 속성을 수정하고 유지하거나 Set-AzVirtualNetworkGateway cmdlet에서 스위치를 사용할 수 있습니다.
예제 12: ExpressRoute 가상 네트워크 게이트웨이를 구성하여 다른 VNet의 다른 가상 네트워크 게이트웨이와의 ExpressRoute 통신을 차단합니다.
# Option 1 - Retrieve the gateway object, modify the property and save the changes.
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowRemoteVnetTraffic = $false
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway
# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowRemoteVnetTraffic $false
두 경우 모두 첫 번째 명령은 게이트웨이를 검색합니다. 그런 다음 개체에서 직접 속성을 수정하고 유지하거나 Set-AzVirtualNetworkGateway cmdlet에서 스위치를 사용할 수 있습니다.
매개 변수
-AadAudienceId
P2S AAD 인증 옵션:AadAudienceId.
형식: | String |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-AadIssuerUri
P2S AAD 인증 옵션:AadIssuerUri.
형식: | String |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-AadTenantUri
P2S AAD 인증 옵션:AadTenantUri.
형식: | String |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-AdminState
Vnet에 여러 Express Route Gateway가 있을 때 Express Route Gateway가 트래픽을 제공하는지 여부를 나타내는 속성: 사용/사용 안 함
형식: | String |
허용되는 값: | Enabled, Disabled |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-AllowRemoteVnetTraffic
이 게이트웨이가 다른 VNet의 트래픽을 수락해야 하는지 여부를 결정합니다.
형식: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-AllowVirtualWanTraffic
이 게이트웨이가 다른 Virtual WAN 네트워크의 트래픽을 수락해야 하는지 여부를 결정합니다.
형식: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-AsJob
백그라운드에서 cmdlet 실행
형식: | SwitchParameter |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-Asn
IPsec 터널 내에서 BGP 세션을 설정하는 데 사용되는 가상 네트워크 게이트웨이의 ASN
형식: | UInt32 |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-BgpRouteTranslationForNat
이렇게 하면 이 VirtualNetworkGateway에서 BgpRouteTranslationForNat를 사용하도록 설정하고 사용하지 않도록 설정합니다.
형식: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-ClientConnectionConfiguration
주소와 정책 그룹 간에 분석하는 P2S 클라이언트 연결 구성
형식: | PSClientConnectionConfiguration[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-Confirm
cmdlet을 실행하기 전에 확인 메시지를 표시합니다.
형식: | SwitchParameter |
별칭: | cf |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-CustomRoute
고객이 지정한 사용자 지정 경로 AddressPool
형식: | String[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-DefaultProfile
Azure와의 통신에 사용되는 자격 증명, 계정, 테넌트 및 구독입니다.
형식: | IAzureContextContainer |
별칭: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-DisableActiveActiveFeature
가상 네트워크 게이트웨이에서 활성 활성 기능을 사용하지 않도록 설정하는 플래그
형식: | SwitchParameter |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-EnableActiveActiveFeature
가상 네트워크 게이트웨이에서 활성 활성 기능을 사용하도록 설정하는 플래그
형식: | SwitchParameter |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-EnablePrivateIpAddress
가상 네트워크 게이트웨이에서 활성 활성 기능을 사용하도록 설정하는 플래그
형식: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-GatewayDefaultSite
강제 터널링에 사용할 기본 사이트입니다. 기본 사이트를 지정하면 게이트웨이의 vnet에서 모든 인터넷 트래픽이 해당 사이트로 라우팅됩니다.
형식: | PSLocalNetworkGateway |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-GatewaySku
가상 네트워크 게이트웨이의 SKU
형식: | String |
허용되는 값: | Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw4, VpnGw5, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, VpnGw4AZ, VpnGw5AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ, ErGwScale |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-IpConfigurationBgpPeeringAddresses
가상 네트워크 게이트웨이 bgpsettings에 대한 BgpPeeringAddresses입니다.
형식: | PSIpConfigurationBgpPeeringAddress[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-MaxScaleUnit
확장 가능한 게이트웨이에 대한 최대 배율 단위 설정
형식: | Int32 |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-MinScaleUnit
확장 가능한 게이트웨이에 대한 최소 배율 단위 설정
형식: | Int32 |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-NatRule
가상 네트워크 게이트웨이용 NatRules입니다.
형식: | PSVirtualNetworkGatewayNatRule[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-PeerWeight
이 가상 네트워크 게이트웨이에서 BGP를 통해 학습된 경로에 추가된 가중치
형식: | Int32 |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-RadiusServerAddress
P2S 외부 반지름 서버 주소입니다.
형식: | String |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-RadiusServerList
P2S 여러 외부 반지름 서버.
형식: | PSRadiusServer[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-RadiusServerSecret
P2S 외부 반지름 서버 암호입니다.
형식: | SecureString |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-RemoveAadAuthentication
가상 네트워크 게이트웨이에서 P2S 클라이언트에 대한 AAD 인증을 제거하는 플래그입니다.
형식: | SwitchParameter |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-ResiliencyModel
Express Route Gateway에서 복원력 모델을 나타내는 속성: SingleHomed/MultiHomed
형식: | String |
허용되는 값: | SingleHomed, MultiHomed |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-Tag
P2S 외부 반지름 서버 주소입니다.
형식: | Hashtable |
Position: | Named |
Default value: | None |
필수: | True |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-VirtualNetworkGateway
기본 수정을 해제할 가상 네트워크 게이트웨이 개체입니다. Get-AzVirtualNetworkGateway 사용하여 검색할 수 있습니다.
형식: | PSVirtualNetworkGateway |
Position: | Named |
Default value: | None |
필수: | True |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VirtualNetworkGatewayPolicyGroup
이 게이트웨이에 추가된 P2S 정책 그룹
형식: | PSVirtualNetworkGatewayPolicyGroup[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VpnAuthenticationType
P2S VPN 클라이언트 인증 유형의 목록입니다.
형식: | String[] |
허용되는 값: | Certificate, Radius, AAD |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VpnClientAddressPool
VPN 클라이언트 IP 주소를 할당할 주소 공간입니다. 가상 네트워크 또는 온-프레미스 범위와 겹치지 않아야 합니다.
형식: | String[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VpnClientIpsecPolicy
P2S VPN 클라이언트 터널링 프로토콜에 대한 IPSec 정책 목록입니다.
형식: | PSIpsecPolicy[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VpnClientProtocol
P2S VPN 클라이언트 터널링 프로토콜 목록
형식: | String[] |
허용되는 값: | SSTP, IkeV2, OpenVPN |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VpnClientRevokedCertificates
해지된 VPN 클라이언트 인증서 목록입니다. 이 중 하나와 일치하는 인증서를 제공하는 VPN 클라이언트는 사라지라는 지시를 받게 됩니다.
형식: | PSVpnClientRevokedCertificate[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-VpnClientRootCertificates
VPN 클라이언트 인증에 사용할 VPN 클라이언트 루트 인증서 목록입니다. VPN 클라이언트를 연결하려면 이러한 루트 인증서 중 하나에서 생성된 인증서가 있어야 합니다.
형식: | PSVpnClientRootCertificate[] |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-WhatIf
cmdlet이 실행되면 어떻게 되는지 보여 주세요. cmdlet이 실행되지 않습니다.
형식: | SwitchParameter |
별칭: | wi |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
입력
String[]
출력
Azure PowerShell