Add-VpnS2SInterface

Add-VpnS2SInterface

Creates a site-to-site (S2S) interface with the specified parameters.

構文

Parameter Set: EncryptionType
Add-VpnS2SInterface [-Name] <String> [-Destination] <String[]> [[-RoutingDomain] <String> ] [-AdminStatus <Boolean> ] [-AsJob] [-AuthenticationMethod <String> ] [-Certificate <X509Certificate2> ] [-CimSession <CimSession[]> ] [-EapMethod <String> ] [-EnableQoS <EnableQoS> ] [-EncryptionType <String> ] [-IdleDisconnectSeconds <UInt32> ] [-InitiateConfigPayload <Boolean> ] [-InternalIPv4 <Boolean> ] [-InternalIPv6 <Boolean> ] [-IPv4Subnet <String[]> ] [-IPv4TriggerFilter <String[]> ] [-IPv4TriggerFilterAction <Action> ] [-IPv6Subnet <String[]> ] [-IPv6TriggerFilter <String[]> ] [-IPv6TriggerFilterAction <Action> ] [-NetworkOutageTimeSeconds <UInt32> ] [-NumberOfTries <UInt32> ] [-PassThru] [-Password <String> ] [-Persistent] [-PostConnectionIPv4Subnet <String[]> ] [-PostConnectionIPv6Subnet <String[]> ] [-PromoteAlternate <Boolean> ] [-Protocol <String> ] [-RadiusAttributeClass <String> ] [-ResponderAuthenticationMethod <String> ] [-RetryIntervalSeconds <UInt32> ] [-RxBandwidthKbps <UInt64> ] [-SADataSizeForRenegotiationKilobytes <UInt32> ] [-SALifeTimeSeconds <UInt32> ] [-SharedSecret <String> ] [-SourceIpAddress <String> ] [-ThrottleLimit <Int32> ] [-TxBandwidthKbps <UInt64> ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CustomPolicy
Add-VpnS2SInterface [-Name] <String> [-Destination] <String[]> [[-RoutingDomain] <String> ] -CustomPolicy [-AdminStatus <Boolean> ] [-AsJob] [-AuthenticationMethod <String> ] [-AuthenticationTransformConstants <AuthenticationTransformConstants> ] [-Certificate <X509Certificate2> ] [-CimSession <CimSession[]> ] [-CipherTransformConstants <CipherTransformConstants> ] [-DHGroup <DHGroup> ] [-EapMethod <String> ] [-EnableQoS <EnableQoS> ] [-EncryptionMethod <EncryptionMethod> ] [-IdleDisconnectSeconds <UInt32> ] [-InitiateConfigPayload <Boolean> ] [-IntegrityCheckMethod <IntegrityCheckMethod> ] [-InternalIPv4 <Boolean> ] [-InternalIPv6 <Boolean> ] [-IPv4Subnet <String[]> ] [-IPv4TriggerFilter <String[]> ] [-IPv4TriggerFilterAction <Action> ] [-IPv6Subnet <String[]> ] [-IPv6TriggerFilter <String[]> ] [-IPv6TriggerFilterAction <Action> ] [-NetworkOutageTimeSeconds <UInt32> ] [-NumberOfTries <UInt32> ] [-PassThru] [-Password <String> ] [-Persistent] [-PfsGroup <PfsGroup> ] [-PostConnectionIPv4Subnet <String[]> ] [-PostConnectionIPv6Subnet <String[]> ] [-PromoteAlternate <Boolean> ] [-Protocol <String> ] [-RadiusAttributeClass <String> ] [-ResponderAuthenticationMethod <String> ] [-RetryIntervalSeconds <UInt32> ] [-RxBandwidthKbps <UInt64> ] [-SADataSizeForRenegotiationKilobytes <UInt32> ] [-SALifeTimeSeconds <UInt32> ] [-SharedSecret <String> ] [-SourceIpAddress <String> ] [-ThrottleLimit <Int32> ] [-TxBandwidthKbps <UInt64> ] [-UserName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Add-VpnS2SInterface cmdlet creates a site-to-site (S2S) interface with the specified parameters. Use the CustomPolicy parameter to customize IPsec settings. If the Protocol parameter is set to Automatic, then the only authentication method allowed is user name. If the AuthenticationMethod parameter is set to pre-shared key (PSK), then only one interface can be enabled per destination and the initiator and responder policies are governed by what is specified per interface. If the AuthenticationMethod parameter is set to user name or computer certificates (MachineCert), then only initiator policies are governed by what is specified per interface and responder policies are governed by what is specified on the server.

For incoming connections:
-- If the AuthenticationMethod parameter is set to PSK, the interface for which the destination IP matches the incoming IP is activated.
-- If the AuthenticationMethod parameter is set to user name, then the name of the interface that matches the user name is activated.
-- If the AuthenticationMethod parameter is set to certificates, then the name of the interface that matches the certificate subject name is activated.

パラメーター

-AdminStatus<Boolean>

Specifies the administrator status of the cmdlet.

エイリアス

なし

必須?

false

位置は?

named

既定値

True

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-AuthenticationMethod<String>

Specifies the authentication method to be used by the S2S connection.
If PSK is specified, then there can only be one active S2S VPN interface per destination IP address.

エイリアス

なし

必須?

false

位置は?

named

既定値

EAP

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-AuthenticationTransformConstants<AuthenticationTransformConstants>

Specifies a transform constant. このパラメーターに対して使用できる値:

-- SHA256128
-- MD596
-- SHA196
-- GCMAES128
-- GCMAES192
-- GCMAES256

エイリアス

FirstTransformType,AuthenticationTransformConstant

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Certificate<X509Certificate2>

Specifies the certificate to be used in default store. Applicable only if AuthenticationMethod parameter is set to MachineCert.

エイリアス

Cert

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CipherTransformConstants<CipherTransformConstants>

Specifies a cipher transform constant. このパラメーターに対して使用できる値:

-- DES
-- DES3
-- AES128
-- AES192
-- AES256
-- GCMAES128
-- GCMAES192
-- GCMAES256

エイリアス

OtherCipherAlgorithm,FirstCipherAlgorithm,CipherTransformConstant

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-CustomPolicy

Specifies the custom IKE IPsec policies.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DHGroup<DHGroup>

Specifies the Diffie-Hellman (DH) group for the IPsec policy.

エイリアス

なし

必須?

false

位置は?

named

既定値

2

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Destination<String[]>

Specifies the destination end point of the S2S connection.
Note: If the Certificate parameter is specified as PSK, then an IP address should be specified for this parameter as a fully qualified domain name (FQDN) will not work.

エイリアス

RemoteTunnelEndpoint,RemoteTunnelHostname,RemoteAddress

必須?

true

位置は?

3

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EapMethod<String>

Specifies the EAP method if IkeLocalAuthenticationMethod is EAP.

エイリアス

なし

必須?

false

位置は?

named

既定値

MSCHAPv2

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EnableQoS<EnableQoS>

Indicates whether to enable Quality of Service (QoS) on an interface.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EncryptionMethod<EncryptionMethod>

Specifies the encryption method for the IKE policy.

エイリアス

Encryption

必須?

false

位置は?

named

既定値

4

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-EncryptionType<String>

Specifies the type of encryption.

エイリアス

なし

必須?

false

位置は?

named

既定値

RequireEncryption

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-IdleDisconnectSeconds<UInt32>

Specifies the time interval, in seconds, after which an idle connection is disconnected. Unless you disable idle timeout, an idle connection is disconnected after this time interval is reached.

エイリアス

IdleDurationSeconds,IdleDisconnectSec

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-InitiateConfigPayload<Boolean>

Indicates whether to initiate Config payload negotiation.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-IPv4Subnet<String[]>

Specifies the IPv4 subnet that is routed on this connection with metrics. You must specify the IPv4 subnet in the format of IPv4Address/SubnetPrefixLength:RouteMetric. For example: 192.168.1.0/24:1

エイリアス

IPv4TriggerSubnet

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-IPv4TriggerFilter<String[]>

Specifies an array of IPv4 filters that trigger demand dial connections.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue, ByPropertyName)

ワイルドカード文字を許可する

false

-IPv4TriggerFilterAction<Action>

Indicates whether a filter should trigger an S2S connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue, ByPropertyName)

ワイルドカード文字を許可する

false

-IPv6Subnet<String[]>

Specifies the IPv6 subnet that is routed on this connection with metrics.

エイリアス

IPv6TriggerSubnet

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-IPv6TriggerFilter<String[]>

Specifies an array of IPv6 filters that trigger demand dial connections.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue, ByPropertyName)

ワイルドカード文字を許可する

false

-IPv6TriggerFilterAction<Action>

Indicates whether a filter should trigger an S2S connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue, ByPropertyName)

ワイルドカード文字を許可する

false

-IntegrityCheckMethod<IntegrityCheckMethod>

Specifies the integrity method for the IPsec policy.

エイリアス

OtherHashAlgorithm,FirstIntegrityAlgorithm

必須?

false

位置は?

named

既定値

2

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-InternalIPv4<Boolean>

Specifies that the IPv4 address should be negotiated.

エイリアス

なし

必須?

false

位置は?

named

既定値

True

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-InternalIPv6<Boolean>

Specifies that the IPv6 address should be negotiated.

エイリアス

なし

必須?

false

位置は?

named

既定値

True

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of the connection.

エイリアス

ElementName

必須?

true

位置は?

2

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-NetworkOutageTimeSeconds<UInt32>

Specifies the maximum amount of time, in seconds, before a connection is disconnected due to a network outage.

エイリアス

NetworkOutageTimeSec

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-NumberOfTries<UInt32>

Specifies the number of connection attempts.
If this parameter is specified as zero (0), then the connection is not retried if the first attempt fails.

エイリアス

なし

必須?

false

位置は?

named

既定値

3

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PassThru

作業中の項目を表すオブジェクトを返します。既定では、このコマンドレットによる出力はありません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Password<String>

Specifies the password for the user name to be used for dialing the connection. Applicable only if AuthenticationMethod parameter is set to EAP.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Persistent

Indicates that a connection is not disconnected due to inactivity.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PfsGroup<PfsGroup>

Specifies the PFS group in the IPsec policy.

エイリアス

PfsGroupId

必須?

false

位置は?

named

既定値

3

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PostConnectionIPv4Subnet<String[]>

Specifies the IPv4 subnet routes that are added to a site-to-site interface after the connection is established. The values specified are not used to initiate the site-to-site VPN connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PostConnectionIPv6Subnet<String[]>

Specifies the IPv6 subnet routes that are added to a site-to-site interface after the connection is established. The values specified are not used to initiate the site-to-site VPN connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PromoteAlternate<Boolean>

Specifies an IP address that if successfully connected becomes the primary IP address, and the current primary IP address is moved to the alternate list.

エイリアス

なし

必須?

false

位置は?

named

既定値

False

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Protocol<String>

Specifies the underlying protocol used for tunneling.

エイリアス

KeyModule

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RadiusAttributeClass<String>

Specifies a RADIUS attribute.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ResponderAuthenticationMethod<String>

Specifies the authentication method to be used by the S2S initiator to validate the S2S responder.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RetryIntervalSeconds<UInt32>

Specifies the time interval, in seconds, to wait between retries.

エイリアス

RetryIntervalSec

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RoutingDomain<String>

Specifies an ID, as a string, for a routing domain. The ID of a routing domain is a user-defined alphanumeric string.

エイリアス

RoutingDomainName

必須?

false

位置は?

4

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-RxBandwidthKbps<UInt64>

Specifies the receive bandwidth limit, in kilobits per second (Kbps).

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SADataSizeForRenegotiationKilobytes<UInt32>

Specifies the amount of data, in kilobytes (KB), that can be transferred using a security association (SA). When the limit is reached, the SA must be renegotiated.

エイリアス

SaRenegotiationDataSizeKB,LifeTimeKiloBytes

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SALifeTimeSeconds<UInt32>

Specifies the lifetime, in seconds, of a security association (SA). The SA is no longer valid after this time interval.

エイリアス

SaLifeTimeSec,LifeTimeSeconds

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-SharedSecret<String>

Specifies the text of the shared secret to be used in the connection. This parameter is only applicable only if the AuthenticationMethod parameter is set to PSK or the ResponderAuthenticationMethod parameter is set to PSK.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-SourceIpAddress<String>

Specifies the source IPv4 or IPv6 addresses to use when dialing the connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-TxBandwidthKbps<UInt64>

Specifies a transmit bandwidth limit, in Kbps, for the interface.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-UserName<String>

Specifies the user name to be used for the connection. Applicable only if AuthenticationMethod parameter is set to EAP.

エイリアス

User

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • None

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Management.Infrastructure.CimInstance#VpnS2SInterface

    Microsoft.Management.Infrastructure.CimInstance オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。シャープ記号 (#) の後のパスは、基になる WMI オブジェクトの名前空間とクラス名です。

EXAMPLE 1

This example creates a S2S VPN interface named edge1 to the destination server 131.107.0.20. The protocol is IKEv2 and the authentication method is PSK. The string abc is used as PSK. Traffic to 10.2.0.0/24 and 2001:db8:2::/48 is sent over this interface if there is no other interface on the server that has same routes with a metric less than 100 . In case the interface is in disconnected state the connection is triggered if there is no other interface on the server that has same routes with a metric less than 100.

PS C:\> Add-VpnS2SInterface -Nameedge1 –Destination 131.107.0.20 -Protocol IKEv2 -AuthenticationMethod PSKOnly -SharedSecret abc -IPv4Subnet 10.2.0.0/24:100 -IPv6Subnet 2001:db8:2::/48:100

EXAMPLE 2

This example creates an interface that uses EAP authentication method and multiple subnets are routed on this interface including 131.0.1.0/24 and 121.0.0.0/16.

PS C:\> Add-VpnS2SInterface -IPv4Subnet @("131.0.1.0/24:254", "121.0.0.0/16:124") –UserName "abc@contoso.com" -Destination "30.0.0.1" -IPv6Subnet @("3ffe::/32:24", "2ffe::/32:24") -AuthenticationMethod "EAP" -Name "TestVpnS2SInterface" -RetryInterval 120 -EncryptionType "RequireEncryption" -InternalIPv4 1 -InternalIPv6 1 -NumberofTries 20 -AdminStatus $true -IdleDisconnectSeconds 300 -PromoteAlternate $true -Password "1111_aaaa" -PassThru

EXAMPLE 3

This example creates a S2S VPN interface using custom encryption settings.

PS C:\> Add-VpnS2SInterface -CustomPolicy -UserName "abc@contoso.com" -EncryptionMethod "AES128" -Destination "30.0.0.1" -Password "1111_aaaa" -DhGroup "Group2" -PfsGroup "PFS2" -CipherTransformConstants "AES128" -Name "TestVpnS2SInterface" -IntegrityCheckMethod "SHA256" -AuthenticationTransformConstants "SHA256128" -Protocol "IKEv2"

EXAMPLE 4

This example creates a S2S interface with authentication method of computer certificate and specifies the certificate for which the subject name is edge1.contoso.com.

PS C:\> $cert1 = Get-ChildItem -Path cert:LocalMachine\My | Where-Object –FilterScript { $_.Subject -Like "*CN=edge1.contoso.com*" }
PS C:\> Add-VpnS2SInterface –Name e1 -Destination 1.1.1.1 -AuthenticationMethod MachineCertificates -Certificate $cert1 -ResponderAuthenticationMethod MachineCertificates -Protocol IKEv2

関連トピック

Add-VpnS2SInterface

Clear-VpnS2SInterfaceStatistics

Connect-VpnS2SInterface

Disconnect-VpnS2SInterface

Get-VpnAuthProtocol

Get-VpnS2SInterface

Get-VpnS2SInterfaceStatistics

Get-VpnServerIPsecConfiguration

Remove-VpnS2SInterface

Set-VpnAuthProtocol

Set-VpnS2SInterface

Set-VpnServerIPsecConfiguration