{"id":7171,"date":"2021-03-23T18:24:00","date_gmt":"2021-03-23T09:24:00","guid":{"rendered":"https:\/\/gunmagisgeek.com\/blog\/?p=7171"},"modified":"2023-02-15T01:44:38","modified_gmt":"2023-02-14T16:44:38","slug":"wsl2%e3%81%a7%e8%b5%b7%e5%8b%95%e3%81%97%e3%81%9f%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%ab%e5%a4%96%e9%83%a8%e3%81%ae%e7%ab%af%e6%9c%ab%e3%81%8b%e3%82%89%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/other\/7171","title":{"rendered":"WSL2\u3067\u8d77\u52d5\u3057\u305f\u30b5\u30fc\u30d0\u30fc\u306b\u5916\u90e8\u306e\u7aef\u672b\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b"},"content":{"rendered":"\n<p>\u3076\u3063\u3061\u3083\u3051\u30b0\u30b0\u308c\u3070\u3001\u3082\u3063\u3068\u8a73\u7d30\u306b\u8aac\u660e\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u8a18\u4e8b\u304c\u3044\u304f\u3089\u3067\u3082\u307f\u3064\u304b\u308b\u306e\u3060\u3051\u308c\u3069\u3001\u4e00\u5fdc\u81ea\u5206\u7528\u306e\u30e1\u30e2\u3068\u3057\u3066\u66f8\u3044\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6982\u8981<\/h2>\n\n\n\n<p>wsl2\u306e\u4e2d\u3067\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3061\u4e0a\u3052\u3066\u958b\u767a\u3057\u3066\u3044\u308b\u3068\u3001\u5916\u90e8\u306e\u7aef\u672b(\u4f8b\u3048\u3070\u5b9f\u6a5f\u30b9\u30de\u30db\u306a\u3069)\u304b\u3089\u52d5\u4f5c\u78ba\u8a8d\u306e\u305f\u3081\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3044\u3068\u304d\u304c\u3042\u308b\u3002\u305d\u306e\u305f\u3081\u306e\u624b\u9806\u30e1\u30e2\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f5c\u696d\u624b\u9806<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\uff11\uff0e\u30db\u30b9\u30c8OS(windows)\u306eip\u30a2\u30c9\u30ec\u30b9\u3092\u78ba\u8a8d<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">&gt; ipconfig<\/pre><\/div>\n\n\n\n<p>\u540c\u6642\u306b\u300c\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8 \u30a2\u30c0\u30d7\u30bf\u30fc vEthernet (WSL):\u300d\u304c\u3061\u3083\u3093\u3068\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304b\u3082\u540c\u6642\u306b\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uff12\uff0ewsl2(ubuntu)\u306eip\u30a2\u30c9\u30ec\u30b9\u78ba\u8a8d<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \">&gt; ip a show dev eth0<\/pre><\/div>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">\uff13\uff0ewsl\u5074\u3067\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5<\/h3>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001http\u30b5\u30fc\u30d0\u30fc\u3092port:3000\u3067\u8d77\u52d5\u3057\u305f\u3082\u306e\u3068\u3059\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uff14\uff0e\u30db\u30b9\u30c8OS\u304b\u3089wsl\u306eip\u30a2\u30c9\u30ec\u30b9\u3092\u7528\u3044\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304b\u78ba\u8a8d<\/h3>\n\n\n\n<p>\u78ba\u8a8d\u4f5c\u696d\u306f\u30db\u30b9\u30c8OS\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u884c\u3046<\/p>\n\n\n\n<p><strong>http:\/\/\uff1cwsl\u306eip\u30a2\u30c9\u30ec\u30b9\uff1e:3000\u3000\u306b\u30a2\u30af\u30bb\u30b9<\/strong><\/p>\n\n\n\n<p>\u3053\u308c\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304b\u3063\u305f\u3089wsl\u5185\u304bWSL\u306e\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u30a2\u30c0\u30d7\u30bf\u30fc\u5468\u308a\u3067\u554f\u984c\u304c\u8d77\u304d\u3066\u308b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uff15\uff0e\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\u3067wsl\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u884c\u3046<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u3001\u30b3\u30de\u30f3\u30c9\u5b9f\u884c\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u304bpowershell\u3067\u3002\u3069\u3061\u3089\u3082\u7ba1\u7406\u8005\u6a29\u9650\u3067\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:sh decode:true \" >\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a\n&gt; netsh.exe interface portproxy add v4tov4 listenaddress=\uff1c\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\uff1elistenport=3000 connectaddress=\uff1cwsl\u306eip\u30a2\u30c9\u30ec\u30b9\uff1e connectport=3000\n\n\u8a2d\u5b9a\u78ba\u8a8d\n&gt; netsh.exe interface portproxy show v4tov4\n\n\u524a\u9664\u3059\u308b\u3068\u304d\u306f\u4ee5\u4e0b\n&gt; netsh.exe interface portproxy delete v4tov4 listenport=3000 listenaddress=\uff1c\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\uff1e\n<\/pre><\/div>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">\uff16\uff0e\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\u3092\u7528\u3044\u3066wsl\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304b\u78ba\u8a8d<\/h3>\n\n\n\n<p>\u78ba\u8a8d\u4f5c\u696d\u306f\u30db\u30b9\u30c8OS\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u884c\u3046<\/p>\n\n\n\n<p><strong>http:\/\/\uff1c\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\uff1e:3000\u3000\u306b\u30a2\u30af\u30bb\u30b9<\/strong><\/p>\n\n\n\n<p>\u3053\u308c\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u3001\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u306a\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uff17\uff0e\u5916\u90e8\u306e\u7aef\u672b\u304b\u3089\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\u3092\u7528\u3044\u3066wsl\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304b\u78ba\u8a8d<\/h3>\n\n\n\n<p>\u540c\u4e00\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u6240\u5c5e\u3059\u308b\u5916\u90e8\u7aef\u672b\u3092\u4f7f\u3063\u3066\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n\n<p><strong>http:\/\/\uff1c\u30db\u30b9\u30c8OS\u306eip\u30a2\u30c9\u30ec\u30b9\uff1e:3000\u3000\u306b\u30a2\u30af\u30bb\u30b9<\/strong><\/p>\n\n\n\n<p>\u3053\u3053\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u5834\u5408\u306f\u30d5\u30a1\u30a4\u30e4\u30fc\u30a6\u30a9\u30fc\u30eb\u306b\u30d6\u30ed\u30c3\u30af\u3055\u308c\u3066\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u306e\u3067Windows\u306e\u30d5\u30a1\u30a4\u30e4\u30fc\u30a6\u30a9\u30fc\u30eb\u8a2d\u5b9a\u304b\u3089\u3001\u300c\u8a73\u7d30\u8a2d\u5b9a\u300d\u306b\u9032\u307f\u300c\u53d7\u4fe1\u306e\u898f\u5236\u300d\u306b\u65b0\u3057\u3044\u898f\u5247\u3092\u4f5c\u3063\u3066port:3000\u3092\u958b\u3051\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"658\" src=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2021\/03\/windowsDefenderConfig-1024x658.jpg\" alt=\"\" class=\"wp-image-7172\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2021\/03\/windowsDefenderConfig-1024x658.jpg 1024w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2021\/03\/windowsDefenderConfig-233x150.jpg 233w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2021\/03\/windowsDefenderConfig-768x494.jpg 768w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2021\/03\/windowsDefenderConfig-1536x987.jpg 1536w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2021\/03\/windowsDefenderConfig.jpg 1556w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u30a2\u30af\u30bb\u30b9\u306f\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u307f\u306b\u9650\u5b9a\u3057\u3001\u4e0d\u8981\u306a\u3068\u304d\u306f\u300c\u898f\u5247\u306e\u7121\u52b9\u5316\u300d\u3092\u884c\u3046<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3076\u3063\u3061\u3083\u3051\u30b0\u30b0\u308c\u3070\u3001\u3082\u3063\u3068\u8a73\u7d30\u306b\u8aac\u660e\u3057\u3066\u304f\u308c\u3066\u3044\u308b&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,1],"tags":[],"class_list":["post-7171","post","type-post","status-publish","format-standard","hentry","category-troubleshooting","category-other"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/7171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=7171"}],"version-history":[{"count":13,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/7171\/revisions"}],"predecessor-version":[{"id":8173,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/7171\/revisions\/8173"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=7171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=7171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=7171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}