{"id":41371,"date":"2025-06-01T22:15:48","date_gmt":"2025-06-01T14:15:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/41371.html"},"modified":"2025-06-01T22:15:48","modified_gmt":"2025-06-01T14:15:48","slug":"ubuntu-%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%85%8d%e7%bd%ae%e4%b8%8e-cloudflare-tunnel-%e9%83%a8%e7%bd%b2%e6%8c%87%e5%8d%97-%e5%85%8d%e8%b4%b9%e5%86%85%e7%bd%91%e7%a9%bf%e9%80%8f%e5%ae%b6%e7%94%a8%e6%9c%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/41371.html","title":{"rendered":"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668"},"content":{"rendered":"<h2>Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357<\/h2>\n<p>\u672c\u6587\u6863\u603b\u7ed3\u4e86\u670d\u52a1\u5668\u914d\u7f6e\u76f8\u5173\u5185\u5bb9&#xff0c;\u5305\u62ec Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u3001\u786c\u76d8\u6269\u5bb9\u3001\u9759\u6001 IP \u8bbe\u7f6e\u4ee5\u53ca Cloudflare Tunnel \u7684\u90e8\u7f72\u6b65\u9aa4\u3002<\/p>\n<h3>\u76ee\u5f55<\/h3>\n<li>\u786c\u76d8\u5206\u533a\u4e0e\u6269\u5bb9<\/li>\n<li>\u8bbe\u7f6e\u9759\u6001 IP<\/li>\n<li>Cloudflare Tunnel \u90e8\u7f72<\/li>\n<li>SSH \u901a\u8fc7 Cloudflare Tunnel<\/li>\n<li>\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/li>\n<h3>\u786c\u76d8\u5206\u533a\u4e0e\u6269\u5bb9<\/h3>\n<h4>\u95ee\u9898\u5206\u6790<\/h4>\n<p>\u7269\u7406\u786c\u76d8\u4e3a 128GB&#xff0c;\u4f46 Ubuntu \u670d\u52a1\u5668\u53ea\u4f7f\u7528\u4e86\u7ea6 58GB \u7a7a\u95f4\u3002\u901a\u8fc7 lsblk \u547d\u4ee4\u67e5\u770b&#xff1a;<\/p>\n<p>NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT<br \/>\nsda                         8:0    0 119.2G  0 disk<br \/>\n\u251c\u2500sda1                      8:1    0   1.1G  0 part \/boot\/efi<br \/>\n\u251c\u2500sda2                      8:2    0     2G  0 part \/boot<br \/>\n\u2514\u2500sda3                      8:3    0 116.2G  0 part<br \/>\n  \u2514\u2500ubuntu&#8211;vg-ubuntu&#8211;lv 253:0    0  58.1G  0 lvm  \/<\/p>\n<h4>\u89e3\u51b3\u65b9\u6848<\/h4>\n<p>LVM \u903b\u8f91\u5377\u53ea\u4f7f\u7528\u4e86 58.1GB&#xff0c;\u800c\u7269\u7406\u5206\u533a sda3 \u6709 116.2GB\u3002\u9700\u8981\u6269\u5c55 LVM \u903b\u8f91\u5377&#xff1a;<\/p>\n<p><span class=\"token comment\"># 1. \u67e5\u770b\u5377\u7ec4\u4e2d\u53ef\u7528\u7a7a\u95f4<\/span><br \/>\n<span class=\"token function\">sudo<\/span> vgdisplay ubuntu-vg<\/p>\n<p><span class=\"token comment\"># 2. \u6269\u5c55\u903b\u8f91\u5377\u4ee5\u4f7f\u7528\u6240\u6709\u53ef\u7528\u7a7a\u95f4<\/span><br \/>\n<span class=\"token function\">sudo<\/span> lvextend <span class=\"token parameter variable\">-l<\/span> &#043;100%FREE \/dev\/ubuntu-vg\/ubuntu-lv<\/p>\n<p><span class=\"token comment\"># 3. \u8c03\u6574\u6587\u4ef6\u7cfb\u7edf\u5927\u5c0f\u4ee5\u5339\u914d\u903b\u8f91\u5377\u5927\u5c0f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> resize2fs \/dev\/ubuntu-vg\/ubuntu-lv<\/p>\n<h3>\u8bbe\u7f6e\u9759\u6001 IP<\/h3>\n<h4>\u914d\u7f6e\u6b65\u9aa4<\/h4>\n<li>\n<p>\u786e\u5b9a\u7f51\u7edc\u63a5\u53e3\u540d\u79f0&#xff1a;<\/p>\n<p> <span class=\"token function\">ip<\/span> a<\/p>\n<p>\u627e\u5230\u4e3b\u8981\u7f51\u7edc\u63a5\u53e3\u540d\u79f0&#xff08;\u5982 eth0\u3001ens33 \u7b49&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\/\u7f16\u8f91 Netplan \u914d\u7f6e\u6587\u4ef6&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/netplan\/01-netcfg.yaml\n <\/li>\n<li>\n<p>\u6dfb\u52a0\u9759\u6001 IP \u914d\u7f6e&#xff08;\u56fd\u5185\u4f18\u5316\u7248&#xff09;&#xff1a;<\/p>\n<p> <span class=\"token key atrule\">network<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">2<\/span><br \/>\n  <span class=\"token key atrule\">renderer<\/span><span class=\"token punctuation\">:<\/span> networkd<br \/>\n  <span class=\"token key atrule\">ethernets<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">&lt;\u4f60\u7684\u7f51\u7edc\u63a5\u53e3&gt;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">dhcp4<\/span><span class=\"token punctuation\">:<\/span> no<br \/>\n      <span class=\"token key atrule\">addresses<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token punctuation\">&#8211;<\/span> 192.168.1.20\/24<br \/>\n      <span class=\"token key atrule\">gateway4<\/span><span class=\"token punctuation\">:<\/span> 192.168.1.1<br \/>\n      <span class=\"token key atrule\">nameservers<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">addresses<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>223.5.5.5<span class=\"token punctuation\">,<\/span> 223.6.6.6<span class=\"token punctuation\">,<\/span> 114.114.114.114<span class=\"token punctuation\">]<\/span>\n <\/li>\n<li>\n<p>\u5e94\u7528\u914d\u7f6e&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> netplan apply\n <\/li>\n<li>\n<p>\u9a8c\u8bc1\u914d\u7f6e&#xff1a;<\/p>\n<p> <span class=\"token function\">ip<\/span> a<br \/>\n<span class=\"token function\">ping<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">4<\/span> baidu.com\n <\/li>\n<h3>Cloudflare Tunnel \u90e8\u7f72<\/h3>\n<h4>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/h4>\n<li>\n<p>\u5173\u95ed\u9632\u706b\u5899<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u9b54\u6cd5<\/p>\n<p> <span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">http_proxy<\/span><span class=\"token operator\">&#061;<\/span>http:\/\/192.168.1.2:7890<br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">https_proxy<\/span><span class=\"token operator\">&#061;<\/span>http:\/\/192.168.1.2:7890<br \/>\n<span class=\"token builtin class-name\">export<\/span> <span class=\"token assign-left variable\">no_proxy<\/span><span class=\"token operator\">&#061;<\/span>localhost,127.0.0.1\n <\/li>\n<li>\n<p>\u6d4b\u8bd5\u7f51\u7edc<\/p>\n<p> <span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-v<\/span> https:\/\/www.\u9b54\u6cd5\n <\/li>\n<li>\n<p>\u5b89\u88c5 cloudflared&#xff1a;<\/p>\n<p> <span class=\"token function\">wget<\/span> <span class=\"token parameter variable\">-q<\/span> https:\/\/github.com\/cloudflare\/cloudflared\/releases\/latest\/download\/cloudflared-linux-amd64.deb<br \/>\n<span class=\"token function\">sudo<\/span> dpkg <span class=\"token parameter variable\">-i<\/span> cloudflared-linux-amd64.deb<br \/>\ncloudflared <span class=\"token parameter variable\">&#8211;version<\/span>\n <\/li>\n<li>\n<p>\u767b\u5f55 Cloudflare&#xff08;\u9700\u5148\u5207\u6362root\u7528\u6237\u4ee5\u786e\u4fdd\u8bc1\u4e66\u4f4d\u7f6e\u6b63\u786e&#xff09;&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token parameter variable\">-i<\/span><br \/>\ncloudflared login\n <\/li>\n<li>\n<p>\u521b\u5efa\u96a7\u9053&#xff1a;<\/p>\n<p> cloudflared tunnel create fengche-homeserver\n <\/li>\n<li>\n<p>\u914d\u7f6e\u96a7\u9053&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/etc\/cloudflared<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/cloudflared\/config.yml<\/p>\n<p>\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9&#xff1a;<\/p>\n<p> <span class=\"token key atrule\">tunnel<\/span><span class=\"token punctuation\">:<\/span> &lt;\u4f60\u7684\u96a7\u9053ID<span class=\"token punctuation\">&gt;<\/span><br \/>\n<span class=\"token key atrule\">credentials-file<\/span><span class=\"token punctuation\">:<\/span> \/root\/.cloudflared\/&lt;\u4f60\u7684\u96a7\u9053ID<span class=\"token punctuation\">&gt;<\/span>.json<br \/>\n<span class=\"token key atrule\">origincert<\/span><span class=\"token punctuation\">:<\/span> \/root\/.cloudflared\/cert.pem<\/p>\n<p><span class=\"token key atrule\">ingress<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">hostname<\/span><span class=\"token punctuation\">:<\/span> &lt;\u4f60\u7684\u57df\u540d<span class=\"token punctuation\">&gt;<\/span><br \/>\n    <span class=\"token key atrule\">service<\/span><span class=\"token punctuation\">:<\/span> http<span class=\"token punctuation\">:<\/span>\/\/localhost<span class=\"token punctuation\">:<\/span><span class=\"token number\">80<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">service<\/span><span class=\"token punctuation\">:<\/span> http_status<span class=\"token punctuation\">:<\/span><span class=\"token number\">404<\/span>\n <\/li>\n<li>\n<p>\u914d\u7f6e DNS&#xff1a;<\/p>\n<p> cloudflared tunnel route dns fengche-homeserver <span class=\"token punctuation\">[<\/span>fcchat.xyz<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">(<\/span>https:\/\/fcchat.xyz<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u6ce8\u610f&#xff1a;\u5982\u679c\u57df\u540d\u5df2\u6709 DNS \u8bb0\u5f55&#xff0c;\u4f7f\u7528\u5b50\u57df\u540d\u6216\u5148\u5220\u9664\u73b0\u6709\u8bb0\u5f55\u3002<\/p>\n<\/li>\n<h4>\u8bbe\u7f6e\u4e3a\u7cfb\u7edf\u670d\u52a1<\/h4>\n<li>\n<p>\u521b\u5efa\u81ea\u5b9a\u4e49\u7cfb\u7edf\u670d\u52a1\u6587\u4ef6&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/systemd\/system\/cloudflared.service<\/p>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p> [Unit]<br \/>\nDescription&#061;Cloudflare Tunnel<br \/>\nAfter&#061;network.target<\/p>\n<p>[Service]<br \/>\nType&#061;simple<br \/>\nUser&#061;root<br \/>\nExecStart&#061;\/usr\/bin\/cloudflared tunnel run fengche-homeserver<br \/>\nRestart&#061;on-failure<br \/>\nRestartSec&#061;5s<\/p>\n<p>[Install]<br \/>\nWantedBy&#061;multi-user.target\n <\/li>\n<li>\n<p>\u542f\u52a8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl daemon-reload<br \/>\n<span class=\"token function\">sudo<\/span> systemctl start cloudflared<br \/>\n<span class=\"token function\">sudo<\/span> systemctl status cloudflared<br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> cloudflared\n <\/li>\n<hr \/>\n<p>\u6f14\u793a\u7ad9 fengche.site<\/p>\n<h3>\u4f7f\u7528 Token \u542f\u52a8 Cloudflare Tunnel<\/h3>\n<h4>\u5982\u4f55\u83b7\u53d6 tunnel \u7684 token<\/h4>\n<p>cloudflared tunnel list<br \/>\ncloudflared tunnel token 1dc1ad22-f9c3-40c3-b9a5-46a178077e84<\/p>\n<p>\u6267\u884c\u4ee5\u4e0a\u547d\u4ee4\u5373\u53ef\u83b7\u53d6 tunnel \u7684 token\u3002<\/p>\n<h4>\u51c6\u5907\u5de5\u4f5c<\/h4>\n<li>\n<p>\u786e\u4fdd\u4f60\u6709 cloudflared \u7684 token \u4f8b\u5982&#xff1a;<\/p>\n<p> eyJhIjoiNzUzNDFjOGY2YjNlNDczOTdkZjBlNjAzNTQyMDc4YzUiLCJzIjoiVmhyTWw3bE0zc05NcExwK3BlK21UM3FjekRCZXQ1MmtsUy95d1lUV2tPMD0iLCJ0IjoiMWRjMWFkMjItZjljMy00MGMzLWI5YTUtNDZhMTc4MDc3ZTg0In0&#061;\n <\/li>\n<li>\n<p>\u786e\u8ba4\u4f60\u7684\u672c\u5730\u670d\u52a1\u7aef\u53e3 \u4f8b\u5982&#xff1a;localhost:3001<\/p>\n<\/li>\n<h4>\u521b\u5efa cloudflared \u914d\u7f6e\u6587\u4ef6&#xff08;\u53ef\u9009&#xff09;<\/h4>\n<p>\u5982\u679c\u4f60\u60f3\u7528\u914d\u7f6e\u6587\u4ef6\u81ea\u5b9a\u4e49\u8f6c\u53d1\u89c4\u5219&#xff0c;\u53ef\u4ee5\u5728 \/root\/.cloudflared\/config.yml \u5199\u5165\u5982\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token key atrule\">tunnel<\/span><span class=\"token punctuation\">:<\/span> 1dc1ad22<span class=\"token punctuation\">&#8211;<\/span>f9c3<span class=\"token punctuation\">&#8211;<\/span>40c3<span class=\"token punctuation\">&#8211;<\/span>b9a5<span class=\"token punctuation\">&#8211;<\/span>46a178077e84   <span class=\"token comment\"># \u4f60\u7684 tunnel ID<\/span><br \/>\n<span class=\"token key atrule\">ingress<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">hostname<\/span><span class=\"token punctuation\">:<\/span> fcchat.xyz                       <span class=\"token comment\"># \u4f60\u7684\u57df\u540d<\/span><br \/>\n    <span class=\"token key atrule\">service<\/span><span class=\"token punctuation\">:<\/span> http<span class=\"token punctuation\">:<\/span>\/\/localhost<span class=\"token punctuation\">:<\/span><span class=\"token number\">3001<\/span>             <span class=\"token comment\"># \u4f60\u7684\u672c\u5730\u670d\u52a1\u7aef\u53e3<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">service<\/span><span class=\"token punctuation\">:<\/span> http_status<span class=\"token punctuation\">:<\/span><span class=\"token number\">404<\/span><\/p>\n<p>\u5982\u679c\u4f60\u53ea\u7528 token \u542f\u52a8\u4e14\u53ea\u8f6c\u53d1\u4e00\u4e2a\u7aef\u53e3&#xff0c;\u8fd9\u4e00\u6b65\u53ef\u4ee5\u7701\u7565\u3002<\/p>\n<h4>\u7f16\u5199\u542f\u52a8\u811a\u672c<\/h4>\n<li>\n<p>\u8fdb\u5165 cloudflared \u76ee\u5f55<\/p>\n<p> <span class=\"token builtin class-name\">cd<\/span> \/root\/.cloudflared\/\n <\/li>\n<li>\n<p>\u65b0\u5efa\u811a\u672c\u6587\u4ef6<\/p>\n<p> <span class=\"token function\">nano<\/span> start-tunnel.sh\n <\/li>\n<li>\n<p>\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9&#xff08;\u8bf7\u66ff\u6362\u4e3a\u4f60\u7684 token \u548c\u7aef\u53e3&#xff09;<\/p>\n<p> <span class=\"token shebang important\">#!\/bin\/bash<\/span><br \/>\n<span class=\"token comment\"># \u542f\u52a8 cloudflared tunnel&#xff0c;token\u8bf7\u66ff\u6362\u4e3a\u4f60\u7684\u771f\u5b9etoken<\/span><br \/>\ncloudflared tunnel run <span class=\"token parameter variable\">&#8211;token<\/span> <span class=\"token string\">&#034;eyJhIjoiNzUzNDFjOGY2YjNlNDczOTdkZjBlNjAzNTQyMDc4YzUiLCJzIjoiVmhyTWw3bE0zc05NcExwK3BlK21UM3FjekRCZXQ1MmtsUy95d1lUV2tPMD0iLCJ0IjoiMWRjMWFkMjItZjljMy00MGMzLWI5YTUtNDZhMTc4MDc3ZTg0In0&#061;&#034;<\/span><\/p>\n<p>\u5982\u679c\u4f60\u6709 config.yml&#xff0c;cloudflared \u4f1a\u81ea\u52a8\u8bfb\u53d6&#xff0c;\u65e0\u9700\u989d\u5916\u6307\u5b9a\u7aef\u53e3\u3002<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa<\/p>\n<ul>\n<li>nano \u4e0b\u6309 Ctrl&#043;O \u56de\u8f66\u4fdd\u5b58&#xff0c;Ctrl&#043;X \u9000\u51fa\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8d4b\u4e88\u811a\u672c\u6267\u884c\u6743\u9650<\/p>\n<p> <span class=\"token function\">chmod<\/span> &#043;x \/root\/.cloudflared\/start-tunnel.sh\n <\/li>\n<h4>\u542f\u52a8 tunnel<\/h4>\n<p>\u4ee5\u540e\u53ea\u9700\u8fd0\u884c&#xff1a;<\/p>\n<p>\/root\/.cloudflared\/start-tunnel.sh<\/p>\n<p>\u5373\u53ef\u4e00\u952e\u542f\u52a8 Cloudflare Tunnel\u3002<\/p>\n<h4>\u8bbe\u7f6e\u4e3a\u540e\u53f0\u6216\u5f00\u673a\u81ea\u542f&#xff08;\u53ef\u9009&#xff09;<\/h4>\n<ul>\n<li>\u540e\u53f0\u8fd0\u884c&#xff1a;<span class=\"token function\">nohup<\/span> \/root\/.cloudflared\/start-tunnel.sh <span class=\"token operator\">&gt;<\/span> \/root\/.cloudflared\/tunnel.log <span class=\"token operator\"><span class=\"token file-descriptor important\">2<\/span>&gt;<\/span><span class=\"token file-descriptor important\">&amp;1<\/span> <span class=\"token operator\">&amp;<\/span>\n <\/li>\n<li>\u5f00\u673a\u81ea\u542f\u52a8\u53ef\u4f7f\u7528 systemd \u6216 rc.local \u914d\u7f6e\u3002<\/li>\n<\/ul>\n<h4>\u603b\u7ed3<\/h4>\n<p>\u4f5c\u8005 https:\/\/xoxome.online<\/p>\n<li>\u83b7\u53d6 token \u548c\u672c\u5730\u7aef\u53e3\u3002<\/li>\n<li>&#xff08;\u53ef\u9009&#xff09;\u5199 config.yml \u914d\u7f6e\u8f6c\u53d1\u89c4\u5219\u3002<\/li>\n<li>\u5199 start-tunnel.sh \u811a\u672c&#xff0c;\u5185\u5bb9\u4e3a cloudflared tunnel run &#8211;token \u201c\u4f60\u7684token\u201d\u3002<\/li>\n<li>\u8d4b\u6743\u5e76\u8fd0\u884c\u811a\u672c\u5373\u53ef\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb824\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4f5c\u8005\u83b7\u53d6 token \u548c\u672c\u5730\u7aef\u53e3\u3002\uff08\u53ef\u9009\uff09\u5199 config.yml \u914d\u7f6e\u8f6c\u53d1\u89c4\u5219\u3002\u5199 start-tunnel.sh \u811a\u672c\uff0c\u5185\u5bb9\u4e3a cloudflared tunnel run &#8211;token \u201c\u4f60\u7684token\u201d\u3002\u8d4b\u6743\u5e76\u8fd0\u884c\u811a\u672c\u5373\u53ef\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,103,43],"topic":[],"class_list":["post-41371","post","type-post","status-publish","format-standard","hentry","category-server","tag-linux","tag-ubuntu","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/41371.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb824\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4f5c\u8005\u83b7\u53d6 token \u548c\u672c\u5730\u7aef\u53e3\u3002\uff08\u53ef\u9009\uff09\u5199 config.yml \u914d\u7f6e\u8f6c\u53d1\u89c4\u5219\u3002\u5199 start-tunnel.sh \u811a\u672c\uff0c\u5185\u5bb9\u4e3a cloudflared tunnel run --token \u201c\u4f60\u7684token\u201d\u3002\u8d4b\u6743\u5e76\u8fd0\u884c\u811a\u672c\u5373\u53ef\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/41371.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-01T14:15:48+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41371.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/41371.html\",\"name\":\"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-06-01T14:15:48+00:00\",\"dateModified\":\"2025-06-01T14:15:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/41371.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/41371.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/41371.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/41371.html","og_locale":"zh_CN","og_type":"article","og_title":"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb824\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4f5c\u8005\u83b7\u53d6 token \u548c\u672c\u5730\u7aef\u53e3\u3002\uff08\u53ef\u9009\uff09\u5199 config.yml \u914d\u7f6e\u8f6c\u53d1\u89c4\u5219\u3002\u5199 start-tunnel.sh \u811a\u672c\uff0c\u5185\u5bb9\u4e3a cloudflared tunnel run --token \u201c\u4f60\u7684token\u201d\u3002\u8d4b\u6743\u5e76\u8fd0\u884c\u811a\u672c\u5373\u53ef\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/41371.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-06-01T14:15:48+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/41371.html","url":"https:\/\/www.wsisp.com\/helps\/41371.html","name":"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-06-01T14:15:48+00:00","dateModified":"2025-06-01T14:15:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/41371.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/41371.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/41371.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Ubuntu \u670d\u52a1\u5668\u914d\u7f6e\u4e0e Cloudflare Tunnel \u90e8\u7f72\u6307\u5357 \u514d\u8d39\u5185\u7f51\u7a7f\u900f\u5bb6\u7528\u670d\u52a1\u5668"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=41371"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/41371\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=41371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=41371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=41371"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=41371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}