{"id":90,"date":"2023-11-24T16:53:57","date_gmt":"2023-08-27T00:26:51","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"},"modified":"2025-07-31T13:56:47","modified_gmt":"2025-07-31T04:56:47","slug":"debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","title":{"rendered":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5"},"content":{"rendered":"<h3>\u5c0e\u5165<\/h3>\n<p>WireGuard\u306f\u3001IPv4\u304a\u3088\u3073IPv6\u63a5\u7d9a\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u8efd\u91cf\u306a\u4eee\u60f3\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\uff08VPN\uff09\u3067\u3059\u3002VPN\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306b\u3044\u308b\u304b\u306e\u3088\u3046\u306b\u3001\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u901a\u904e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30db\u30c6\u30eb\u3084\u30b3\u30fc\u30d2\u30fc\u30b7\u30e7\u30c3\u30d7\u306eWi-Fi\u306a\u3069\u3001\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u63a5\u7d9a\u3057\u305f\u5834\u5408\u3067\u3082\u3001\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u3084\u30ce\u30fc\u30c8\u30d1\u30bd\u30b3\u30f3\u304b\u3089\u5b89\u5168\u304b\u3064\u5b89\u5168\u306b\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u81ea\u7531\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u307e\u305f\u3001Tailscale\u306e\u3088\u3046\u306b\u3001SSH\u3084\u4ed6\u306e\u6a5f\u5bc6\u30dd\u30fc\u30c8\u3092\u958b\u3044\u305f\u307e\u307e\u306b\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001\u72ec\u81ea\u306e\u30a4\u30f3\u30d5\u30e9\u30b9\u30c8\u30e9\u30af\u30c1\u30e3\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306bVPN\u3092\u5c55\u958b\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>WireGuard\u306e\u6697\u53f7\u5316\u306f\u3001\u30d4\u30a2\u540c\u58eb\u304c\u6697\u53f7\u5316\u3055\u308c\u305f\u30c8\u30f3\u30cd\u30eb\u3092\u78ba\u7acb\u3059\u308b\u305f\u3081\u306b\u516c\u958b\u9375\u3068\u79d8\u5bc6\u9375\u306b\u4f9d\u5b58\u3057\u3066\u3044\u307e\u3059\u3002\u5404\u30d0\u30fc\u30b8\u30e7\u30f3\u306eWireGuard\u306f\u3001\u7c21\u5358\u3055\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3001\u304a\u3088\u3073\u30d4\u30a2\u3068\u306e\u4e92\u63db\u6027\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306b\u7279\u5b9a\u306e\u6697\u53f7\u5316\u6280\u8853\u306e\u6697\u53f7\u30b9\u30a4\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ed6\u306eVPN\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3001\u4f8b\u3048\u3070OpenVPN\u3084IPSec\u306f\u3001\u30c8\u30e9\u30f3\u30b9\u30dd\u30fc\u30c8\u5c64\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\uff08TLS\uff09\u3068\u8a3c\u660e\u66f8\u3092\u4f7f\u7528\u3057\u3066\u8a8d\u8a3c\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u9593\u3067\u6697\u53f7\u5316\u30c8\u30f3\u30cd\u30eb\u3092\u78ba\u7acb\u3057\u307e\u3059\u3002TLS\u306e\u7570\u306a\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u306f\u3001\u6570\u767e\u3082\u306e\u7570\u306a\u308b\u6697\u53f7\u30b9\u30a4\u30fc\u30c8\u3084\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3055\u307e\u3056\u307e\u306a\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u5bfe\u5fdc\u3059\u308b\u67d4\u8edf\u6027\u304c\u751f\u307e\u308c\u307e\u3059\u304c\u3001TLS\u3092\u4f7f\u7528\u3057\u305fVPN\u306e\u8a2d\u5b9a\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u3001\u8907\u96d1\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Debian 11 \u30b5\u30fc\u30d0\u30fc\u306b WireGuard \u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3001\u305d\u308c\u304b\u3089\u5225\u306e\u30de\u30b7\u30f3\u3092IPv4\u3068IPv6\u306e\u4e21\u65b9\u306e\u63a5\u7d9a\u3092\u4f7f\u7528\u3057\u3066\u30d4\u30a2\u3068\u3057\u3066\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\uff08\u4e00\u822c\u7684\u306b\u30c7\u30e5\u30a2\u30eb\u30b9\u30bf\u30c3\u30af\u63a5\u7d9a\u3068\u547c\u3070\u308c\u307e\u3059\uff09\u3002\u3055\u3089\u306b\u3001VPN\u3092\u4f7f\u7528\u3057\u3066\u6697\u53f7\u5316\u3055\u308c\u305f\u30d4\u30a2\u9593\u30c8\u30f3\u30cd\u30eb\u3068\u3057\u3066\u3060\u3051\u3067\u306a\u304f\u3001WireGuard \u30b5\u30fc\u30d0\u30fc\u3092\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u69cb\u6210\u3067\u30d4\u30a2\u306e\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3059\u308b\u65b9\u6cd5\u3082\u5b66\u3073\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u300c\u30d4\u30a2\u300d\uff08\u307e\u305f\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u3082\u547c\u3070\u308c\u307e\u3059\uff09\u3068\u3057\u3066\u3001\u5225\u306eDebian 11\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30b7\u30ea\u30fc\u30ba\u306e\u5f8c\u7d9a\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Windows\u3001macOS\u3001Android\u3001\u304a\u3088\u3073iOS\u30b7\u30b9\u30c6\u30e0\u3084\u30c7\u30d0\u30a4\u30b9\u306bWireGuard\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304a\u3088\u3073\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1a\u30c7\u30b8\u30bf\u30eb\u30aa\u30fc\u30b7\u30e3\u30f3\u306e\u30c9\u30ed\u30c3\u30d7\u30ec\u30c3\u30c8\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u5834\u5408\u3001\u6211\u3005\u306f\u591a\u304f\u306e\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u30d7\u30ed\u30d0\u30a4\u30c0\u3068\u540c\u69d8\u306b\u3001\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u8d85\u904e\u306b\u5bfe\u3057\u3066\u6599\u91d1\u3092\u8acb\u6c42\u3057\u3066\u3044\u307e\u3059\u3053\u3068\u3092\u8a8d\u8b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u306e\u305f\u3081\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u51e6\u7406\u3059\u308b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u91cf\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u306e\u30da\u30fc\u30b8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n<h2>\u524d\u63d0\u6761\u4ef6 (Zentei j\u014dken)<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5f93\u3046\u305f\u3081\u306b\u306f\u3001\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>One Debian 11 server with a sudo non-root user and a firewall enabled. To set this up, you can follow our Initial Server Setup with Debian 11 tutorial. We will refer to this as the WireGuard Server throughout this guide.<\/li>\n<li>You\u2019ll need a client machine that you will use to connect to your WireGuard Server. In this tutorial we\u2019ll refer to this machine as the WireGuard Peer. For the purposes of this tutorial, it\u2019s recommended that you use your local machine as the WireGuard Peer, but you can use remote servers, or mobile phones as clients if you prefer. If you are using a remote system, be sure to follow all of the optional sections later in this tutorial or you may lock yourself out of the system.<\/li>\n<li>To use WireGuard with IPv6, you will also need to ensure that your server is configured to support that type of traffic. If you would like to enable IPv6 support with WireGuard and are using a Silicon Cloud vServer, please refer to this documentation page How to Enable IPv6 on vServers. You can add IPv6 support when you create a vServer, or afterwards using the instructions on that page.<\/li>\n<\/ul>\n<h2>\u30b9\u30c6\u30c3\u30d71\uff1aWireGuard\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u30ad\u30fc\u30da\u30a2\u306e\u751f\u6210<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u6700\u521d\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u306bWireGuard\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u59cb\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u66f4\u65b0\u3057\u3001WireGuard\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057\u4eca\u56de\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u3067sudo\u3092\u521d\u3081\u3066\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001sudo\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u63d0\u793a\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> wireguard<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>WireGuard\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u3001\u6b21\u306f\u30b5\u30fc\u30d0\u30fc\u306e\u79d8\u5bc6\u9375\u3068\u516c\u958b\u9375\u306e\u30da\u30a2\u3092\u751f\u6210\u3059\u308b\u624b\u9806\u3067\u3059\u3002\u79d8\u5bc6\u9375\u3068\u516c\u958b\u9375\u306f\u3001\u7d44\u307f\u8fbc\u307f\u306e\u300cwg genkey\u300d\u3068\u300cwg pubkey\u300d\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u4f5c\u6210\u3057\u3001\u305d\u306e\u5f8c\u3001\u79d8\u5bc6\u9375\u3092WireGuard\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f5c\u6210\u3057\u305f\u30ad\u30fc\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u3092\u5909\u66f4\u3059\u308b\u306b\u306f\u3001chmod\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u4e0a\u306e\u4efb\u610f\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001WireGuard\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ad\u30fc\u3092\u4f5c\u6210\u3057\u3001\u305d\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">wg genkey <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/wireguard\/private.key<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">chmod<\/span> <span class=\"token assign-left variable\">go<\/span><span class=\"token operator\">=<\/span> \/etc\/wireguard\/private.key<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300csudo chmod go=&#8230;\u300d\u30b3\u30de\u30f3\u30c9\u306f\u3001\u30eb\u30fc\u30c8\u30e6\u30fc\u30b6\u30fc\u4ee5\u5916\u306e\u30e6\u30fc\u30b6\u30fc\u3084\u30b0\u30eb\u30fc\u30d7\u306b\u5bfe\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u6a29\u9650\u3092\u524a\u9664\u3057\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ad\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u306e\u306f\u30eb\u30fc\u30c8\u30e6\u30fc\u30b6\u30fc\u3060\u3051\u3067\u3042\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u6587\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u307e\u3059\uff08\u65e5\u672c\u8a9e\u306e1\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\u5fc5\u8981\u3067\u3059\uff09\uff1a<br \/>\nbase64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u306e1\u884c\u3092\u53d7\u3051\u53d6\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u306e\u30b3\u30d4\u30fc\u306f\u3001\u5c06\u6765\u7684\u306a\u53c2\u7167\u306e\u305f\u3081\u306b\/etc\/wireguard\/private.key\u30d5\u30a1\u30a4\u30eb\u306b\u3082\u4fdd\u5b58\u3055\u308c\u307e\u3059\uff08\u30b3\u30de\u30f3\u30c9\u306e\u4e00\u90e8\u3067\u3042\u308b\u300ctee\u300d\u306e\u5f79\u5272\u306b\u3088\u308a\uff09\u3002\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3055\u308c\u305f\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ad\u30fc\u306b\u6ce8\u610f\u6df1\u304f\u76ee\u3092\u901a\u3057\u3001\u5f8c\u307b\u3069\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067WireGuard\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u8a18\u9332\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ad\u30fc\u304b\u3089\u6d3e\u751f\u3057\u305f\u5bfe\u5fdc\u3059\u308b\u516c\u958b\u30ad\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u516c\u958b\u30ad\u30fc\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">cat<\/span> \/etc\/wireguard\/private.key <span class=\"token operator\">|<\/span> wg pubkey <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/wireguard\/public.key<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001|\uff08\u30d1\u30a4\u30d7\uff09\u30aa\u30da\u30ec\u30fc\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u7d50\u5408\u3055\u308c\u308b3\u3064\u306e\u500b\u5225\u306e\u30b3\u30de\u30f3\u30c9\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>sudo cat \/etc\/wireguard\/private.key: this command reads the private key file and outputs it to the standard output stream.<\/li>\n<li>wg pubkey: the second command takes the output from the first command as its standard input and processes it to generate a public key.<\/li>\n<li>sudo tee \/etc\/wireguard\/public.key: the final command takes the output of the public key generation command and redirects it into the file named \/etc\/wireguard\/public.key.<\/li>\n<\/ul>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u518d\u5ea6\u5358\u4e00\u306e\u884c\u3067base64\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u51fa\u529b\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u304cWireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u516c\u958b\u9375\u3067\u3059\u3002\u63a5\u7d9a\u3059\u308b\u3059\u3079\u3066\u306e\u30d4\u30a2\u306b\u516c\u958b\u9375\u3092\u914d\u5e03\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u53c2\u7167\u7528\u306b\u3069\u3053\u304b\u306b\u30b3\u30d4\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d72- IPv4\u3068IPv6\u30a2\u30c9\u30ec\u30b9\u306e\u9078\u629e<\/h2>\n<p>\u524d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001WireGuard\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u6697\u53f7\u5316\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u9375\u30da\u30a2\u3092\u751f\u6210\u3057\u307e\u3057\u305f\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u7528\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u518d\u8d77\u52d5\u3059\u308b\u969b\u306bWireGuard\u304c\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u307e\u305f\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u3068\u30d4\u30a2\u306b\u4f7f\u7528\u3059\u308b\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8IPv4\u304a\u3088\u3073IPv6\u30a2\u30c9\u30ec\u30b9\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057IPv4\u3068IPv6\u30a2\u30c9\u30ec\u30b9\u306e\u4e21\u65b9\u3092\u4f7f\u7528\u3059\u308b\u4e88\u5b9a\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u4e21\u65b9\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u5f93\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f\u3001VPN\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8981\u4ef6\u306b\u5408\u308f\u305b\u305f\u9069\u5207\u306a\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u6307\u793a\u306b\u5f93\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30b9\u30c6\u30c3\u30d72(a) &#8211; IPv4\u30ec\u30f3\u30b8\u306e\u9078\u629e<\/h3>\n<p>IPv4\u30d4\u30a2\u3092\u4f7f\u7528\u3057\u3066WireGuard\u30b5\u30fc\u30d0\u30fc\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30b5\u30fc\u30d0\u30fc\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30c8\u30f3\u30cd\u30eb\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306b\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8IPv4\u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u304c\u5fc5\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u4e88\u7d04\u6e08\u307f\u30a2\u30c9\u30ec\u30b9\u30d6\u30ed\u30c3\u30af\u304b\u3089\u4efb\u610f\u306e\u7bc4\u56f2\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u9078\u629e\u3067\u304d\u307e\u3059\uff08\u3053\u308c\u3089\u306e\u30d6\u30ed\u30c3\u30af\u304c\u3069\u306e\u3088\u3046\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u304b\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u5b66\u3073\u305f\u3044\u5834\u5408\u306f\u3001RFC 1918\u306e\u4ed5\u69d8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\uff09\u3002<\/p>\n<ul class=\"post-ul\">\n<li>10.0.0.0 to 10.255.255.255 (10\/8 prefix)<\/li>\n<li>172.16.0.0 to 172.31.255.255 (172.16\/12 prefix)<\/li>\n<li>192.168.0.0 to 192.168.255.255 (192.168\/16 prefix)<\/li>\n<\/ul>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u4e88\u7d04\u3055\u308c\u305fIP\u30a2\u30c9\u30ec\u30b9\u306e\u6700\u521d\u306e\u7bc4\u56f2\u304b\u308910.8.0.0\/24\u3092IP\u30a2\u30c9\u30ec\u30b9\u306e\u30d6\u30ed\u30c3\u30af\u3068\u3057\u3066\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u7bc4\u56f2\u3067\u306f\u6700\u5927255\u306e\u30d4\u30a2\u63a5\u7d9a\u304c\u53ef\u80fd\u3067\u3042\u308a\u3001\u901a\u5e38\u4ed6\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8IP\u7bc4\u56f2\u3068\u885d\u7a81\u3084\u91cd\u8907\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u3082\u3057\u3053\u306e\u4f8b\u306e\u7bc4\u56f2\u304c\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u69cb\u6210\u306b\u5408\u308f\u306a\u3044\u5834\u5408\u306f\u3001\u81ea\u8eab\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u69cb\u6210\u306b\u5408\u3063\u305f\u30a2\u30c9\u30ec\u30b9\u7bc4\u56f2\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>WireGuard\u30b5\u30fc\u30d0\u30fc\u306f\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30c8\u30f3\u30cd\u30ebIPv4\u30a2\u30c9\u30ec\u30b9\u3068\u3057\u3066\u3001\u30ec\u30f3\u30b8\u304b\u30891\u3064\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f10.8.0.1\/24\u3092\u4f7f\u7528\u3057\u307e\u3059\u304c\u300110.8.0.1\u304b\u308910.8.0.255\u306e\u7bc4\u56f2\u5185\u306e\u3069\u306e\u30a2\u30c9\u30ec\u30b9\u3067\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u3082\u305710.8.0.1\/24\u4ee5\u5916\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u9078\u3093\u3060IP\u30a2\u30c9\u30ec\u30b9\u3092\u30e1\u30e2\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306eIPv4\u30a2\u30c9\u30ec\u30b9\u306f\u3001Step3\u3067\u5b9a\u7fa9\u3059\u308b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30c6\u30c3\u30d72\uff08b\uff09- IPv6\u306e\u7bc4\u56f2\u3092\u9078\u629e\u3059\u308b\u3002<\/h3>\n<p>\u3082\u3057IPv6\u3092\u4f7f\u7528\u3057\u3066WireGuard\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001RFC 4193\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306b\u57fa\u3065\u3044\u3066\u56fa\u6709\u306e\u30ed\u30fc\u30ab\u30ebIPv6\u30e6\u30cb\u30ad\u30e3\u30b9\u30c8\u30a2\u30c9\u30ec\u30b9\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u751f\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002WireGuard\u30b5\u30fc\u30d0\u30fc\u3067\u4f7f\u7528\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u306f\u4eee\u60f3\u30c8\u30f3\u30cd\u30eb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u95a2\u9023\u4ed8\u3051\u3089\u308c\u307e\u3059\u3002\u4e88\u7d04\u3055\u308c\u305ffd00::\/8\u30d6\u30ed\u30c3\u30af\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8IPv6\u30a2\u30c9\u30ec\u30b9\u5185\u3067\u30e9\u30f3\u30c0\u30e0\u304b\u3064\u30e6\u30cb\u30fc\u30af\u306aIPv6\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306b\u3044\u304f\u3064\u304b\u306e\u624b\u9806\u3092\u5b8c\u4e86\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>RFC\u306b\u3088\u308b\u3068\u3001IPv6\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4e00\u610f\u306b\u53d6\u5f97\u3059\u308b\u63a8\u5968\u65b9\u6cd5\u306f\u3001\u6642\u523b\u3068\u30b7\u30ea\u30a2\u30eb\u756a\u53f7\u3084\u30c7\u30d0\u30a4\u30b9ID\u306a\u3069\u306e\u4e00\u610f\u306e\u8b58\u5225\u5024\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3059\u3002\u305d\u308c\u3089\u306e\u5024\u306f\u30cf\u30c3\u30b7\u30e5\u5316\u3055\u308c\u3001\u5207\u308a\u8a70\u3081\u3089\u308c\u308b\u3053\u3068\u3067\u3001\u4e88\u7d04\u3055\u308c\u305f\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u306afd00::\/8 IP\u30d6\u30ed\u30c3\u30af\u5185\u306e\u4e00\u610f\u306e\u30a2\u30c9\u30ec\u30b9\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u308b\u4e00\u9023\u306e\u30d3\u30c3\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>WireGuard\u30b5\u30fc\u30d0\u30fc\u306eIPv6\u7bc4\u56f2\u3092\u751f\u6210\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066date\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u4f7f\u3063\u306664\u30d3\u30c3\u30c8\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u53d6\u5f97\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">date<\/span> +%s%N<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6570\u5b57\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u30011970\u5e7401\u670801\u65e5 00:00:00 UTC\u304b\u3089\u306e\u79d2\u6570\uff08date\u30b3\u30de\u30f3\u30c9\u306e%s\uff09\u3068\u30ca\u30ce\u79d2\u6570\uff08%N\uff09\u304c\u7d44\u307f\u5408\u308f\u3055\u3063\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>1650301699497770167<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u5f8c\u3067\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u5024\u3092\u3069\u3053\u304b\u306b\u8a18\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u6b21\u306b\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u30de\u30b7\u30f3ID\u5024\u3092\/var\/lib\/dbus\/machine-id\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30b3\u30d4\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u8b58\u5225\u5b50\u306f\u30b7\u30b9\u30c6\u30e0\u56fa\u6709\u3067\u3042\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u5b58\u5728\u3059\u308b\u9650\u308a\u5909\u66f4\u3055\u308c\u308b\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">cat<\/span> \/var\/lib\/dbus\/machine-id<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"\/var\/lib\/dbus\/machine-id\">\/var\/lib\/dbus\/machine-id<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>610cef4946ed46da8f71dba9d66c67fb<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u3001\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3068\u30de\u30b7\u30f3ID\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001\u5f97\u3089\u308c\u305f\u5024\u3092SHA-1\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u30cf\u30c3\u30b7\u30e5\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30b3\u30de\u30f3\u30c9\u306e\u66f8\u5f0f\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>printf <mark>&lt;timestamp&gt;&lt;machine-id&gt;<\/mark> | sha1sum\r\n<\/code><\/pre>\n<p>\u81ea\u5206\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3068\u30de\u30b7\u30f3\u306e\u8b58\u5225\u5024\u3092\u5165\u308c\u66ff\u3048\u3066\u3001\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">printf<\/span> <mark>1650301699497770167610cef4946ed46da8f71dba9d66c67fb<\/mark> <span class=\"token operator\">|<\/span> sha1sum<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30cf\u30c3\u30b7\u30e5\u5024\u304c\u9001\u3089\u308c\u3066\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>442adea1488d96388dae9ab816045b24609a6c18 &#8211;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>sha1sum \u30b3\u30de\u30f3\u30c9\u306e\u51fa\u529b\u306f16\u9032\u6570\u3067\u3042\u308b\u305f\u3081\u30011\u30d0\u30a4\u30c8\u306e\u30c7\u30fc\u30bf\u3092\u8868\u3059\u305f\u3081\u306b2\u6587\u5b57\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u51fa\u529b\u306e\u4f8b\u3067\u306e4f\u306826\u306f\u30cf\u30c3\u30b7\u30e5\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u6700\u521d\u306e2\u30d0\u30a4\u30c8\u3067\u3059\u3002<\/p>\n<p>RFC\u5185\u306e\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3067\u306f\u3001\u30cf\u30c3\u30b7\u30e5\u5316\u3055\u308c\u305f\u51fa\u529b\u306e\u4e0b\u4f4d40\u30d3\u30c3\u30c8\u307e\u305f\u306f5\u30d0\u30a4\u30c8\u306e\u307f\u304c\u5fc5\u8981\u3067\u3059\u3002\u30cf\u30c3\u30b7\u30e5\u304b\u3089\u6700\u5f8c\u306e5\u3064\u306e16\u9032\u6570\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u30d0\u30a4\u30c8\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u3001cut\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token builtin class-name\">printf<\/span> 442adea1488d96388dae9ab816045b24609a6c18 <span class=\"token operator\">|<\/span> <span class=\"token function\">cut<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">31<\/span>&#8211;<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>-c\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u4e00\u9023\u306e\u6587\u5b57\u3060\u3051\u3092\u9078\u629e\u3059\u308b\u305f\u3081\u306ecut\u30b3\u30de\u30f3\u30c9\u306b\u6307\u793a\u3057\u307e\u3059\u300231-\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u30ab\u30c3\u30c8\u304c\u5165\u529b\u884c\u306e31\u756a\u76ee\u304b\u3089\u672b\u5c3e\u307e\u3067\u306e\u3059\u3079\u3066\u306e\u6587\u5b57\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>24609a6c18<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u4f8b\u306e\u51fa\u529b\u306b\u304a\u3044\u3066\u3001\u30d0\u30a4\u30c8\u306e\u30bb\u30c3\u30c8\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a24 60 9a 6c 18\u3002<\/p>\n<p>\u4eca\u307e\u3067\u751f\u6210\u3057\u305f5\u30d0\u30a4\u30c8\u306eIPv6\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306bfd\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4ed8\u3051\u3001\u53ef\u8aad\u6027\u306e\u305f\u3081\u306b2\u30d0\u30a4\u30c8\u3054\u3068\u306b:\u30b3\u30ed\u30f3\u3067\u533a\u5207\u308b\u3053\u3068\u3067\u3001\u72ec\u81ea\u306eIPv6\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002\u5404\u30e6\u30cb\u30fc\u30af\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306e\u30b5\u30d6\u30cd\u30c3\u30c8\u306f\u5408\u8a0818,446,744,073,709,551,616\u306eIPv6\u30a2\u30c9\u30ec\u30b9\u3092\u4fdd\u6301\u3067\u304d\u308b\u305f\u3081\u3001\u7c21\u5358\u3055\u306e\u305f\u3081\u306b\u30b5\u30d6\u30cd\u30c3\u30c8\u3092\u6a19\u6e96\u30b5\u30a4\u30ba\u306e\/64\u306b\u5236\u9650\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u524d\u306b\/64\u30b5\u30d6\u30cd\u30c3\u30c8\u30b5\u30a4\u30ba\u3067\u751f\u6210\u3055\u308c\u305f\u30d0\u30a4\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3001\u7d50\u679c\u3068\u3057\u3066\u5f97\u3089\u308c\u308b\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Unique Local IPv6 Address Prefix\">Unique Local IPv6 Address Prefix<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p><mark>fd24<\/mark>:<mark>609a<\/mark>:<mark>6c18<\/mark>::\/64<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306efd24:609a:6c18::\/64\u306e\u7bc4\u56f2\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u30d4\u30a2\u306eWireGuard\u30c8\u30f3\u30cd\u30eb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u500b\u5225\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u5272\u308a\u5f53\u3066\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308b\u3082\u306e\u3067\u3059\u3002 \u30b5\u30fc\u30d0\u30fc\u7528\u306eIP\u3092\u5272\u308a\u5f53\u3066\u308b\u306b\u306f\u3001\u6700\u5f8c\u306e::\u306e\u5f8c\u308d\u306b1\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002 \u7d50\u679c\u306e\u30a2\u30c9\u30ec\u30b9\u306f\u3001fd24:609a:6c18::1\/64\u3068\u306a\u308a\u307e\u3059\u3002 \u30d4\u30a2\u306f\u7bc4\u56f2\u5185\u306e\u4efb\u610f\u306eIP\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u901a\u5e38\u306f\u30d4\u30a2\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3073\u306b\u5024\u30921\u305a\u3064\u5897\u3084\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001fd24:609a:6c18::2\/64\u3067\u3059\u3002 IP\u3092\u30e1\u30e2\u3057\u3066\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d73 &#8211; WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h2>\n<p>\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u4f5c\u6210\u3059\u308b\u524d\u306b\u3001\u4ee5\u4e0b\u306e\u60c5\u5831\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30b9\u30c6\u30c3\u30d71\u306e\u300cWireGuard\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u30ad\u30fc\u30da\u30a2\u306e\u751f\u6210\u300d\u3067\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ad\u30fc\u304c\u5229\u7528\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>WireGuard\u3092IPv4\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u30b9\u30c6\u30c3\u30d72(a)\u306e\u300cIPv4\u30ec\u30f3\u30b8\u306e\u9078\u629e\u300d\u3067\u9078\u629e\u3057\u305f\u30b5\u30fc\u30d0\u30fc\u306eIP\u30a2\u30c9\u30ec\u30b9\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u4f8b\u3067\u306f10.8.0.1\/24\u3067\u3059\u3002<\/p>\n<p>WireGuard\u3092IPv6\u3067\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u30b9\u30c6\u30c3\u30d72(b)\u306e\u300cIPv6\u30ec\u30f3\u30b8\u306e\u9078\u629e\u300d\u3067\u751f\u6210\u3057\u305f\u30b5\u30fc\u30d0\u30fc\u306eIP\u30a2\u30c9\u30ec\u30b9\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u4f8b\u3067\u306ffd24:609a:6c18::1\/64\u3067\u3059\u3002<\/p>\n<p>\u6240\u5b9a\u306e\u79d8\u5bc6\u9375\u3068IP\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u624b\u3057\u305f\u3089\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066nano\u307e\u305f\u306f\u304a\u597d\u307f\u306e\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\u65b0\u3057\u3044\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/wireguard\/wg0.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u884c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3001\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305fbase64_encoded_private_key_goes_here\u306e\u5024\u306b\u306f\u3042\u306a\u305f\u81ea\u8eab\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30ad\u30fc\u3092\u3001Address\u306e\u884c\u306b\u306fIP\u30a2\u30c9\u30ec\u30b9\u3092\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001WireGuard\u3092\u5225\u306e\u30dd\u30fc\u30c8\u3067\u5229\u7528\u3057\u305f\u3044\u5834\u5408\u306fListenPort\u306e\u884c\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"\/etc\/wireguard\/wg0.conf\">\/etc\/wireguard\/wg0.conf<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[Interface] PrivateKey = <mark>base64_encoded_private_key_goes_here<\/mark> Address = <mark>10.8.0.1\/24<\/mark>, <mark>fd24:609a:6c18::1\/64<\/mark> ListenPort = 51820 SaveConfig = true<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>SaveConfig\u306e\u884c\u306f\u3001WireGuard\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3055\u308c\u305f\u969b\u306b\u3001\u5909\u66f4\u5185\u5bb9\u304c\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002<\/p>\n<p>\/etc\/wireguard\/wg0.conf \u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057 nano \u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001CTRL+X\u3001\u305d\u306e\u5f8c\u306b Y\u3001ENTER \u3092\u62bc\u3057\u3066\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002WireGuard VPN \u30b5\u30fc\u30d0\u30fc\u306e\u4f7f\u7528\u65b9\u6cd5\u306b\u5fdc\u3058\u3066\u3001\u57fa\u672c\u7684\u306a\u30b5\u30fc\u30d0\u30fc\u8a2d\u5b9a\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d74 \u2014 WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u306e\u8abf\u6574<\/h2>\n<p>\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30d4\u30a2\u3092\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u4e0a\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u306e\u307f\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5834\u5408\u3001\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u5b8c\u4e86\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u30d4\u30a2\u306e\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u30b5\u30fc\u30d0\u30fc\u7d4c\u7531\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306b\u5f93\u3063\u3066IP\u8ee2\u9001\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u8ee2\u9001\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001nano\u307e\u305f\u306f\u304a\u597d\u304d\u306a\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066Wireguard\u30b5\u30fc\u30d0\u30fc\u306e\/etc\/sysctl.conf\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/sysctl.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>IPv4\u3092\u4f7f\u7528\u3057\u3066WireGuard\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u672b\u5c3e\u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\n<p>\/etc\/sysctl.conf \u306e\u4ee5\u4e0b\u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\uff1a<\/p>\n<p>\/etc\/sysctl.conf<\/p>\n<\/div>\n<pre class=\"post-pre\"><code>net.ipv4.ip_forward=1\r\n<\/code><\/pre>\n<p>IPv6\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001WireGuard\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u6700\u5f8c\u306b\u3053\u306e\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div>\/etc\/sysctl.conf<br \/>\n\/etc\/sysctl.conf\uff08\u30b7\u30b9\u30c6\u30e0\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\uff09<\/div>\n<pre class=\"post-pre\"><code>net.ipv6.conf.all.forwarding=1\r\n<\/code><\/pre>\n<p>IPv4\u3068IPv6\u306e\u4e21\u65b9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u4e21\u65b9\u306e\u884c\u3092\u542b\u3081\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5b8c\u4e86\u3057\u305f\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3001\u73fe\u5728\u306e\u30bf\u30fc\u30df\u30ca\u30eb\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u65b0\u3057\u3044\u5024\u3092\u8aad\u307f\u8fbc\u3080\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">sysctl<\/span> <span class=\"token parameter variable\">-p<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>net.ipv6.conf.all.forwarding = 1 net.ipv4.ip_forward = 1<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4eca\u5f8c\u3001\u3042\u306a\u305f\u306eWireGuard\u30b5\u30fc\u30d0\u30fc\u306f\u3001\u4eee\u60f3VPN\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u306e\u7740\u4fe1\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u4ed6\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u8ee2\u9001\u3057\u3001\u3055\u3089\u306b\u516c\u5171\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3078\u3068\u8ee2\u9001\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001WireGuard\u30d4\u30a2\u304b\u3089\u306e\u3059\u3079\u3066\u306e\u30a6\u30a7\u30d6\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30b5\u30fc\u30d0\u30fc\u306eIP\u30a2\u30c9\u30ec\u30b9\u3092\u7d4c\u7531\u3057\u3066\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3057\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u516c\u5171IP\u30a2\u30c9\u30ec\u30b9\u306f\u5b9f\u8cea\u7684\u306b\u96a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u3092\u7d4c\u7531\u3057\u3066\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u6b63\u3057\u304f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3055\u308c\u308b\u524d\u306b\u3001\u3044\u304f\u3064\u304b\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u306b\u3088\u308a\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u3068\u30d4\u30a2\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u9069\u5207\u306b\u6d41\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d75 &#8211; WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a<\/h2>\n<p>\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u3092\u7de8\u96c6\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u6b63\u3057\u304f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3055\u308c\u308b\u3088\u3046\u306b\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u4ee5\u524d\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3068\u540c\u69d8\u306b\u3001WireGuard VPN\u3092\u30de\u30b7\u30f3\u9593\u63a5\u7d9a\u3060\u3051\u3067\u4f7f\u7528\u3057\u3066\u3001VPN\u306b\u5236\u9650\u3055\u308c\u305f\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u901a\u3058\u3066WireGuard VPN\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u8a31\u53ef\u3059\u308b\u306b\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u63a5\u7d9a\u3092\u6b63\u3057\u304f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3059\u308b\u305f\u3081\u306b\u3001\u30aa\u30f3\u30b6\u30d5\u30e9\u30a4\u3067\u52d5\u7684\u306a\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a2\u30c9\u30ec\u30b9\u5909\u63db\uff08NAT\uff09\u3092\u63d0\u4f9b\u3059\u308biptables\u306e\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u3042\u308b\u30de\u30b9\u30ab\u30ec\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u306f\u3058\u3081\u306b\u3001ip route\u306e\u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u516c\u958b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u898b\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">ip<\/span> route list default<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u516c\u958b\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306f\u3001\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u51fa\u529b\u306b\u3042\u308b\u300cdev\u300d\u3068\u3044\u3046\u8a00\u8449\u306e\u5f8c\u306b\u7d9a\u304f\u6587\u5b57\u5217\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u3053\u306e\u7d50\u679c\u306b\u306f\u3001\u4e0b\u306b\u793a\u3059\u3088\u3046\u306b\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305f\u540d\u524d\u304c\u300ceth0\u300d\u3068\u3044\u3046\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>default via 203.0.113.1 dev <mark>eth0<\/mark> proto static<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3067iptables\u306e\u30eb\u30fc\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u305f\u3081\u3001\u30c7\u30d0\u30a4\u30b9\u306e\u540d\u524d\u3092\u8a18\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u300cWireGuard\u30b5\u30fc\u30d0\u30fc\u306b\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001\u518d\u3073nano\u307e\u305f\u306f\u597d\u304d\u306a\u30a8\u30c7\u30a3\u30bf\u3067\/etc\/wireguard\/wg0.conf\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/wireguard\/wg0.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u672b\u5c3e\u306b\u3001&#8221;SaveConfig = true&#8221; \u306e\u884c\u306e\u5f8c\u308d\u306b\u3001\u4ee5\u4e0b\u306e\u884c\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"\/etc\/wireguard\/wg0.conf\">\/etc\/wireguard\/wg0.conf<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>. . . PostUp = ufw route allow in on wg0 out on <mark>eth0<\/mark> PostUp = iptables -t nat -I POSTROUTING -o <mark>eth0<\/mark> -j MASQUERADE PostUp = ip6tables -t nat -I POSTROUTING -o <mark>eth0<\/mark> -j MASQUERADE PreDown = ufw route delete allow in on wg0 out on <mark>eth0<\/mark> PreDown = iptables -t nat -D POSTROUTING -o <mark>eth0<\/mark> -j MASQUERADE PreDown = ip6tables -t nat -D POSTROUTING -o <mark>eth0<\/mark> -j MASQUERADE<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>WireGuard\u30b5\u30fc\u30d0\u30fc\u304c\u4eee\u60f3VPN\u30c8\u30f3\u30cd\u30eb\u3092\u958b\u59cb\u3059\u308b\u3068\u3001PostUp\u30e9\u30a4\u30f3\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001ufw\u3068iptables\u306e\u30eb\u30fc\u30eb\u304c3\u3064\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>ufw route allow in on wg0 out on eth0 &#8211; This rule will allow forwarding IPv4 and IPv6 traffic that comes in on the wg0 VPN interface to the eth0 network interface on the server. It works in conjunction with the net.ipv4.ip_forward and net.ipv6.conf.all.forwarding sysctl values that you configured in the previous section.<\/li>\n<li>iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE &#8211; This rule configures masquerading, and rewrites IPv4 traffic that comes in on the wg0 VPN interface to make it appear like it originates directly from the WireGuard Server\u2019s public IPv4 address.<\/li>\n<li>ip6tables -t nat -I POSTROUTING -o eth0 -j MASQUERADE &#8211; This rule configures masquerading, and rewrites IPv6 traffic that comes in on the wg0 VPN interface to make it appear like it originates directly from the WireGuard Server\u2019s public IPv6 address.<\/li>\n<\/ul>\n<p>WireGuard\u30b5\u30fc\u30d0\u30fc\u304c\u4eee\u60f3VPN\u30c8\u30f3\u30cd\u30eb\u3092\u505c\u6b62\u3059\u308b\u6642\u306b\u3001PreDown\u30eb\u30fc\u30eb\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u306f\u3001PostUp\u30eb\u30fc\u30eb\u306e\u9006\u3067\u3042\u308a\u3001VPN\u304c\u505c\u6b62\u3055\u308c\u305f\u3068\u304d\u306bVPN\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u3068\u30de\u30b9\u30ab\u30ec\u30fc\u30c7\u30a3\u30f3\u30b0\u30eb\u30fc\u30eb\u3092\u5143\u306b\u623b\u3059\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e21\u65b9\u306e\u5834\u5408\u3001VPN\u306b\u9069\u5207\u306aIPv4\u3068IPv6\u306e\u30eb\u30fc\u30eb\u3092\u542b\u3081\u308b\u304b\u9664\u5916\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001IPv4\u306e\u307f\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001ip6tables\u30b3\u30de\u30f3\u30c9\u306e\u884c\u3092\u9664\u5916\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u9006\u306b\u3001IPv6\u306e\u307f\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001ip6tables\u306e\u30b3\u30de\u30f3\u30c9\u306e\u307f\u3092\u542b\u3081\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3092\u7de8\u96c6\u3057\u3066\u304f\u3060\u3055\u3044\u3002ufw\u306e\u884c\u306f\u3001IPv4\u3068IPv6\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u5bfe\u3057\u3066\u5b58\u5728\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4f5c\u696d\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u9589\u3058\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u30b5\u30fc\u30d0\u30fc\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u6700\u5f8c\u306e\u8a2d\u5b9a\u306f\u3001\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9UDP\u30dd\u30fc\u30c8\u3078\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u8a31\u53ef\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u306e\/etc\/wireguard\/wg0.conf\u30d5\u30a1\u30a4\u30eb\u3067\u30dd\u30fc\u30c8\u3092\u5909\u66f4\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u958b\u304f\u30dd\u30fc\u30c8\u306f51820\u3067\u3059\u3002\u8a2d\u5b9a\u3092\u7de8\u96c6\u3059\u308b\u969b\u306b\u7570\u306a\u308b\u30dd\u30fc\u30c8\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306eUFW\u30b3\u30de\u30f3\u30c9\u3067\u305d\u308c\u3092\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u524d\u63d0\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306b\u5f93\u3046\u969b\u306bSSH\u30dd\u30fc\u30c8\u3092\u958b\u304f\u306e\u3092\u5fd8\u308c\u305f\u5834\u5408\u3001\u3053\u3061\u3089\u306b\u3082\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> ufw allow <mark><span class=\"token number\">51820<\/span><\/mark>\/<mark>udp<\/mark><\/li>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> ufw allow OpenSSH<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1a\u7570\u306a\u308b\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3084\u3001UFW\u306e\u8a2d\u5b9a\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u8ffd\u52a0\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001VPN\u63a5\u7d9a\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u3059\u3079\u3066\u30c8\u30f3\u30cd\u30ea\u30f3\u30b0\u3059\u308b\u3053\u3068\u3092\u6c7a\u5b9a\u3057\u305f\u5834\u5408\u3001DNS\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u305f\u3081\u306b\u30dd\u30fc\u30c853\u306e\u901a\u4fe1\u304c\u8a31\u53ef\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3001HTTP\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306b\u306f\u30dd\u30fc\u30c880\u3001HTTPS\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306b\u306f\u30dd\u30fc\u30c8443\u306a\u3069\u306e\u30dd\u30fc\u30c8\u304c\u8a31\u53ef\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002VPN\u3092\u4ecb\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b\u4ed6\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u305d\u308c\u306b\u5bfe\u3059\u308b\u30eb\u30fc\u30eb\u3082\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n<p>\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u305f\u5f8c\u3001UFW\u3092\u7121\u52b9\u5316\u3057\u3066\u518d\u5ea6\u6709\u52b9\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u5909\u66f4\u3092\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u3093\u3067\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> ufw disable<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> ufw <span class=\"token builtin class-name\">enable<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>ufw status\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u898f\u5247\u304c\u9069\u7528\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u5b9f\u884c\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> ufw status<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Status: active To Action From &#8212; &#8212;&#8212; &#8212;- 51280\/udp ALLOW Anywhere 22\/tcp ALLOW Anywhere 51280\/udp (v6) ALLOW Anywhere (v6) 22\/tcp (v6) ALLOW Anywhere (v6)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3042\u306a\u305f\u306eWireGuard\u30b5\u30fc\u30d0\u30fc\u306f\u3001VPN\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9069\u5207\u306b\u51e6\u7406\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u3084\u30de\u30b9\u30ab\u30ec\u30fc\u30c7\u30a3\u30f3\u30b0\u3082\u542b\u307e\u308c\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001WireGuard\u30b5\u30fc\u30d3\u30b9\u81ea\u4f53\u3092\u8d77\u52d5\u3057\u3066\u30d4\u30a2\u63a5\u7d9a\u3092\u5f85\u3061\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d76 \u2014 WireGuard \u30b5\u30fc\u30d0\u30fc\u306e\u8d77\u52d5<\/h2>\n<p>WireGuard\u306f\u3001\u7d44\u307f\u8fbc\u307f\u306ewg-quick\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066systemd\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u69cb\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002VPN\u3092\u4f7f\u7528\u3059\u308b\u305f\u3073\u306b\u30c8\u30f3\u30cd\u30eb\u3092\u624b\u52d5\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u3053\u306e\u624b\u9806\u306f\u7e70\u308a\u8fd4\u3057\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u4ee3\u308f\u308a\u3001wg-quick\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u52a9\u3051\u3092\u501f\u308a\u3066systemctl\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30f3\u30cd\u30eb\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>systemd\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001WireGuard\u3092\u8d77\u52d5\u6642\u306b\u8a2d\u5b9a\u3067\u304d\u308b\u305f\u3081\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u7a3c\u50cd\u3057\u3066\u3044\u308b\u9650\u308a\u3044\u3064\u3067\u3082VPN\u306b\u63a5\u7d9a\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3092\u884c\u3046\u306b\u306f\u3001systemctl\u306b\u8ffd\u52a0\u3057\u3066\u5b9a\u7fa9\u3057\u305fwg0\u30c8\u30f3\u30cd\u30eb\u306e\u305f\u3081\u306bwg-quick\u30b5\u30fc\u30d3\u30b9\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> wg-quick@wg0.service<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"post-conf-info\">\n<p class=\"post-conf-desc\">Info<\/p>\n<div>\u4ee5\u4e0b\u306e\u901a\u77e5\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b3\u30de\u30f3\u30c9\u3067\u306f\u3001\u30b5\u30fc\u30d3\u30b9\u540d\u306e\u4e00\u90e8\u3068\u3057\u3066\u30c8\u30f3\u30cd\u30ebwg0\u30c7\u30d0\u30a4\u30b9\u306e\u540d\u524d\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u540d\u524d\u306f\/etc\/wireguard\/wg0.conf\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u547d\u540d\u65b9\u6cd5\u306b\u3088\u308a\u3001\u30b5\u30fc\u30d0\u3092\u4f7f\u7528\u3057\u3066\u597d\u304d\u306a\u3060\u3051\u8907\u6570\u306e\u72ec\u7acb\u3057\u305fVPN\u30c8\u30f3\u30cd\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001\u30c8\u30f3\u30cd\u30eb\u30c7\u30d0\u30a4\u30b9\u306e\u540d\u524d\u3092prod\u3068\u3057\u3001\u305d\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\/etc\/wireguard\/prod.conf\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5404\u30c8\u30f3\u30cd\u30eb\u306e\u8a2d\u5b9a\u306b\u306f\u3001\u7570\u306a\u308bIPv4\u3001IPv6\u3001\u304a\u3088\u3073\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u8a2d\u5b9a\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3057\u3066\u3001\u8907\u6570\u306e\u7570\u306a\u308b\u30d4\u30a2\u63a5\u7d9a\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3001\u305d\u308c\u305e\u308c\u56fa\u6709\u306eIP\u30a2\u30c9\u30ec\u30b9\u3068\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30eb\u30fc\u30eb\u3092\u6301\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n<p>\u30b5\u30fc\u30d3\u30b9\u3092\u958b\u59cb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl start wg-quick@wg0.service<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067WireGuard\u30b5\u30fc\u30d3\u30b9\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u5316\u3055\u308c\u3066\u3044\u308b\u304b\u3001\u518d\u5ea6\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u51fa\u529b\u306b\u300cactive (running)\u300d\u3068\u8868\u793a\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> systemctl status wg-quick@wg0.service<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u25cf wg-quick@wg0.service &#8211; WireGuard via wg-quick(8) for wg0 Loaded: loaded (\/lib\/systemd\/system\/wg-quick@.service; enabled; vendor preset: enabled) Active: active (exited) since Mon 2022-04-18 17:22:13 UTC; 2s ago Docs: man:wg-quick(8) man:wg(8) https:\/\/www.wireguard.com\/ https:\/\/www.wireguard.com\/quickstart\/ https:\/\/git.zx2c4.com\/wireguard-tools\/about\/src\/man\/wg-quick.8 https:\/\/git.zx2c4.com\/wireguard-tools\/about\/src\/man\/wg.8 Process: 98834 ExecStart=\/usr\/bin\/wg-quick up wg0 (code=exited, status=0\/SUCCESS) Main PID: 98834 (code=exited, status=0\/SUCCESS) CPU: 193ms Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] wg setconf wg0 \/dev\/fd\/63 Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] ip -4 address add <mark>10.8.0.1\/24<\/mark> dev wg0 Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] ip -6 address add <mark>fd24:609a:6c18::1\/64<\/mark> dev wg0 Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] ip link set mtu 1420 up dev wg0 Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] ufw route allow in on wg0 out on ens3 Apr 18 17:22:13 thats-my-jam wg-quick[98890]: Rule added Apr 18 17:22:13 thats-my-jam wg-quick[98890]: Rule added (v6) Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] iptables -t nat -I POSTROUTING -o ens3 -j MASQUERADE Apr 18 17:22:13 thats-my-jam wg-quick[98834]: [#] ip6tables -t nat -I POSTROUTING -o ens3 -j MASQUERADE Apr 18 17:22:13 thats-my-jam systemd[1]: Finished WireGuard via wg-quick(8) for wg0.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u306b\u306f\u3001\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u305fIPv4\u304a\u3088\u3073IPv6\u30a2\u30c9\u30ec\u30b9\u3092\u4eee\u60f3\u306ewg0\u30c7\u30d0\u30a4\u30b9\u306b\u5272\u308a\u5f53\u3066\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u305fip\u30b3\u30de\u30f3\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u306f\u3001\u30c8\u30f3\u30cd\u30eb\u306e\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u4f7f\u7528\u3057\u305f\u308a\u3001\u624b\u52d5\u3067VPN\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u8a2d\u5b9a\u3059\u308b\u5834\u5408\u306b\u306fwg\u30b3\u30de\u30f3\u30c9\u81ea\u4f53\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u304c\u8a2d\u5b9a\u3055\u308c\u3001\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u72b6\u614b\u3067\u3001\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30de\u30b7\u30f3\u3092WireGuard\u306e\u30d4\u30a2\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d77 &#8211; WireGuard\u30d4\u30a2\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/h2>\n<p>WireGuard\u306e\u30d4\u30a2\u306e\u8a2d\u5b9a\u306f\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a\u306b\u4f3c\u3066\u3044\u307e\u3059\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u3001\u516c\u958b\u9375\u3068\u79d8\u5bc6\u9375\u306e\u30da\u30a2\u3092\u751f\u6210\u3057\u3001\u30d4\u30a2\u306b\u5bfe\u3057\u3066IP\u30a2\u30c9\u30ec\u30b9\u3092\u6c7a\u5b9a\u3057\u3001\u30d4\u30a2\u7528\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5b9a\u7fa9\u3057\u3001\u6700\u5f8c\u306bwg-quick\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30f3\u30cd\u30eb\u3092\u958b\u59cb\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u624b\u9806\u306b\u5f93\u3063\u3066\u3001\u30ad\u30fc\u30da\u30a2\u3068\u8a2d\u5b9a\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u3067VPN\u306b\u597d\u304d\u306a\u3060\u3051\u30d4\u30a2\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002VPN\u306b\u8907\u6570\u306e\u30d4\u30a2\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408\u306f\u3001\u500b\u3005\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8IP\u30a2\u30c9\u30ec\u30b9\u3092\u8a18\u9332\u3057\u3066\u885d\u7a81\u3092\u9632\u3050\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>WireGuard\u30d4\u30a2\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u6b21\u306eapt\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066WireGuard\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002WireGuard\u30d4\u30a2\u3067\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> wireguard<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h3>WireGuard\u306e\u30d4\u30a2\u306e\u30ad\u30fc\u30da\u30a2\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h3>\n<p>\u6b21\u306b\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u540c\u3058\u624b\u9806\u3092\u4f7f\u7528\u3057\u3066\u3001\u30d4\u30a2\u3067\u30ad\u30fc\u30da\u30a2\u3092\u751f\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30d4\u30a2\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30d4\u30a2\u306e\u79d8\u5bc6\u9375\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">wg genkey <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/wireguard\/private.key<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">chmod<\/span> <span class=\"token assign-left variable\">go<\/span><span class=\"token operator\">=<\/span> \/etc\/wireguard\/private.key<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u518d\u5ea6\u3001\u30d9\u30fc\u30b964\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f1\u884c\u306e\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002\u3053\u308c\u304c\u79d8\u5bc6\u9375\u3067\u3059\u3002\u51fa\u529b\u306e\u30b3\u30d4\u30fc\u306f\u3001\/etc\/wireguard\/private.key\u306b\u3082\u4fdd\u5b58\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u51fa\u529b\u3055\u308c\u305f\u79d8\u5bc6\u9375\u3092\u6ce8\u610f\u6df1\u304f\u30e1\u30e2\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u306a\u305c\u306a\u3089\u3001\u5f8c\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067WireGuard\u30d4\u30a2\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u516c\u958b\u9375\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002 (Tsugi ni, tsugi no komando o shiyou shite koukai yubi-file o sakusei shite kudasai.)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">cat<\/span> \/etc\/wireguard\/private.key <span class=\"token operator\">|<\/span> wg pubkey <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/wireguard\/public.key<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u518d\u3073\u3001\u30d9\u30fc\u30b964\u3067\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u51fa\u529b\u306e\u5358\u4e00\u884c\u304c\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3042\u306a\u305f\u306eWireGuard\u76f8\u624b\u5148\u306e\u516c\u958b\u9375\u3067\u3059\u3002\u6697\u53f7\u5316\u3055\u308c\u305f\u63a5\u7d9a\u3092\u78ba\u7acb\u3059\u308b\u305f\u3081\u306bWireGuard\u30b5\u30fc\u30d0\u30fc\u306b\u516c\u958b\u9375\u3092\u914d\u5e03\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u53c2\u7167\u306e\u305f\u3081\u306b\u3069\u3053\u304b\u306b\u30b3\u30d4\u30fc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>WireGuard\u30d4\u30a2\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002<\/h3>\n<p>\u9375\u30da\u30a2\u3092\u4f5c\u6210\u3057\u305f\u306e\u3067\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u63a5\u7d9a\u3092\u78ba\u7acb\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u3059\u3079\u3066\u306e\u60c5\u5831\u3092\u542b\u3080\u30d4\u30a2\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u60c5\u5831\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>The base64 encoded private key that you generated on the peer.<\/li>\n<li>The IPv4 and IPv6 address ranges that you defined on the WireGuard Server.<\/li>\n<li>The base64 encoded public key from the WireGuard Server.<\/li>\n<li>The public IP address and port number of the WireGuard Server. Usually this will be the IPv4 address, but if your server has an IPv6 address and your client machine has an IPv6 connection to the internet you can use this instead of IPv4.<\/li>\n<\/ul>\n<p>\u3053\u308c\u3089\u306e\u3059\u3079\u3066\u306e\u60c5\u5831\u3092\u624b\u306b\u5165\u308c\u305f\u3089\u3001WireGuard\u30d4\u30a2\u30de\u30b7\u30f3\u3067nano\u307e\u305f\u306f\u304a\u597d\u307f\u306e\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\u65b0\u3057\u3044\/etc\/wireguard\/wg0.conf\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/wireguard\/wg0.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3092\u5fc5\u8981\u306a\u7b87\u6240\u306b\u4ee3\u5165\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u884c\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"\/etc\/wireguard\/wg0.conf\">\/etc\/wireguard\/wg0.conf<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[Interface] PrivateKey = <mark>base64_encoded_peer_private_key_goes_here<\/mark> Address = <mark>10.8.0.**2**\/24<\/mark> Address = <mark>fd24:609a:6c18::**2**\/64<\/mark> [Peer] PublicKey = <mark>U9uE2kb\/nrrzsEU58GD3pKFU3TLYDMCbetIsnV8eeFE=<\/mark> AllowedIPs = <mark>10.8.0.0\/24<\/mark>, <mark>fd24:609a:6c18::\/64<\/mark> Endpoint = <mark>203.0.113.1<\/mark>:51820<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6700\u521d\u306e\u30a2\u30c9\u30ec\u30b9\u884c\u304c\u3001\u524d\u306b\u9078\u629e\u3057\u305f10.8.0.0\/24\u30b5\u30d6\u30cd\u30c3\u30c8\u304b\u3089\u306eIPv4\u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306eIP\u30a2\u30c9\u30ec\u30b9\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u306eIP\u3068\u7570\u306a\u308b\u9650\u308a\u3001\u30b5\u30d6\u30cd\u30c3\u30c8\u5185\u306e\u4f55\u3067\u3082\u69cb\u3044\u307e\u305b\u3093\u3002\u30d4\u30a2\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3073\u306b\u30a2\u30c9\u30ec\u30b9\u30921\u305a\u3064\u5897\u3084\u3059\u3053\u3068\u306f\u3001\u4e00\u822c\u7684\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u5272\u308a\u5f53\u3066\u308b\u6700\u3082\u7c21\u5358\u306a\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u540c\u69d8\u306b\u3001\u5148\u306b\u751f\u6210\u3057\u305f\u30b5\u30d6\u30cd\u30c3\u30c8\u306eIPv6\u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\u3057\u305f2\u756a\u76ee\u306e\u30a2\u30c9\u30ec\u30b9\u884c\u304c\u3042\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u30a2\u30c9\u30ec\u30b9\u304c1\u3064\u5897\u3048\u3066\u3044\u307e\u3059\u3002\u7570\u306a\u308b\u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3067\u3082\u3001\u7bc4\u56f2\u5185\u306e\u3069\u306eIP\u30a2\u30c9\u30ec\u30b9\u3067\u3082\u6709\u52b9\u3067\u3059\u3002<\/p>\n<p>\u30d5\u30a1\u30a4\u30eb\u306e\u3082\u3046\u4e00\u3064\u6ce8\u76ee\u3059\u3079\u304d\u90e8\u5206\u306f\u3001\u6700\u5f8c\u306eAllowedIPs\u884c\u3067\u3059\u3002\u3053\u306eIPv4\u3068IPv6\u306e\u7bc4\u56f2\u306f\u3001\u5b9b\u5148\u30b7\u30b9\u30c6\u30e0\u306eIP\u30a2\u30c9\u30ec\u30b9\u304c\u3069\u3061\u3089\u304b\u306e\u7bc4\u56f2\u306b\u3042\u308b\u5834\u5408\u306b\u306e\u307f\u3001\u30d4\u30a2\u304cVPN\u3092\u4ecb\u3057\u3066\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9001\u4fe1\u3059\u308b\u3088\u3046\u6307\u793a\u3057\u307e\u3059\u3002AllowedIPs\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30d4\u30a2\u4e0a\u306eVPN\u3092\u4ed6\u306e\u30d4\u30a2\u3084VPN\u4e0a\u306e\u30b5\u30fc\u30d3\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u3088\u3046\u306b\u5236\u9650\u3057\u305f\u308a\u3001\u8a2d\u5b9a\u3092\u8abf\u6574\u3057\u3066VPN\u3092\u4ecb\u3057\u3066\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30c8\u30f3\u30cd\u30eb\u5316\u3057\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u3092\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057IPv4\u3060\u3051\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u672b\u5c3e\u306efd24:609a:6c18::\/64\u306e\u7bc4\u56f2\uff08\u30ab\u30f3\u30de\u3082\u542b\u3080\uff09\u3092\u7701\u7565\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u9006\u306b\u3001IPv6\u3060\u3051\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001fd24:609a:6c18::\/64\u306e\u63a5\u982d\u8f9e\u3060\u3051\u3092\u542b\u3081\u300110.8.0.0\/24\u306eIPv4\u306e\u7bc4\u56f2\u306f\u7701\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3069\u3061\u3089\u306e\u5834\u5408\u3067\u3082\u3001\u3059\u3079\u3066\u306e\u30d4\u30a2\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092VPN\u3092\u4ecb\u3057\u3066\u9001\u4fe1\u3057\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u3092\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u3057\u3066\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u306f\u3001IPv4\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\u5168\u4f53\u3092\u8868\u30590.0.0.0\/0\u3001\u304a\u3088\u3073IPv6\u30a2\u30c9\u30ec\u30b9\u7a7a\u9593\u5168\u4f53\u3092\u8868\u3059::\/0\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>(\u4efb\u610f) \u30d4\u30a2\u3092\u8a2d\u5b9a\u3057\u3001\u30c8\u30f3\u30cd\u30eb\u4e0a\u306e\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u884c\u3046<\/h3>\n<p>\u3082\u3057\u3001\u30d4\u30a2\u306e\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30c8\u30f3\u30cd\u30eb\u7d4c\u7531\u30670.0.0.0\/0\u307e\u305f\u306f::\/0\u306e\u30eb\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3059\u308b\u3053\u3068\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u3001\u30d4\u30a2\u304c\u30ea\u30e2\u30fc\u30c8\u30b7\u30b9\u30c6\u30e0\u3067\u3042\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u624b\u9806\u3092\u5b8c\u4e86\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30d4\u30a2\u304c\u30ed\u30fc\u30ab\u30eb\u30b7\u30b9\u30c6\u30e0\u3067\u3042\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u306e\u304c\u6700\u5584\u3067\u3059\u3002<\/p>\n<p>SSH\u3084\u4ed6\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u4f7f\u7528\u3057\u3066\u516c\u958bIP\u30a2\u30c9\u30ec\u30b9\u7d4c\u7531\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30ea\u30e2\u30fc\u30c8\u30d4\u30a2\u306b\u306f\u3001\u30d4\u30a2\u306ewg0.conf\u30d5\u30a1\u30a4\u30eb\u306b\u3044\u304f\u3064\u304b\u306e\u8ffd\u52a0\u30eb\u30fc\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u306b\u3088\u308a\u3001\u30c8\u30f3\u30cd\u30eb\u304c\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u3068\u304d\u306b\u3082\u30c8\u30f3\u30cd\u30eb\u306e\u5916\u90e8\u304b\u3089\u30d4\u30a2\u30b7\u30b9\u30c6\u30e0\u306b\u63a5\u7d9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3046\u3057\u306a\u3044\u3068\u3001\u30c8\u30f3\u30cd\u30eb\u304c\u78ba\u7acb\u3055\u308c\u308b\u3068\u3001\u901a\u5e38\u306f\u516c\u958b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u51e6\u7406\u3055\u308c\u308b\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304cwg0\u30c8\u30f3\u30cd\u30eb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u8fc2\u56de\u3059\u308b\u3088\u3046\u306b\u6b63\u3057\u304f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3055\u308c\u306a\u3044\u305f\u3081\u3001\u30ea\u30e2\u30fc\u30c8\u30b7\u30b9\u30c6\u30e0\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u30d4\u30a2\u30b7\u30b9\u30c6\u30e0\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u3057\u3066\u4f7f\u7528\u3059\u308bIP\u30a2\u30c9\u30ec\u30b9\u3092\u7279\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e ip route \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">ip<\/span> route list table main default<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>default via <mark>203.0.113.1<\/mark> dev <mark>eth0<\/mark> proto static<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5f8c\u3067\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3001\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305fIP\u30a2\u30c9\u30ec\u30b9203.0.113.1\u3068\u30c7\u30d0\u30a4\u30b9eth0\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u304a\u4f7f\u3044\u306e\u30c7\u30d0\u30a4\u30b9\u540d\u304c\u7570\u306a\u308b\u5834\u5408\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u305d\u308c\u306b\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001ip\u30a2\u30c9\u30ec\u30b9\u8868\u793a\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30d4\u30a2\u30b7\u30b9\u30c6\u30e0\u306e\u30d1\u30d6\u30ea\u30c3\u30afIP\u3092\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u8abf\u3079\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">ip<\/span> <span class=\"token parameter variable\">-brief<\/span> address show <mark>eth0<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>eth0 UP <mark>203.0.113.5<\/mark>\/20 10.20.30.40\/16 2604:a880:400:d1::3d3:6001\/64 fe80::68d5:beff:feff:974c\/64<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u3053\u306e\u4f8b\u306e\u51fa\u529b\u3067\u306f\u3001\u5f37\u8abf\u3055\u308c\u305f203.0.113.5 IP\u30a2\u30c9\u30ec\u30b9\uff08\/20\u306e\u5f8c\u308d\u306e\u90e8\u5206\u3092\u9664\u304f\uff09\u306f\u3001eth0\u30c7\u30d0\u30a4\u30b9\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d1\u30d6\u30ea\u30c3\u30af\u30a2\u30c9\u30ec\u30b9\u3067\u3042\u308a\u3001WireGuard\u306e\u30d4\u30a2\u8a2d\u5b9a\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u30a2\u30c9\u30ec\u30b9\u3067\u3059\u3002<\/p>\n<p>\u4eca\u3001WireGuard\u306e\u30d4\u30a2\u306e\/etc\/wireguard\/wg0.conf\u30d5\u30a1\u30a4\u30eb\u3092nano\u3084\u304a\u597d\u307f\u306e\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/wireguard\/wg0.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[Peer] \u884c\u306e\u524d\u306b\u3001\u6b21\u306e4\u884c\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>PostUp = ip rule add table 200 from <mark>203.0.113.5<\/mark>\r\nPostUp = ip route add table 200 default via <mark>203.0.113.1<\/mark>\r\nPreDown = ip rule delete table 200 from <mark>203.0.113.5<\/mark>\r\nPreDown = ip route delete table 200 default via <mark>203.0.113.1<\/mark>\r\n\r\n[Peer]\r\n. . .\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3089\u306e\u884c\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30eb\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3001\u30d4\u30a2\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u30d1\u30d6\u30ea\u30c3\u30af\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u30ab\u30b9\u30bf\u30e0\u30eb\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>PostUp = ip rule add table 200 from 203.0.113.5 &#8211; This command creates a rule that checks for any routing entries in the table numbered 200 when the IP matches the peer system\u2019s public 203.0.113.5 address.<\/li>\n<li>PostUp = ip route add table 200 default via 203.0.113.1 &#8211; This command ensures that any traffic being processed by the 200 table will use the 203.0.113.1 gateway for routing, instead of the WireGuard interface.<\/li>\n<\/ul>\n<p>\u30c8\u30f3\u30cd\u30eb\u304c\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3055\u308c\u308b\u3068\u3001PreDown\u306e\u884c\u306f\u30ab\u30b9\u30bf\u30e0\u30eb\u30fc\u30eb\u3068\u30eb\u30fc\u30c8\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-info\">\n<p class=\"post-conf-desc\">Info<\/p>\n<div>\u6ce8\u610f\uff1a\u3053\u308c\u3089\u306e\u30eb\u30fc\u30eb\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306b\u3001\u30c6\u30fc\u30d6\u30eb\u756a\u53f7200\u306f\u4efb\u610f\u3067\u3059\u30022\u304b\u3089252\u306e\u5024\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3057\u3001\/etc\/iproute2\/rt_tables\u30d5\u30a1\u30a4\u30eb\u306b\u30e9\u30d9\u30eb\u3092\u8ffd\u52a0\u3057\u3066\u540d\u524d\u3067\u53c2\u7167\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\nLinux\u3067\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30c6\u30fc\u30d6\u30eb\u306e\u52d5\u4f5c\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u306f\u3001\u300cGuide to IP Layer Network Administration with Linux\u300d\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30c6\u30fc\u30d6\u30eb\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n<p>\u30d4\u30a2\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u3059\u3079\u3066VPN\u7d4c\u7531\u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u30b9\u30c6\u30c3\u30d74\u306eWireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u306e\u6b63\u3057\u3044sysctl\u3068iptables\u30eb\u30fc\u30eb\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u30b9\u30c6\u30c3\u30d75\u306eWireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u306e\u8a2d\u5b9a\u3082\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\uff08\u4efb\u610f\uff09WireGuard\u30d4\u30a2\u306eDNS\u30ea\u30be\u30eb\u30d0\u306e\u8a2d\u5b9a<\/h3>\n<p>\u3082\u3057WireGuard\u30b5\u30fc\u30d0\u3092VPN\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u3057\u3066\u4f7f\u7528\u3057\u3001\u3059\u3079\u3066\u306e\u30d4\u30a2\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3059\u308b\u5834\u5408\u3001[Interface]\u30bb\u30af\u30b7\u30e7\u30f3\u306bDNS\u30ea\u30be\u30eb\u30d0\u30fc\u3092\u6307\u5b9a\u3059\u308b\u884c\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u306a\u3044\u3068\u3001VPN\u306b\u3088\u308bDNS\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4fdd\u8b77\u304c\u884c\u308f\u308c\u306a\u3044\u304b\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30d0\u30a4\u30c0\uff08ISP\uff09\u3084\u4ed6\u306e\u7b2c\u4e09\u8005\u306b\u516c\u958b\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057VPN\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u304b\u3001\u30d4\u30a2\u30fb\u30c4\u30fc\u30fb\u30d4\u30a2\u306e\u8a2d\u5b9a\u3067WireGuard\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u306f\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u81ea\u5206\u306e\u30d4\u30a2\u306e\u8a2d\u5b9a\u306bDNS\u30ea\u30be\u30eb\u30d0\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001\u307e\u305a\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u304c\u4f7f\u7528\u3057\u3066\u3044\u308bDNS\u30b5\u30fc\u30d0\u30fc\u3092\u7279\u5b9a\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092WireGuard\u30b5\u30fc\u30d0\u30fc\u3067\u5b9f\u884c\u3057\u3001\u4f8b\u3067\u793a\u3055\u308c\u305feth0\u4ee5\u5916\u306e\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u30c7\u30d0\u30a4\u30b9\u540d\u3092\u4ee3\u308f\u308a\u306b\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">resolvectl dns <mark>eth0<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Link 2 (eth0): 67.207.67.2 67.207.67.3 2001:4860:4860::8844 2001:4860:4860::8888<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u51fa\u529b\u3055\u308c\u308bIP\u30a2\u30c9\u30ec\u30b9\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u4f7f\u7528\u3057\u3066\u3044\u308bDNS\u30ea\u30be\u30eb\u30d0\u3067\u3059\u3002\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u3001\u305d\u308c\u3089\u306e\u4e2d\u304b\u3089\u3044\u305a\u308c\u304b\u307e\u305f\u306f\u3059\u3079\u3066\u3092\u4f7f\u7528\u3059\u308b\u304b\u3001IPv4\u307e\u305f\u306fIPv6\u306e\u307f\u3092\u4f7f\u7528\u3059\u308b\u304b\u3092\u9078\u629e\u3067\u304d\u307e\u3059\u3002\u4f7f\u7528\u3059\u308b\u30ea\u30be\u30eb\u30d0\u3092\u30e1\u30e2\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001\u9078\u629e\u3057\u305f\u30ea\u30be\u30eb\u30d0\u30fc\u3092WireGuard\u30d4\u30a2\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002WireGuard\u30d4\u30a2\u306b\u623b\u308a\u3001nano\u307e\u305f\u306f\u304a\u597d\u307f\u306e\u30a8\u30c7\u30a3\u30bf\u3092\u4f7f\u7528\u3057\u3066\/etc\/wireguard\/wg0.conf\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/wireguard\/wg0.conf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u300c[Peer]\u300d\u884c\u306e\u524d\u306b\u3001\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>DNS = <mark>67.207.67.2 2001:4860:4860::8844<\/mark>\r\n\r\n[Peer]\r\n. . .\r\n<\/code><\/pre>\n<p>\u518d\u3073\u3001IPv4\u3068IPv6\u306b\u5bfe\u3059\u308b\u597d\u307f\u3084\u8981\u4ef6\u306b\u5fdc\u3058\u3066\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30ea\u30b9\u30c8\u3092\u7de8\u96c6\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"post-conf-info\">\n<p class=\"post-conf-desc\">Info<\/p>\n<div>\u4ee5\u4e0b\u306e\u624b\u9806\u3067VPN\u306b\u63a5\u7d9a\u3057\u305f\u5f8c\u3001DNS\u30ea\u30af\u30a8\u30b9\u30c8\u304cVPN\u7d4c\u7531\u3067\u9001\u4fe1\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u3001DNS\u30ea\u30fc\u30af\u30c6\u30b9\u30c8.com\u306e\u3088\u3046\u306a\u30b5\u30a4\u30c8\u3092\u4f7f\u7528\u3057\u3066\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001resolvectl dns\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u8a2d\u5b9a\u3055\u308c\u305f\u30ea\u30be\u30eb\u30d0\u3092\u76f8\u624b\u65b9\u304c\u4f7f\u7528\u3057\u3066\u3044\u308b\u304b\u3082\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u5b9f\u884c\u3057\u305f\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002VPN\u30c8\u30f3\u30cd\u30eb\u306e\u305f\u3081\u306b\u8a2d\u5b9a\u3057\u305fDNS\u30ea\u30be\u30eb\u30d0\u304c\u8868\u793a\u3055\u308c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5f97\u3089\u308c\u308b\u3079\u304d\u3067\u3059\uff1a<br \/>\nOutputGlobal: 67.207.67.2 67.207.67.3<br \/>\n. . .<\/div>\n<\/div>\n<p>\u3053\u308c\u3089\u306eDNS\u30ea\u30be\u30eb\u30d0\u8a2d\u5b9a\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u30b5\u30fc\u30d0\u306b\u30d4\u30a2\u306e\u516c\u958b\u9375\u3092\u8ffd\u52a0\u3057\u3001\u30d4\u30a2\u3067WireGuard\u30c8\u30f3\u30cd\u30eb\u3092\u958b\u59cb\u3059\u308b\u6e96\u5099\u304c\u6574\u3044\u307e\u3057\u305f\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d78 \u2014 WireGuard\u30b5\u30fc\u30d0\u30fc\u306b\u30d4\u30a2\u306e\u516c\u958b\u9375\u3092\u8ffd\u52a0\u3059\u308b<\/h2>\n<p>WireGuard\u30b5\u30fc\u30d0\u30fc\u306b\u30d4\u30a2\u3092\u63a5\u7d9a\u3059\u308b\u524d\u306b\u3001\u30d4\u30a2\u306e\u516c\u958b\u9375\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u306e\u624b\u9806\u306b\u3088\u308a\u3001VPN\u7d4c\u7531\u3067\u63a5\u7d9a\u3057\u3066\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u624b\u9806\u3092\u5b8c\u4e86\u3057\u306a\u3044\u3068\u3001WireGuard\u30b5\u30fc\u30d0\u30fc\u306f\u30d4\u30a2\u304c\u30c8\u30f3\u30cd\u30eb\u4e0a\u3067\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u9001\u53d7\u4fe1\u3059\u308b\u3053\u3068\u3092\u8a31\u53ef\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u300cWireGuard Peer\u300d\u306e\u305f\u3081\u306eBase64\u30a8\u30f3\u30b3\u30fc\u30c9\u3055\u308c\u305f\u516c\u958b\u9375\u306e\u30b3\u30d4\u30fc\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">cat<\/span> \/etc\/wireguard\/public.key<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p><mark>PeURxj4Q75RaVhBKkRTpNsBPiPSGb5oQijgJsTa29hg=<\/mark><\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>WireGuard\u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg <span class=\"token builtin class-name\">set<\/span> wg0 peer <span class=\"token assign-left variable\">PeURxj4Q75RaVhBKkRTpNsBPiPSGb5oQijgJsTa29hg<\/span><span class=\"token operator\">=<\/span> allowed-ips <mark><span class=\"token number\">10.8<\/span>.0.2<\/mark>,<mark>fd24:609a:6c18::2<\/mark><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u306eallowed-ips\u306e\u90e8\u5206\u306f\u3001IPv4\u304a\u3088\u3073IPv6\u30a2\u30c9\u30ec\u30b9\u306e\u30ab\u30f3\u30de\u533a\u5207\u308a\u30ea\u30b9\u30c8\u3092\u53d6\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30d4\u30a2\u304c\u81ea\u5206\u81ea\u8eab\u306b\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u308bIP\u30a2\u30c9\u30ec\u30b9\u3092\u5236\u9650\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u500b\u5225\u306eIP\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3001\u4f8b\u306e\u3088\u3046\u306b\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u30012\u3064\u306e\u30d4\u30a2\u304c\u540c\u3058allowed-ips\u306e\u8a2d\u5b9a\u3092\u6301\u3064\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u65e2\u5b58\u306e\u30d4\u30a2\u306e\u8a31\u53ef\u3055\u308c\u305fIP\u30a2\u30c9\u30ec\u30b9\u3092\u66f4\u65b0\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u540c\u3058\u30b3\u30de\u30f3\u30c9\u3092\u518d\u5b9f\u884c\u3057\u3066IP\u30a2\u30c9\u30ec\u30b9\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8907\u6570\u306eIP\u30a2\u30c9\u30ec\u30b9\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u8ffd\u52a0\u3057\u305fWireGuard\u30d4\u30a2\u306b10.8.0.2\u3068fd24:609a:6c18::2\u306eIP\u30a2\u30c9\u30ec\u30b9\u306b\u52a0\u3048\u306610.8.0.100\u306eIP\u3092\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg <span class=\"token builtin class-name\">set<\/span> wg0 peer <span class=\"token assign-left variable\">PeURxj4Q75RaVhBKkRTpNsBPiPSGb5oQijgJsTa29hg<\/span><span class=\"token operator\">=<\/span> allowed-ips <span class=\"token number\">10.8<\/span>.0.2,<mark>10.8.0.100<\/mark>,fd24:609a:6c18::2<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d4\u30a2\u3092\u8ffd\u52a0\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u5f8c\u3001\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067wg\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30c8\u30f3\u30cd\u30eb\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>interface: wg0 public key: U9uE2kb\/nrrzsEU58GD3pKFU3TLYDMCbetIsnV8eeFE= private key: (hidden) listening port: 51820 peer: PeURxj4Q75RaVhBKkRTpNsBPiPSGb5oQijgJsTa29hg= allowed ips: 10.8.0.2\/32, fd24:609a:6c18::\/128<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30ef\u30a4\u30e4\u30fc\u30ac\u30fc\u30c9\u306e\u30d4\u30a2\u30e9\u30a4\u30f3\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30d4\u30a2\u306e\u516c\u958b\u9375\u3084\u3001IP\u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f\u8a31\u53ef\u3055\u308c\u305f\u7bc4\u56f2\u306b\u3064\u3044\u3066\u3001\u81ea\u8eab\u306b\u5272\u308a\u5f53\u3066\u308bIP\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u30d4\u30a2\u306e\u63a5\u7d9a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u5b9a\u7fa9\u3057\u305f\u306e\u3067\u3001\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u30d4\u30a2\u4e0a\u3067\u30c8\u30f3\u30cd\u30eb\u3092\u958b\u59cb\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<h2>\u30b9\u30c6\u30c3\u30d79 \u2014 WireGuard\u30d4\u30a2\u3092\u30c8\u30f3\u30cd\u30eb\u306b\u63a5\u7d9a\u3059\u308b<\/h2>\n<p>\u4eca\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u30d4\u30a2\u306e\u4e21\u65b9\u304cIPv4\u3001IPv6\u3001\u30d1\u30b1\u30c3\u30c8\u8ee2\u9001\u3001\u304a\u3088\u3073DNS\u89e3\u6c7a\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001VPN\u30c8\u30f3\u30cd\u30eb\u306b\u30d4\u30a2\u3092\u63a5\u7d9a\u3059\u308b\u6642\u304c\u6765\u307e\u3057\u305f\u3002<\/p>\n<p>\u7279\u5b9a\u306e\u4f7f\u7528\u30b1\u30fc\u30b9\u3067\u306e\u307fVPN\u3092\u30aa\u30f3\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u63a5\u7d9a\u3092\u624b\u52d5\u3067\u78ba\u7acb\u3059\u308b\u305f\u3081\u306bwg-quick\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u3068\u540c\u69d8\u306b\u30c8\u30f3\u30cd\u30eb\u306e\u8d77\u52d5\u3092\u81ea\u52d5\u5316\u3057\u305f\u3044\u5834\u5408\u306f\u3001wq-quick\u30b3\u30de\u30f3\u30c9\u306e\u4ee3\u308f\u308a\u306b\u300c\u30b9\u30c6\u30c3\u30d76 &#8211; WireGuard\u30b5\u30fc\u30d0\u30fc\u306e\u8d77\u52d5\u300d\u30bb\u30af\u30b7\u30e7\u30f3\u306e\u624b\u9806\u306b\u5f93\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3059\u3079\u3066\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092VPN\u7d4c\u7531\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3057\u3001DNS\u8ee2\u9001\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30c8\u30f3\u30cd\u30eb\u3092\u958b\u59cb\u3059\u308b\u524d\u306bWireGuard\u306e\u30d4\u30a2\u306bresolvconf\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u3053\u308c\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> resolvconf<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30c8\u30f3\u30cd\u30eb\u3092\u958b\u59cb\u3059\u308b\u305f\u3081\u306b\u3001WireGuard Peer\u4e0a\u3067\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg-quick up wg0<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[#] ip link add wg0 type wireguard [#] wg setconf wg0 \/dev\/fd\/63 [#] ip -4 address add <mark>10.8.0.2\/24<\/mark> dev wg0 [#] ip -6 address add <mark>fd24:609a:6c18::2\/64<\/mark> dev wg0 [#] ip link set mtu 1420 up dev wg0 [#] resolvconf -a tun.wg0 -m 0 -x<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305fIPv4\u304a\u3088\u3073IPv6\u30a2\u30c9\u30ec\u30b9\u3092\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3082\u3057\u30d4\u30a2\u306eAllowedIPs\u30920.0.0.0\/0\u3068::\/0\u306b\u8a2d\u5b9a\u3059\u308b\u304b\u3001VPN\u3067\u9078\u629e\u3057\u305f\u7bc4\u56f2\u4ee5\u5916\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u51fa\u529b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[#] ip link add wg0 type wireguard [#] wg setconf wg0 \/dev\/fd\/63 [#] ip -4 address add <mark>10.8.0.2\/24<\/mark> dev wg0 [#] ip -6 address add <mark>fd24:609a:6c18::2\/64<\/mark> dev wg0 [#] ip link set mtu 1420 up dev wg0 [#] resolvconf -a tun.wg0 -m 0 -x [#] wg set wg0 fwmark 51820 [#] ip -6 route add <mark>::\/0<\/mark> dev wg0 table 51820 [#] ip -6 rule add not fwmark 51820 table 51820 [#] ip -6 rule add table main suppress_prefixlength 0 [#] ip6tables-restore -n [#] ip -4 route add <mark>0.0.0.0\/0<\/mark> dev wg0 table 51820 [#] ip -4 rule add not fwmark 51820 table 51820 [#] ip -4 rule add table main suppress_prefixlength 0 [#] sysctl -q net.ipv4.conf.all.src_valid_mark=1 [#] iptables-restore -n<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>In this example, the routes that the command added, which are highlighted, correspond to the AllowedIPs set in the peer configuration.<\/p>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u30b3\u30de\u30f3\u30c9\u306b\u3088\u3063\u3066\u8ffd\u52a0\u3055\u308c\u305f\u30cf\u30a4\u30e9\u30a4\u30c8\u3055\u308c\u305f\u30eb\u30fc\u30c8\u306f\u3001\u30d4\u30a2\u306e\u8a2d\u5b9a\u306eAllowedIPs\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>wg\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30d4\u30a2\u306e\u30c8\u30f3\u30cd\u30eb\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>interface: wg0 public key: PeURxj4Q75RaVhBKkRTpNsBPiPSGb5oQijgJsTa29hg= private key: (hidden) listening port: 49338 fwmark: 0xca6c peer: U9uE2kb\/nrrzsEU58GD3pKFU3TLYDMCbetIsnV8eeFE= endpoint: 203.0.113.1:51820 allowed ips: 10.8.0.0\/24, fd24:609a:6c18::\/64 latest handshake: 1 second ago transfer: 6.50 KiB received, 15.41 KiB sent<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u3082\u518d\u5ea6\u72b6\u614b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3057\u3001\u540c\u69d8\u306e\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>VPN\u306e\u4f7f\u7528\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001ip route\u3068ip -6 route\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u540c\u50da\u306eVPN\u5229\u7528\u3092\u691c\u8a3c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057VPN\u3092\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001CloudFlare\u306e1.1.1.1\u304a\u3088\u30732606:4700:4700::1111\u306eDNS\u30ea\u30be\u30eb\u30d0\u306b\u5b9b\u3066\u305f\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306b\u4f7f\u7528\u3055\u308c\u308b\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u3082\u3057VPN\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306bWireGuard\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u6709\u52b9\u306aIPv4\u307e\u305f\u306fIPv6\u30a2\u30c9\u30ec\u30b9\uff08\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u81ea\u4f53\uff09\u3092\u3053\u308c\u3089\u306e\u30b3\u30de\u30f3\u30c9\u306b\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4f8b\u3048\u3070\u300110.8.0.1\u307e\u305f\u306ffd24:609a:6c18::1\u3067\u3059\u3002<\/div>\n<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">ip<\/span> route get <span class=\"token number\">1.1<\/span>.1.1<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>1.1.1.1 dev <mark>wg0<\/mark> table 51820 src <mark>10.8.0.2<\/mark> uid 1000 cache<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3001wg0\u30c7\u30d0\u30a4\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u304a\u308a\u3001\u30d4\u30a2\u306b\u5272\u308a\u5f53\u3066\u305fIPv4\u30a2\u30c9\u30ec\u30b9\u306f10.8.0.2\u3067\u3059\u3002\u540c\u69d8\u306b\u3001IPv6\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">ip<\/span> <span class=\"token parameter variable\">-6<\/span> route get <span class=\"token number\">2606<\/span>:4700:4700::1111<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>2606:4700:4700::1111 from :: dev wg0 table 51820 src <mark>fd24:609a:6c18::2<\/mark> metric 1024 pref medium<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u518d\u5ea6\u3001wg0\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3068\u30d4\u30a2\u306b\u5272\u308a\u5f53\u3066\u305fIPv6\u30a2\u30c9\u30ec\u30b9fd24:609a:6c18::2\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3082\u3057\u540c\u50da\u304c\u30d6\u30e9\u30a6\u30b6\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u5834\u5408\u3001ipleak.net\u3068ipv6-test.com\u3092\u8a2a\u308c\u308b\u3053\u3068\u3067\u3001\u540c\u50da\u304cVPN\u3092\u4ecb\u3057\u3066\u901a\u4fe1\u3092\u884c\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30d4\u30a2\u304b\u3089VPN\u3092\u5207\u65ad\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u3001wg-quick\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u5207\u65ad\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg-quick down wg0<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>VPN\u30c8\u30f3\u30cd\u30eb\u304c\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u793a\u3059\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u304c\u5c4a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[#] ip link delete dev wg0 [#] resolvconf -d tun.wg0 -f<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u30d4\u30a2\u306eAllowedIPs\u30920.0.0.0\/0\u304a\u3088\u3073::\/0\u306b\u8a2d\u5b9a\u3059\u308b\uff08\u307e\u305f\u306fVPN\u3067\u9078\u629e\u3057\u305f\u7bc4\u56f2\u4ee5\u5916\u306e\u7bc4\u56f2\u3092\u4f7f\u7528\u3059\u308b\uff09\u3068\u3001\u51fa\u529b\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>[#] ip rule delete table 200 from 203.0.113.5 [#] ip route delete table 200 default via 203.0.113.1 [#] ip -4 rule delete table 51820 [#] ip -4 rule delete table main suppress_prefixlength 0 [#] ip -6 rule delete table 51820 [#] ip -6 rule delete table main suppress_prefixlength 0 [#] ip link delete dev wg0 [#] resolvconf -d tun.wg0 -f [#] iptables-restore -n [#] ip6tables-restore -n<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>VPN\u306e\u63a5\u7d9a\u3092\u518d\u78ba\u7acb\u3059\u308b\u306b\u306f\u3001\u518d\u3073\u30d4\u30a2\u4e0a\u3067wg-quick up wg0\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002WireGuard\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30d4\u30a2\u306e\u8a2d\u5b9a\u3092\u5b8c\u5168\u306b\u524a\u9664\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u524a\u9664\u3057\u305f\u3044\u30d4\u30a2\u306e\u6b63\u3057\u3044\u516c\u958b\u30ad\u30fc\u3092\u4f7f\u7528\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\"><span class=\"token function\">sudo<\/span> wg <span class=\"token builtin class-name\">set<\/span> wg0 peer <mark><span class=\"token assign-left variable\">PeURxj4Q75RaVhBKkRTpNsBPiPSGb5oQijgJsTa29hg<\/span><span class=\"token operator\">=<\/span><\/mark> remove<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u901a\u5e38\u3001\u30d4\u30a2\u306e\u8a2d\u5b9a\u3092\u524a\u9664\u3059\u308b\u5fc5\u8981\u306f\u3001\u305d\u306e\u30d4\u30a2\u304c\u5b58\u5728\u3057\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u3084\u3001\u6697\u53f7\u5316\u30ad\u30fc\u304c\u5371\u967a\u306b\u3055\u3089\u3055\u308c\u305f\u308a\u5909\u66f4\u3055\u308c\u305f\u308a\u3057\u305f\u5834\u5408\u306b\u9650\u3089\u308c\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306f\u3001\u30d4\u30a2\u304cVPN\u306b\u518d\u63a5\u7d9a\u3059\u308b\u969b\u306b\u3001\u30ad\u30fc\u3068\u8a31\u53ef\u3055\u308c\u305fIP\u3092\u6bce\u56de\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u3088\u3046\u306b\u3001\u8a2d\u5b9a\u3092\u305d\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u65b9\u304c\u826f\u3044\u3067\u3059\u3002<\/p>\n<h2>\u7d50\u8ad6<\/h2>\n<p>\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u3042\u306a\u305f\u306f\u30b5\u30fc\u30d0\u30fc\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306eDebian 11\u30b7\u30b9\u30c6\u30e0\u306e\u4e21\u65b9\u306bWireGuard\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u30c4\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u3002WireGuard\u306e\u305f\u3081\u306b\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u30eb\u30fc\u30eb\u3092\u8a2d\u5b9a\u3057\u3001\u30b5\u30fc\u30d0\u30fc\u3067sysctl\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30d1\u30b1\u30c3\u30c8\u8ee2\u9001\u3092\u8a31\u53ef\u3059\u308b\u305f\u3081\u306e\u30ab\u30fc\u30cd\u30eb\u8a2d\u5b9a\u3092\u69cb\u6210\u3057\u307e\u3057\u305f\u3002\u307e\u305f\u3001WireGuard\u306e\u79d8\u5bc6\u9375\u3068\u516c\u958b\u9375\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5\u3084\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u30d4\u30a2\uff08\u307e\u305f\u306f\u30d4\u30a2\uff09\u3092\u4e92\u3044\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u65b9\u6cd5\u3082\u5b66\u3073\u307e\u3057\u305f\u3002<\/p>\n<p>\u3082\u3057\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304cIPv6\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30d4\u30a2\u63a5\u7d9a\u306b\u4f7f\u7528\u3059\u308b\u56fa\u6709\u306e\u30ed\u30fc\u30ab\u30eb\u30a2\u30c9\u30ec\u30b9\u7bc4\u56f2\u306e\u751f\u6210\u65b9\u6cd5\u3082\u5b66\u3073\u307e\u3057\u305f\u3002\u3055\u3089\u306b\u3001\u30d4\u30a2\u304c\u4f7f\u7528\u3067\u304d\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u5236\u9650\u3059\u308b\u3053\u3068\u3067\u3001\u3069\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304cVPN\u3092\u901a\u904e\u3059\u308b\u304b\u3092\u5236\u9650\u3059\u308b\u65b9\u6cd5\u3084\u3001\u3059\u3079\u3066\u306e\u30d4\u30a2\u306e\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u51e6\u7406\u3059\u308bVPN\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3068\u3057\u3066WireGuard\u30b5\u30fc\u30d0\u30fc\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3082\u5b66\u3073\u307e\u3057\u305f\u3002<\/p>\n<p>WireGuard\u306b\u3064\u3044\u3066\u3088\u308a\u8a73\u3057\u304f\u5b66\u3073\u305f\u3044\u5834\u5408\u306f\u3001\u3088\u308a\u9ad8\u5ea6\u306a\u30c8\u30f3\u30cd\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u65b9\u6cd5\u3084\u30b3\u30f3\u30c6\u30ca\u3068\u4e00\u7dd2\u306bWireGuard\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u306a\u3069\u306b\u3064\u3044\u3066\u306f\u3001\u516c\u5f0f\u306eWireGuard\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0e\u5165 WireGuard\u306f\u3001IPv4\u304a\u3088\u3073IPv6\u63a5\u7d9a\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u8efd\u91cf\u306a\u4eee\u60f3\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\uff08VPN\uff09\u3067\u3059\u3002VPN\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306b\u3044\u308b\u304b\u306e\u3088\u3046\u306b\u3001\u4fe1\u983c\u3055\u308c\u3066\u3044\u306a\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u901a\u904e\u3059\u308b [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,18],"class_list":["post-90","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-18"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11\u3067wireguard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11\u3067wireguard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u65b9\u6cd5\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-27T00:26:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T04:56:47+00:00\" \/>\n<meta name=\"author\" content=\"\u84ee, \u7ffc\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u84ee, \u7ffc\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"67\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\",\"name\":\"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-08-27T00:26:51+00:00\",\"dateModified\":\"2025-07-31T04:56:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\"},\"description\":\"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\",\"name\":\"\u84ee, \u7ffc\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"caption\":\"\u84ee, \u7ffc\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5 - Blog - Silicon Cloud","description":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11\u3067wireguard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u65b9\u6cd5\/","og_locale":"ja_JP","og_type":"article","og_title":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5","og_description":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11\u3067wireguard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u65b9\u6cd5\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-27T00:26:51+00:00","article_modified_time":"2025-07-31T04:56:47+00:00","author":"\u84ee, \u7ffc","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u84ee, \u7ffc","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"67\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/","name":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-08-27T00:26:51+00:00","dateModified":"2025-07-31T04:56:47+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413"},"description":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Debian 11\u3067WireGuard\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413","name":"\u84ee, \u7ffc","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","caption":"\u84ee, \u7ffc"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/debian-11%e3%81%a7wireguard%e3%82%92%e3%82%bb%e3%83%83%e3%83%88%e3%82%a2%e3%83%83%e3%83%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":325690,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/90\/revisions\/325690"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}