id: 3f46b87268324e69ab173b896bc9fd00
parent_id: 
item_type: 1
item_id: f1f7defcff8c4477a7f3e15be0c72eb0
item_updated_time: 1764345512163
title_diff: "[{\"diffs\":[[1,\"我为何放弃 frp，转向拥抱 WireGuard\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":24}]"
body_diff: "[{\"diffs\":[[1,\"<html>\\\r\\\n<head>\\\r\\\n  <title>我为何放弃 frp，转向拥抱 WireGuard</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  <meta name=\\\"content-class\\\" content=\\\"yinxiang.peso.superNote\\\"/>\\\r\\\n  <meta name=\\\"application-data:yinxiang.noteLayout\\\" content=\\\"{\\\"lineSpace\\\":\\\"recommend\\\",\\\"paragraphSpace\\\":\\\"recommend\\\"}\\\"/>\\\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=\\\"45805\\\"></a>\\\r\\\n<h1>我为何放弃 frp，转向拥抱 WireGuard</h1>\\\r\\\n\\\r\\\n<div><span style=\\\"\\\"><div style=\\\"max-width: 700px;\\\"><p></p><div style=\\\"--en-blockquote: true; box-sizing: border-box; border-left: 3px solid #b4c0cc; background-position: initial initial; background-repeat: initial initial;\\\"><div>原文链接: <a href=\\\"https://mp.weixin.qq.com/s?__biz=Mzk4ODE3NTYyOA==&amp;mid=2247483979&amp;idx=1&amp;sn=299523bfae68533b1fb5f01a670d4142&amp;chksm=c45d98dc1dbf65cebe85815fbb424fe3be851518a05598c7fccedbfb2e454a7cac90e60df67a&amp;mpshare=1&amp;scene=1&amp;srcid=0816ILTDRvSzu5pXQRlenOQa&amp;sharer_shareinfo=ea70d2468faabeee84f88a0103c29d73&amp;sharer_shareinfo_first=ea70d2468faabeee84f88a0103c29d73#rd\\\"><span>https://mp.weixin.qq.com/s?__biz=Mzk4ODE3NTYyOA==&amp;mid=224748...</span></a></div></div><p></p><div style=\\\"\\\"><div><div><div><span style=\\\"\\\">原创</span><span> 荒野徒夫 </span><span><a style=\\\"\\\"> 荒野徒夫 </a></span><span><em></em></span></div><div style=\\\"\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; border: 0px none; z-index: 0; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; caret-color: rgb(255, 0, 0); white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\\\"><p style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; clear: both; min-height: 1em; cursor: text;\\\"><span>    相信绝大多数需要远程访问局域网服务的极客与我一样，最先接触的就是 frp，确实 frp 社区活跃、教程丰富并且其几乎被所有主流发行版收录，部署起来相当方便。</span></p><p style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; clear: both; min-height: 1em; cursor: text;\\\"><span>    但使用了一段时间之后，我最终彻底弃用了 frp，转向拥抱 WireGuard 组网，今天就和大家聊聊 frp 日常使用痛点在哪，WireGuard 又强在哪。 </span></p></div><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; border: 0px none; z-index: 0; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; caret-color: rgb(255, 0, 0); white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; display: flex;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; z-index: 1;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; background: linear-gradient(72deg, rgb(80, 127, 236) 0px, rgb(80, 127, 236) 80%, transparent 80%);\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; color: #000; text-align: center;\\\"><span>一、frp 内网穿透</span></div></div></div><div style=\\\"box-sizing: border-box; overflow-wrap: break-word; width: 336.406px; max-inline-size: 100%; max-width: 100%;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; width: 0px; height: 1px; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 11px solid rgb(255, 213, 68); transform: rotateZ(0deg);\\\"><span><br/></span></div><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; background-color: rgb(17, 190, 234);\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; color: rgb(255, 255, 255); text-align: center;\\\"><strong style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; cursor: text;\\\"><span>日常使用及痛点</span></strong></div></div></div></div></div></div><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; border: 0px none; z-index: 0; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; caret-color: rgb(255, 0, 0); white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\\\"><div style=\\\"text-align: center;\\\"><img src=\\\":/2553b04718004cf8bac97df359d09a6d\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><p style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; clear: both; min-height: 1em; cursor: text;\\\"><span></span></p></div><div><span>     目前我的家庭网络拓扑比较简单，其中网关设备的 Ubuntu、QNAP、Mac Studio 都需要经常被访问，简单分享下此前在 frp 场景下的两种使用方式。</span></div><div style=\\\"text-align: center;\\\"><img src=\\\":/4a901386f279411f82eaa868aba636a9\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto; height: 392px;\\\" width=\\\"auto\\\"/></div><ul style=\\\"list-style-type: disc;\\\"><li><div><span>方式一：所有需要被访问的设备均启用 frpc 服务连接至 frps，通过 frps 公网 IP+端口访问；</span></div></li><li><div><span>方式二：局域网内网关设备启用 HAProxy 代理服务，先将需要被访问的业务端口统一代理到本机，然后通过本机 frpc 服务连接至 frps 通过 frps 公网 IP+端口访问。</span></div></li></ul><div><span><br/></span></div><div><span>痛点：</span></div><ol style=\\\"list-style-type: decimal;\\\"><li><div><span>frp 服务默认只能转发本机端口，如上所述如果需要暴露的局域网设备比较多就需要单独维护多个 frpc 客户端或者手动配置一层局域网代理，然后在该设备启用 frpc 与 frps 建立连接（涉及两层转发）；</span></div></li><li><div><span>每新增一个需要被访问的局域网服务，都需要单独调整 frp 配置文件重启服务；</span></div></li><li><div><span>frps 机器需要维护对应防火墙策略，不可全局暴露到公网增加被攻击渗透风险；</span></div></li><li><div><span>访问方式上存在差异：</span></div></li><ol style=\\\"list-style-type: lower-alpha;\\\"><li><div><span>外部环境访问通过公网 IP:端口形式访问</span></div></li><li><div><span>局域网环境下访问通过私网 IP:端口形式访问</span></div></li></ol></ol><div><span>这种差异在使用中又会引发一个新的问题，例如：公网环境下添加了一个 frps 的公网地址:端口的浏览器标签，自动同步到了局域网设备，后续局域网设备访问对应资源时很可能走了公网地址和端口访问，既浪费了公网云主机的流量，又增加了访问延时。可通过域名方式来解决该问题，但是又要求局域网环境新增服务来将对应的域名指向私网 IP。</span></div><div><span>    上述 3、4 有开放的解决方案，但是无疑都要通过引入新的服务来解决，成本较高，不再过多赘述，感兴趣的伙伴可以研究。</span></div><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; border: 0px none; z-index: 0; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: justify; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; caret-color: rgb(255, 0, 0); white-space: normal; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; display: flex;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; z-index: 1;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; background: linear-gradient(72deg, rgb(80, 127, 236) 0px, rgb(80, 127, 236) 80%, transparent 80%);\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; color: #000; text-align: center;\\\"><span>二、 WireGuard 组网</span></div></div></div><div style=\\\"box-sizing: border-box; overflow-wrap: break-word; width: 336.406px; max-inline-size: 100%; max-width: 100%;\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; width: 0px; height: 1px; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 11px solid rgb(255, 213, 68); transform: rotateZ(0deg);\\\"><span><br/></span></div><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; background-color: rgb(17, 190, 234);\\\"><div style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; color: rgb(255, 255, 255); text-align: center;\\\"><strong style=\\\"max-inline-size: 100%; box-sizing: border-box; overflow-wrap: break-word; cursor: text;\\\"><span>不再是打个洞，而是“建座桥”</span></strong></div></div></div></div></div></div><div style=\\\"text-align: center;\\\"><img src=\\\":/3a17ebd6d2aa415fb895fad8b54881ef\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><div><span>    拥抱 WireGuard 后我才体会到什么叫做真正的优雅，首先他不再是简单的端口转发，而是通过路由方式组网完美的解决了我上述所有的痛点。</span></div><ol style=\\\"list-style-type: decimal;\\\"><li><div><span>只需保证组网状态正常，无需引入或者维护其他服务，可直接与局域网内任何设备互通；</span></div></li><li><div><span>组网使用自定义私网网段完成，安全系数高；</span></div></li><li><div><span>访问方式上与局域网直连无异全局使用私网地址即可，当然由于延时和带宽因素使用体验上还是会有些许不同。</span></div></li></ol><div><span><br/></span></div><div><span>目前我广泛使用的场景：</span></div><div><span> 1. 单位 macOS 通过 Samba 协议挂载家中 NAS</span></div><div style=\\\"text-align: center;\\\"><img src=\\\":/1400952366204a76b95710cab97c0676\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><div><span>2. 晚上想看电影了，通过屏幕共享直接远程家中 macOS 提前完成下载，下班到家后直接开始</span></div><div style=\\\"text-align: center;\\\"><img src=\\\":/6ec8b97c9bbe4f3f825223576f0935fa\\\" type=\\\"image/png\\\" data-filename=\\\"640.png\\\" style=\\\"--en-marks: %7B%22align%22%3A%22center%22%7D; width: auto;\\\" width=\\\"auto\\\"/></div><div><span>3. 日常访问家中部署的 web 服务。</span></div><div><span>生活本该如此惬意！</span></div></div></div><div><div><div><div style=\\\"display: flex; color: rgba(0,0,0,.3);\\\"><div style=\\\"color: rgba(0,0,0,.3);\\\">个人观点，仅供参考</div></div></div></div></div></div></div></div></span>\\\n</div></body></html>\\u0000\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":10318}]"
metadata_diff: {"new":{"id":"f1f7defcff8c4477a7f3e15be0c72eb0","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":1764345876544,"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:20:24.247Z
created_time: 2025-11-28T16:20:24.247Z
type_: 13