Set-AzVirtualNetworkGatewayConnection
Configura una conexión de puerta de enlace de red virtual.
Sintaxis
Set-AzVirtualNetworkGatewayConnection
-VirtualNetworkGatewayConnection <PSVirtualNetworkGatewayConnection>
[-EnableBgp <Boolean>]
[-DpdTimeoutInSeconds <Int32>]
[-ConnectionMode <String>]
[-UsePolicyBasedTrafficSelectors <Boolean>]
[-UseLocalAzureIpAddress <Boolean>]
[-IpsecPolicies <PSIpsecPolicy[]>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzVirtualNetworkGatewayConnection
-VirtualNetworkGatewayConnection <PSVirtualNetworkGatewayConnection>
[-EnableBgp <Boolean>]
[-DpdTimeoutInSeconds <Int32>]
[-ConnectionMode <String>]
[-UsePolicyBasedTrafficSelectors <Boolean>]
[-UseLocalAzureIpAddress <Boolean>]
[-IpsecPolicies <PSIpsecPolicy[]>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>]
-Tag <Hashtable>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
El cmdlet Set-AzVirtualNetworkGatewayConnection configura una conexión de puerta de enlace de red virtual.
Ejemplos
Ejemplo 1:
$conn = Get-AzVirtualNetworkGatewayConnection -Name 1 -ResourceGroupName myRG
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn
Confirm
Are you sure you want to overwrite resource '1'
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Name : 1
ResourceGroupName : myRG
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Mi
crosoft.Network/connections/1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/M
icrosoft.Network/virtualNetworkGateways/myGateway"
VirtualNetworkGateway2 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/S2SVnetConn/providers/Mic
rosoft.Network/virtualNetworkGateways/S2SConnGW"
LocalNetworkGateway2 :
Peer :
RoutingWeight : 0
SharedKey :
ConnectionStatus : Connected
EgressBytesTransferred : 91334484
IngressBytesTransferred : 100386089
TunnelConnectionStatus : []
Ejemplo 2: Agregar o actualizar etiquetas a un virtualNetworkGatewayConnection existente
$conn = Get-AzVirtualNetworkGatewayConnection -Name 1 -ResourceGroupName myRG
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -Tag @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }
Confirm
Are you sure you want to overwrite resource '1'
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Name : 1
ResourceGroupName : myRG
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Mi
crosoft.Network/connections/1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
Name Value
============ ============
testtagValue SomeKeyValue
testtagKey SomeTagKey
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/M
icrosoft.Network/virtualNetworkGateways/myGateway"
VirtualNetworkGateway2 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/S2SVnetConn/providers/Mic
rosoft.Network/virtualNetworkGateways/S2SConnGW"
LocalNetworkGateway2 :
Peer :
RoutingWeight : 0
SharedKey :
ConnectionStatus : Connected
EgressBytesTransferred : 91334484
IngressBytesTransferred : 100386089
TunnelConnectionStatus : []
Ejemplo 3: Agregar o quitar natRules a un virtualNetworkGatewayConnection existente
$conn = Get-AzVirtualNetworkGatewayConnection -Name 1 -ResourceGroupName myRG
$egressNatrule = Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName myRG -Name "natRule1" -ParentResourceName "gw1"
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -IngressNatRule @() -EgressNatRule $egressNatrule
Confirm
Are you sure you want to overwrite resource '1'
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Name : 1
ResourceGroupName : myRG
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Mi
crosoft.Network/connections/1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
Name Value
============ ============
testtagValue SomeKeyValue
testtagKey SomeTagKey
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/M
icrosoft.Network/virtualNetworkGateways/myGateway"
VirtualNetworkGateway2 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/S2SVnetConn/providers/Mic
rosoft.Network/virtualNetworkGateways/S2SConnGW"
LocalNetworkGateway2 :
Peer :
RoutingWeight : 0
SharedKey :
ConnectionStatus : Connected
EgressBytesTransferred : 91334484
IngressBytesTransferred : 100386089
TunnelConnectionStatus : []
IngressNatRules : []
EgressNatRules : [
{
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1"
}
]
El primer comando obtiene una conexión de puerta de enlace de red virtual denominada 1 que pertenece al grupo de recursos myRG y la almacena en la variable denominada $conn. El segundo comando obtiene la puerta de enlace de red virtual natRule denominada natRule1 y la almacena en la variable denominada $egressNatrule. El tercer comando establece la conexión de puerta de enlace de red virtual con quitada todas las ingressNatRules y agrega egressNatrule a EgressNatRules.
Ejemplo 3: Agregar o quitar puerta de enlaceCustomBgpIpAddress a un virtualNetworkGatewayConnection existente
$address1 = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/default" -CustomBgpIpAddress "169.254.21.1"
$address2 = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/ActiveActive" -CustomBgpIpAddress "169.254.21.3"
$conn = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName PS_testing -ResourceName Conn
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -GatewayCustomBgpIpAddress $address1,$address2
Name : Conn
ResourceGroupName : PS_testing
Location : eastus
Id : /subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/connections/Conn
Etag : W/"e867e7bb-fa2e-436e-8822-70c556ec0f03"
ResourceGuid : 9c33f4f7-b09c-4080-932e-a44405a8c252
ProvisioningState : Succeeded
Tags :
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw"
VirtualNetworkGateway2 :
LocalNetworkGateway2 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/localNetworkGateways/testLng"
Peer :
RoutingWeight : 3
SharedKey : abc
ExpressRouteGatewayBypass : False
EnablePrivateLinkFastPath : False
ConnectionStatus : Unknown
EgressBytesTransferred : 0
IngressBytesTransferred : 0
TunnelConnectionStatus : []
IngressNatRules : []
EgressNatRules : []
GatewayCustomBgpIpAddresses : [
{
"IpconfigurationId":
"/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/default",
"CustomBgpIpAddress": "169.254.21.1"
},
{
"IpconfigurationId":
"/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/ActiveActive",
"CustomBgpIpAddress": "169.254.21.3"
}
]
Esto creará una nueva conexión de puerta de enlace AzGatewayCustomBgpIpConfigurationObjects y actualizará la conexión de puerta de enlace con estas GatewayCustomBgpIpAddress.
Ejemplo 4: Eliminación de GatewayCustomBgpIpAddress a un virtualNetworkGatewayConnection existente
$conn = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName PS_testing -ResourceName Conn
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -GatewayCustomBgpIpAddress @()
Name : Conn
ResourceGroupName : PS_testing
Location : eastus
Id : /subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/connections/Conn
Etag : W/"863d9b89-a030-42ba-9f71-58d5bc3336a9"
ResourceGuid : 9c33f4f7-b09c-4080-932e-a44405a8c252
ProvisioningState : Succeeded
Tags :
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw"
VirtualNetworkGateway2 :
LocalNetworkGateway2 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/localNetworkGateways/testLng"
Peer :
RoutingWeight : 3
SharedKey : abc
ExpressRouteGatewayBypass : False
EnablePrivateLinkFastPath : False
ConnectionStatus : NotConnected
EgressBytesTransferred : 0
IngressBytesTransferred : 0
TunnelConnectionStatus : []
IngressNatRules : []
EgressNatRules : []
GatewayCustomBgpIpAddresses : []
Esto actualizará la conexión de puerta de enlace con la eliminación de estas puertas de enlaceCustomBgpIpAddress.
Parámetros
-AsJob
Ejecución del cmdlet en segundo plano
Tipo: | SwitchParameter |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-Confirm
Le solicita su confirmación antes de ejecutar el cmdlet.
Tipo: | SwitchParameter |
Alias: | cf |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-ConnectionMode
Modo de conexión de puerta de enlace de red virtual.
Tipo: | String |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-DefaultProfile
Credenciales, cuenta, inquilino y suscripción usados para la comunicación con Azure.
Tipo: | IAzureContextContainer |
Alias: | AzContext, AzureRmContext, AzureCredential |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-DpdTimeoutInSeconds
Tiempo de espera de detección del mismo nivel inactivo de la conexión en segundos.
Tipo: | Nullable<T>[Int32] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-EgressNatRule
Lista de reglas NAT de salida asociadas a esta conexión.
Tipo: | PSResourceId[] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-EnableBgp
Si se usa una sesión BGP a través de un túnel VPN S2S
Tipo: | Nullable<T>[Boolean] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-Force
No solicite confirmación si desea sobrescribir un recurso
Tipo: | SwitchParameter |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-GatewayCustomBgpIpAddress
GatewayCustomBgpIpAddress de puerta de enlace de red virtual usada en esta conexión.
Tipo: | PSGatewayCustomBgpIpConfiguration[] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-IngressNatRule
Lista de reglas NAT de entrada asociadas a esta conexión.
Tipo: | PSResourceId[] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-IpsecPolicies
Lista de directivas IPSec.
Tipo: | PSIpsecPolicy[] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-Tag
Tabla hash que representa etiquetas de recursos.
Tipo: | Hashtable |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-TrafficSelectorPolicy
Lista de directivas de selector de tráfico.
Tipo: | PSTrafficSelectorPolicy[] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-UseLocalAzureIpAddress
Si se usa PrivateIP para una conexión S2S
Tipo: | Nullable<T>[Boolean] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-UsePolicyBasedTrafficSelectors
Si se usan selectores de tráfico basados en directivas para una conexión S2S
Tipo: | Nullable<T>[Boolean] |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
-VirtualNetworkGatewayConnection
The VirtualNetworkGatewayConnection
Tipo: | PSVirtualNetworkGatewayConnection |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | True |
Aceptar entrada de canalización: | True |
Aceptar caracteres comodín: | False |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
Tipo: | SwitchParameter |
Alias: | wi |
Posición: | Named |
Valor predeterminado: | None |
Requerido: | False |
Aceptar entrada de canalización: | False |
Aceptar caracteres comodín: | False |
Entradas
PSVirtualNetworkGatewayConnection
Nullable<T>[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
PSGatewayCustomBgpIpConfiguration[]
Salidas
PSVirtualNetworkGatewayConnection