{"id":2162,"date":"2016-04-08T01:31:29","date_gmt":"2016-04-07T16:31:29","guid":{"rendered":"http:\/\/1bed.allright.life\/?p=2162"},"modified":"2020-04-18T22:08:16","modified_gmt":"2020-04-18T13:08:16","slug":"post-2162","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=2162","title":{"rendered":"PowerShell \u3067\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b"},"content":{"rendered":"<p>NAPT \u306e\u5185\u5074\u306b\u3044\u308b\u30b2\u30b9\u30c8 OS \u3092\u3001\u30db\u30b9\u30c8 OS \u7d4c\u7531\u3067\u4ed6\u306e\u7aef\u672b\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30c6\u30fc\u30d6\u30eb\u306b\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u306e\u60c5\u5831\u3092\u767b\u9332\u3059\u308b\u3002<\/p>\n<h2>\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b<\/h2>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6d41\u3057\u307e\u3059<\/p>\n<pre><code class=\"language-powershell\">Add-NetNatStaticMapping [-NatName] &lt;String&gt; -ExternalIPAddress &lt;String&gt; -ExternalPort &lt;UInt16&gt; -InternalIPAddress &lt;String&gt; -Protocol &lt;Protocol&gt; [-InternalPort &lt;UInt16&gt; ]<\/code><\/pre>\n<p>\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u6642\u306b\u306f\u3001\u5148\u306b\u4e0b\u8a18\u60c5\u5831\u3092\u628a\u63e1\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<ul>\n<li>\u30b2\u30b9\u30c8 OS \u306e IP \u30a2\u30c9\u30ec\u30b9\u3068\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3059\u308b\u30dd\u30fc\u30c8\u756a\u53f7<\/li>\n<li>\u30db\u30b9\u30c8 OS \u304c\u53d7\u3051\u4ed8\u3051\u308b\u30dd\u30fc\u30c8\u756a\u53f7<\/li>\n<\/ul>\n<p>\u3064\u307e\u308a\u3001\u30db\u30b9\u30c8 OS \u306e\u4f55\u756a\u306e\u30dd\u30fc\u30c8\u3067\u53d7\u3051\u3066\u3001\u30b2\u30b9\u30c8 OS \u306e\u4f55\u756a\u306e\u30dd\u30fc\u30c8\u306b\u30d5\u30a9\u30ef\u30fc\u30c9\u3059\u308b\u304b\u3092\u628a\u63e1\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001SharePoint \u3092\u30bb\u30df\u30ca\u30fc\u3067\u4f7f\u3046\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3001\u624b\u5143\u306e\u4eee\u60f3\u74b0\u5883\u4e0a\u306e SharePoint \u3092\u30db\u30b9\u30c8 OS \u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u4ed6\u306e\u30de\u30b7\u30f3\u304b\u3089\u3082\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/p>\n<p><code><code>-ExternalIPAddress<\/code><\/code> \u306f 0.0.0.0 (\u5168\u3066\u304b\u3089\u53d7\u3051\u4ed8\u3051\u308b\u305e\u3043) \u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u4f8b<\/p>\n<pre><code class=\"language-powershell\"># NAT \u30c6\u30fc\u30d6\u30eb\u540d\u3092\u78ba\u8a8d\nPS&gt; Get-NetNat\nName                             : VmNAPT\nExternalIPInterfaceAddressPrefix :\nInternalIPInterfaceAddressPrefix : 10.0.1.0\/24\nIcmpQueryTimeout                 : 30\nTcpEstablishedConnectionTimeout  : 1800\nTcpTransientConnectionTimeout    : 120\nTcpFilteringBehavior             : AddressDependentFiltering\nUdpFilteringBehavior             : AddressDependentFiltering\nUdpIdleSessionTimeout            : 120\nUdpInboundRefresh                : False\nStore                            : Local\nActive                           : True\n\n# \u30db\u30b9\u30c8 OS \u304c\u53d7\u3051\u305f\u4ed6\u306e\u7aef\u672b(0.0.0.0)\u304b\u3089\u30dd\u30fc\u30c8 80 \u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u3001\u30b2\u30b9\u30c8(10.0.1.10) \u306e\u30dd\u30fc\u30c8 80 \u3092\u30d5\u30a9\u30ef\u30fc\u30c9\u3059\u308b\n\nPS&gt; Add-NetNatStaticMapping &quot;VmNAPT&quot; -ExternalIPAddress 0.0.0.0 -InternalIPAddress 10.0.1.10 -ExternalPort 80 -Protocol TCP -InternalPort 80\n\nStaticMappingID               : 0\nNatName                       : VmNAPT\nProtocol                      : TCP\nRemoteExternalIPAddressPrefix : 0.0.0.0\/0\nExternalIPAddress             : 0.0.0.0\nExternalPort                  : 80\nInternalIPAddress             : 10.0.1.10\nInternalPort                  : 80\nInternalRoutingDomainId       : {00000000-0000-0000-0000-000000000000}\nActive                        : True<\/code><\/pre>\n<h2>\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u78ba\u8a8d\u3059\u308b<\/h2>\n<pre><code class=\"language-powershell\">Get-NetNatStaticMapping [[-NatName] &lt;String[]&gt;]<\/code><\/pre>\n<p>\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u78ba\u8a8d\u3059\u308b\u4f8b<\/p>\n<pre><code class=\"language-powershell\">PS&gt; Get-NetNatStaticMapping\n\nStaticMappingID               : 0\nNatName                       : VmNAPT\nProtocol                      : TCP\nRemoteExternalIPAddressPrefix : 0.0.0.0\/0\nExternalIPAddress             : 0.0.0.0\nExternalPort                  : 80\nInternalIPAddress             : 10.0.1.10\nInternalPort                  : 80\nInternalRoutingDomainId       : {00000000-0000-0000-0000-000000000000}\nActive                        : True<\/code><\/pre>\n<h2>\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u524a\u9664\u3059\u308b<\/h2>\n<pre><code class=\"language-powershell\">Remove-NetNatStaticMapping [[-NatName] &lt;String[]&gt;]<\/code><\/pre>\n<p>\u8a2d\u5b9a\u3057\u305f\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u524a\u9664\u3059\u308b\u4f8b<\/p>\n<pre><code class=\"language-powershell\">PS&gt; Remove-NetNatStaticMapping &quot;VmNAPT&quot;\n\n\u78ba\u8a8d\n\u3053\u306e\u64cd\u4f5c\u3092\u5b9f\u884c\u3057\u307e\u3059\u304b?\n\u5bfe\u8c61 VmNAPT;0;0 \u306e PolicyStore Local \u306b\u5bfe\u3057\u3066\u64cd\u4f5c Delete \u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\n[Y] \u306f\u3044(Y)  [A] \u3059\u3079\u3066\u7d9a\u884c(A)  [N] \u3044\u3044\u3048(N)  [L] \u3059\u3079\u3066\u7121\u8996(L)  [S] \u4e2d\u65ad(S)  [?] \u30d8\u30eb\u30d7 (\u65e2\u5b9a\u5024\u306f &quot;Y&quot;): y<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>NAPT \u306e\u5185\u5074\u306b\u3044\u308b\u30b2\u30b9\u30c8 OS \u3092\u3001\u30db\u30b9\u30c8 OS \u7d4c\u7531\u3067\u4ed6\u306e\u7aef\u672b\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30c6\u30fc\u30d6\u30eb\u306b\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u306e\u60c5\u5831\u3092\u767b\u9332\u3059\u308b\u3002 \u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b \u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6d41\u3057\u307e\u3059 Add-NetN [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[62],"class_list":["post-2162","post","type-post","status-publish","format-standard","hentry","category-program","tag-powershell"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2162"}],"version-history":[{"count":2,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2162\/revisions"}],"predecessor-version":[{"id":3162,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2162\/revisions\/3162"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}