{"id":3706,"date":"2016-07-30T22:10:01","date_gmt":"2016-07-30T13:10:01","guid":{"rendered":"http:\/\/www.syuheiuda.com\/?p=3706"},"modified":"2018-05-30T17:11:27","modified_gmt":"2018-05-30T08:11:27","slug":"%e6%97%a2%e5%ad%98%e3%81%ae-vnet-%e3%81%ab-p2s-vpn-%e3%82%92%e8%bf%bd%e5%8a%a0","status":"publish","type":"post","link":"https:\/\/www.syuheiuda.com\/?p=3706","title":{"rendered":"\u65e2\u5b58\u306e VNet \u306b P2S VPN \u3092\u8ffd\u52a0"},"content":{"rendered":"<p>P2S VPN \u3092\u4f5c\u308b\u624b\u9806\u304c\u8907\u6570\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u5206\u304b\u308c\u3066\u3066\u9762\u5012\u306a\u3093\u3067\u3001\u30e1\u30e2\u304c\u3066\u3089\u3002<\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\"># makecert \u3067\u8a3c\u660e\u66f8\u3092\u4f5c\u6210\r\n.&quot;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\makecert.exe&quot; -sky exchange -r -n &quot;CN=VpnRootCert&quot; -pe -a sha1 -len 2048 -ss My &quot;VpnRootCert.cer&quot;\r\n.&quot;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\makecert.exe&quot; -n &quot;CN=VpnClientCert&quot; -pe -sky exchange -m 96 -ss My -in &quot;VpnRootCert&quot; -is my -a sha1\r\n\r\n# Win10 \u306a\u3089 PowerShell \u3067\u3082\u8a3c\u660e\u66f8\u304c\u4f5c\u308c\u308b\u3089\u3057\u3044\u306e\u3067\u8ffd\u8a18\r\n$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature -Subject &quot;CN=P2SRootCert&quot; -KeyExportPolicy Exportable -HashAlgorithm sha256 -KeyLength 2048 -CertStoreLocation &quot;Cert:\\CurrentUser\\My&quot; -KeyUsageProperty Sign -KeyUsage CertSign\r\nNew-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature -Subject &quot;CN=P2SChildCert&quot; -KeyExportPolicy Exportable -HashAlgorithm sha256 -KeyLength 2048 -CertStoreLocation &quot;Cert:\\CurrentUser\\My&quot; -Signer $cert -TextExtension @(&quot;2.5.29.37={text}1.3.6.1.5.5.7.3.2&quot;)\r\n# \u4e8b\u524d\u306b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 \u30a2\u30c9\u30ec\u30b9 \u30d7\u30fc\u30eb (\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u7aef\u672b\u306b\u6255\u3044\u51fa\u3059 IP \u30ec\u30f3\u30b8) \u3092\u8ffd\u52a0\r\n$Gw = Get-AzureRmVirtualNetworkGateway -Name &quot;&lt;Gateway \u540d&gt;&quot; -ResourceGroupName &quot;&lt;RG \u540d&gt;&quot;\r\nSet-AzureRmVirtualNetworkGatewayVpnClientConfig -VirtualNetworkGateway $Gw -VpnClientAddressPool &quot;&lt;\u30af\u30e9\u30a4\u30a2\u30f3\u30c8 \u30a2\u30c9\u30ec\u30b9 \u30d7\u30fc\u30eb\u306e IP \u30ec\u30f3\u30b8&gt;&quot; #192.168.0.0\/24 \u306a\u3069\r\n\r\n# \u30eb\u30fc\u30c8\u8a3c\u660e\u66f8\u3092\u8ffd\u52a0\r\n$RootCertName = &quot;VpnRootCert.cer&quot;\r\n$RootCertPath = &quot;C:\\Users\\Administrator\\Desktop\\VpnRootCert.cer&quot;\r\n$RootCertBase64 = &#x5B;System.Convert]::ToBase64String(&#x5B;System.IO.File]::ReadAllBytes($RootCertPath))\r\n\r\nAdd-AzureRmVpnClientRootCertificate -VpnClientRootCertificateName $RootCertName -VirtualNetworkGatewayname $Gw.Name -ResourceGroupName $Gw.ResourceGroupName -PublicCertData $RootCertBase64 \r\n\r\n# VPN \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\r\n$ClientUrl = Get-AzureRmVpnClientPackage -ResourceGroupName $Gw.ResourceGroupName -VirtualNetworkGatewayName $Gw.Name -ProcessorArchitecture Amd64\r\nInvoke-WebRequest $ClientUrl\r\n<\/pre>\n<p>PowerShell \u3092\u5229\u7528\u3057\u3001\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3078\u306e\u30dd\u30a4\u30f3\u30c8\u5bfe\u30b5\u30a4\u30c8\u63a5\u7d9a\u3092\u69cb\u6210\u3059\u308b<br \/>\n<a href=\"https:\/\/azure.microsoft.com\/ja-jp\/documentation\/articles\/vpn-gateway-howto-point-to-site-rm-ps\/\" target=\"_blank\" rel=\"noopener\">https:\/\/azure.microsoft.com\/ja-jp\/documentation\/articles\/vpn-gateway-howto-point-to-site-rm-ps\/<\/a><\/p>\n<p>\u30dd\u30a4\u30f3\u30c8\u5bfe\u30b5\u30a4\u30c8\u69cb\u6210\u306e\u81ea\u5df1\u7f72\u540d\u30eb\u30fc\u30c8\u8a3c\u660e\u66f8\u306e\u64cd\u4f5c<br \/>\n<a href=\"https:\/\/azure.microsoft.com\/ja-jp\/documentation\/articles\/vpn-gateway-certificates-point-to-site\/\" target=\"_blank\" rel=\"noopener\">https:\/\/azure.microsoft.com\/ja-jp\/documentation\/articles\/vpn-gateway-certificates-point-to-site\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>P2S VPN \u3092\u4f5c\u308b\u624b\u9806\u304c\u8907\u6570\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u5206\u304b\u308c\u3066\u3066\u9762\u5012\u306a\u3093\u3067\u3001\u30e1\u30e2\u304c\u3066\u3089\u3002&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.syuheiuda.com\/?p=3706\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_locale":"","_original_post":""},"categories":[39,31],"tags":[],"views":4139,"_links":{"self":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3706"}],"collection":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3706"}],"version-history":[{"count":6,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3706\/revisions"}],"predecessor-version":[{"id":4362,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3706\/revisions\/4362"}],"wp:attachment":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}