id: d9a9eaf739eb43c0842737b08c6cad38
parent_id: 
item_type: 1
item_id: 8e830bf969794ad7af7dc3b8d0a99ced
item_updated_time: 1764345504233
title_diff: "[{\"diffs\":[[1,\"Wireguard 连接家庭网络 + Clash 配置 - homescolincai\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":43}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>Wireguard 连接家庭网络 + Clash 配置 - /homes/colincai</title>\\\r\\\n  <basefont face=\\\"微软雅黑\\\" size=\\\"2\\\" />\\\r\\\n  <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\" />\\\r\\\n  <meta name=\\\"exporter-version\\\" content=\\\"YXBJ Windows/608924 (zh-CN, DDL); Windows/10.0.0 (Win64); EDAMVersion=V2;\\\"/>\\\r\\\n  <style>\\\r\\\n\\tbody, td {\\\r\\\n\\t  font-family: 微软雅黑;\\\r\\\n\\t  font-size: 12pt;\\\r\\\n\\t}\\\r\\\n  </style>\\\r\\\n</head>\\\r\\\n<body>\\\r\\\n<a name=\\\"32395\\\"></a>\\\r\\\n<h1>Wireguard 连接家庭网络 + Clash 配置 - /homes/colincai</h1>\\\r\\\n\\\r\\\n<div><span>\\\n  <div style=\\\"--en-clipped-content:article\\\">\\\n<div><br/></div><div style=\\\"font-size: 16px; display:block; min-width: 100%; position: relative;\\\"> <div style=\\\"line-height:1.15;text-size-adjust:100%;font-size:20px;box-sizing:border-box;\\\"><div style=\\\"background:rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box;color:rgb(54, 54, 54);font-size:16px;font-family:&quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;;line-height:2;-webkit-tap-highlight-color:transparent;box-sizing:border-box;\\\"><div style=\\\"box-sizing:border-box;\\\"><span style=\\\"box-sizing:border-box;justify-content:space-between;\\\"><div style=\\\"box-sizing:border-box;transition:all 0.3s ease 0s;border-radius:12px;background:rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box;box-shadow:rgba(44, 45, 48, 0.047) 0px 8px 16px -4px;\\\"><div style=\\\"box-sizing:border-box;overflow-wrap:break-word;\\\"><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\"> 因为在家里面有搭建一些私有云的服务，所以我之前一直在找一套方案，能够通过在外部网络连接到家中。之前也尝试过各种方案，比如 frq, zerotire 之内的方案。之后在对比之后，通过自建 zerotier 中转的方法，实现了无缝的在外部环境中直连家庭网络。</p><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\">不过最近 Merlin 路由器固件带来了 388.1 更新，情况就发生了变化，388 固件能够搭建 Wireguard 服务器，只要家庭网络拥有公网 IP，那么久能够通过 Wireguard 直接连接到家庭网络。</p><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\">使用 Wireguard 最大的好处，就是在 iOS 上，可以使用分流的方法，同时翻墙和连接到家庭网络。这解决了我需要在两个 VPN 中切换的问题。</p><h1 style=\\\"position:relative;color:rgb(31, 45, 61);font-weight:700;box-sizing:border-box;margin:1rem 0px 0.7rem;margin-top:20px;padding-top:0px;transition:all 0.2s ease-out 0s;align-items:center;justify-content:space-between;flex-direction:row-reverse;line-height:1.3;font-size:30px;padding-left:0px;\\\"><span style=\\\"font-size:30px;color:rgb(31, 45, 61);font-weight:700;line-height:1.3;display:none;font-style:normal;font-variant:normal;font-family:Font Awesome 5 Free;text-rendering:auto;-webkit-font-smoothing:antialiased;position:absolute;top:calc(50% - 0.45rem);transition:all 0.2s ease-out 0s;margin-left:-1.2rem;\\\"></span>开启 WG Sever</h1><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\">进入路由器页面，通过【VPN】--&gt;【VPN 服务器】--&gt;【Other】--&gt;【Wireguard】就可以打开 WG 的配置界面<img height=\\\"693\\\" src=\\\"https://colcai-com.oss-cn-hongkong.aliyuncs.com/halo/image.png\\\" style=\\\"border-style:none;box-sizing:border-box;max-width:100%;transition:all 0.2s ease 0s;display:block;margin:0px auto 0.8rem;border-radius:12px;margin-bottom:10px;object-fit:cover;\\\" width=\\\"858\\\"></img></p><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\"></p><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\">点击 VPN 客户端旁边的➕，根据自己的设备数量增加节点，并点开到处界面，记录里面的公钥和私钥。</p><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\"><img height=\\\"890\\\" src=\\\"https://colcai-com.oss-cn-hongkong.aliyuncs.com/halo/Snipaste_2022-12-20_11-41-06.png\\\" style=\\\"border-style:none;box-sizing:border-box;max-width:100%;transition:all 0.2s ease 0s;display:block;margin:0px auto 0.8rem;border-radius:12px;margin-bottom:10px;object-fit:cover;\\\" width=\\\"836\\\"></img>服务器端就配置好了。</p><h1 style=\\\"position:relative;color:rgb(31, 45, 61);font-weight:700;box-sizing:border-box;margin:1rem 0px 0.7rem;margin-top:20px;padding-top:0px;transition:all 0.2s ease-out 0s;align-items:center;justify-content:space-between;flex-direction:row-reverse;line-height:1.3;font-size:30px;padding-left:0px;\\\"><span style=\\\"font-size:30px;color:rgb(31, 45, 61);font-weight:700;line-height:1.3;display:none;font-style:normal;font-variant:normal;font-family:Font Awesome 5 Free;text-rendering:auto;-webkit-font-smoothing:antialiased;position:absolute;top:calc(50% - 0.45rem);transition:all 0.2s ease-out 0s;margin-left:-1.2rem;\\\"></span>客户端</h1><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\">客户端我选择使用 Clash+Stash，这两种客户端都是用相同的配置。在配置文件中增加 wg 配置。</p><div style=\\\"box-sizing:border-box;position:relative;\\\"><pre style=\\\"border-radius:4px;background-color: #fbfaf8;border: 1px solid rgba(0,0,0,.14902);color: #333;font-size: 12px;padding: 8px;font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif;box-sizing: border-box;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\"><span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">proxies</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span>  \\\n  <span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">-</span> <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">name</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> <span style=\\\"box-sizing:border-box;color:rgb(80, 250, 123);\\\">&quot;家庭-wireguard&quot;</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">type</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> wireguard\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">server</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> 你的公网IP <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\">#aka peer endpoint</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">port</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> 端口号 <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\">#aka peer endpoint port</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">ip</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> 10.6.0.7 <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\">#aka self ip address or address</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\"># ipv6: your_ipv6 #aka self ipv6 address or address</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">private-key</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> 私钥\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">public-key</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> 公钥\\\n    <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\"># preshared-key: Zdp+B8+iGb/zmIEMxx32pDQohGiNF8Kvhm4t1Hpgmag=</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">dns</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> <span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">[</span>1.0.0.1<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">,</span> 223.6.6.6<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">]</span> <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\"># optional</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(98, 114, 164);\\\"># mtu: 1420</span>\\\n    <span style=\\\"box-sizing:border-box;color:rgb(241, 250, 140);\\\">udp</span><span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">:</span> <span style=\\\"box-sizing:border-box;color:rgb(255, 184, 108);font-weight:bold;\\\">true</span><span style=\\\"box-sizing:border-box;position:absolute;pointer-events:none;top:0px;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid rgb(153, 153, 153);user-select:none;\\\"><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">1</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">2</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">3</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">4</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">5</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">6</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">7</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">8</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">9</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">10</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">11</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">12</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">13</span></span></span></code></pre><div style=\\\"box-sizing:border-box;position:absolute;z-index:10;top:0.3em;right:0.2em;transition:opacity 0.3s ease-in-out 0s;opacity:0;\\\"><div style=\\\"box-sizing:border-box;display:inline-block;\\\"><span style=\\\"box-sizing:border-box;color:rgb(187, 187, 187);font-size:0.8em;padding:0px 0.5em;background:rgba(224, 224, 224, 0.2);box-shadow:rgba(0, 0, 0, 0.2) 0px 2px 0px 0px;border-radius:0.5em;\\\">YAML</span></div><div style=\\\"box-sizing:border-box;display:inline-block;\\\"></div></div></div><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;\\\">然后把家中的局域网内网 ip 配置到分流规则中。需要注意，把除了家中内网网段的 IP 走直流。</p><div style=\\\"box-sizing:border-box;position:relative;\\\"><pre style=\\\"border-radius:4px;background-color: #fbfaf8;border: 1px solid rgba(0,0,0,.14902);color: #333;font-size: 12px;padding: 8px;font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif;box-sizing: border-box;\\\"><code style=\\\"font-size: 9pt; color: rgb(51, 51, 51); font-family: Monaco,Menlo,Consolas,Courier New,monospace,sans-serif\\\">  <span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">-</span> IP<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">-</span>CIDR<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">,</span>192.168.50.0/24<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">,</span>家庭<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">-</span>wireguard\\\n  <span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">-</span> IP<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">-</span>CIDR<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">,</span>192.168.0.0/16<span style=\\\"box-sizing:border-box;color:rgb(248, 248, 242);\\\">,</span>DIRECT<span style=\\\"box-sizing:border-box;position:absolute;pointer-events:none;top:0px;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid rgb(153, 153, 153);user-select:none;\\\"><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">1</span></span><span style=\\\"box-sizing:border-box;display:block;\\\"><span style=\\\"color:rgb(153, 153, 153);display:block;padding-right:0.8em;text-align:right;\\\">2</span></span></span></code></pre><div style=\\\"box-sizing:border-box;position:absolute;z-index:10;top:0.3em;right:0.2em;transition:opacity 0.3s ease-in-out 0s;opacity:0;\\\"><div style=\\\"box-sizing:border-box;display:inline-block;\\\"><span style=\\\"box-sizing:border-box;color:rgb(187, 187, 187);font-size:0.8em;padding:0px 0.5em;background:rgba(224, 224, 224, 0.2);box-shadow:rgba(0, 0, 0, 0.2) 0px 2px 0px 0px;border-radius:0.5em;\\\">YAML</span></div><div style=\\\"box-sizing:border-box;display:inline-block;\\\"></div></div></div><p style=\\\"box-sizing:border-box;text-align:left;letter-spacing:0.6px;margin:1rem 0px;font-size:18px;line-height:1.7;font-weight:400;margin-bottom:0px;\\\">至此，你可以通过直接访问内网 IP 访问到家庭中的网络了。</p></div></div></span></div></div></div></div>\\\n</div>\\\n</span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":13320}]"
metadata_diff: {"new":{"id":"8e830bf969794ad7af7dc3b8d0a99ced","parent_id":"061de1401cfc4cfaadf6e74e015970e9","latitude":"0.00000000","longitude":"0.00000000","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":1764345772880,"markup_language":2,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":0},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2025-11-28T16:13:02.620Z
created_time: 2025-11-28T16:13:02.620Z
type_: 13