{"id":37142,"date":"2025-05-14T08:11:06","date_gmt":"2025-05-14T00:11:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/37142.html"},"modified":"2025-05-14T08:11:06","modified_gmt":"2025-05-14T00:11:06","slug":"%e8%ae%be%e7%bd%ae%e4%b8%ad%e4%b8%93%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/37142.html","title":{"rendered":"\u8bbe\u7f6e\u4e2d\u4e13\u670d\u52a1\u5668"},"content":{"rendered":"<p>\u597d\u7684&#xff0c;\u8fd9\u662f\u4e00\u4e2a\u66f4\u5b8c\u5584\u548c\u6e05\u6670\u7684\u6559\u7a0b&#xff0c;\u5305\u542b\u5982\u4f55\u5173\u95ed VPN \u529f\u80fd\u4ee5\u53ca\u4e0e FRP \u5185\u7f51\u7a7f\u900f\u53ef\u80fd\u51b2\u7a81\u7684\u8bf4\u660e\u3002<\/p>\n<p>\u6559\u7a0b\u76ee\u6807: \u5229\u7528\u4e00\u53f0 Linux \u670d\u52a1\u5668\u4f5c\u4e3a OpenVPN \u4e2d\u8f6c\u7f51\u5173&#xff0c;\u4f7f\u4f60\u7684\u5c40\u57df\u7f51\u7535\u8111 (\u5982 192.168.5.9) \u65e0\u9700\u76f4\u63a5\u8fde\u63a5 VPN \u5373\u53ef\u8bbf\u95ee VPN \u7f51\u7edc\u8d44\u6e90 (\u5982 10.8.0.4)\u3002<\/p>\n<p>\u4f60\u7684\u7f51\u7edc\u4fe1\u606f:<\/p>\n<ul>\n<li>\u5ba2\u6237\u7aef\u7535\u8111 IP: 192.168.5.9<\/li>\n<li>\u5ba2\u6237\u7aef\u5b50\u7f51: 192.168.5.0\/24<\/li>\n<li>\u5ba2\u6237\u7aef\u9ed8\u8ba4\u7f51\u5173: 192.168.5.254<\/li>\n<li>\u76ee\u6807 VPN IP: 10.8.0.4<\/li>\n<li>\u4f60\u7684 OpenVPN \u914d\u7f6e\u6587\u4ef6\u8def\u5f84 (\u793a\u4f8b): \/home\/yuuu\/data\/vpna40\/callisto_zhangyu.ovpn<\/li>\n<\/ul>\n<p>\u524d\u63d0\u6761\u4ef6:<\/p>\n<li>\u4e2d\u8f6c\u670d\u52a1\u5668: \u51c6\u5907\u4e00\u53f0 Linux \u673a\u5668 (\u63a8\u8350 Debian\/Ubuntu \u7a33\u5b9a\u7248)&#xff0c;\u62e5\u6709 sudo \u6743\u9650\u3002<\/li>\n<li>\u7f51\u7edc\u8fde\u63a5: \u8be5 Linux \u673a\u5668\u5df2\u8fde\u63a5\u5230\u4f60\u7684 192.168.5.0\/24 \u7f51\u7edc\u3002<\/li>\n<li>\u63a5\u53e3\u540d\u79f0: \u77e5\u9053\u8be5 Linux \u673a\u5668\u7684\u5c40\u57df\u7f51\u63a5\u53e3\u540d\u79f0 (\u7528 ip a \u67e5\u770b, \u5982 eth0, ens18 \u7b49)\u3002<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6: \u62e5\u6709 .ovpn \u6587\u4ef6\u53ca\u53ef\u80fd\u9700\u8981\u7684\u8bc1\u4e66\/\u5bc6\u94a5\/\u7528\u6237\u540d\u5bc6\u7801\u3002<\/li>\n<li>\u57fa\u672c Linux \u64cd\u4f5c\u80fd\u529b: \u719f\u6089\u547d\u4ee4\u884c\u3001\u7f16\u8f91\u6587\u4ef6\u7b49\u3002<\/li>\n<li>\u5f53\u524d\u65f6\u95f4 (\u4f9b\u53c2\u8003): 2025\u5e745\u67086\u65e5 \u661f\u671f\u4e8c \u4e0b\u53484:24:21 CST<\/li>\n<hr \/>\n<p>\u8be6\u7ec6\u6b65\u9aa4<\/p>\n<p>\u7b2c 1 \u6b65&#xff1a;\u51c6\u5907\u4e2d\u8f6c\u7f51\u5173\u670d\u52a1\u5668<\/p>\n<li>\n<p>\u9009\u62e9\u5e76\u8bbe\u7f6e\u9759\u6001 IP \u5730\u5740:<\/p>\n<ul>\n<li>\u4e3a\u4e2d\u8f6c\u670d\u52a1\u5668\u9009\u62e9\u4e00\u4e2a\u672a\u88ab\u4f7f\u7528\u7684 IP&#xff0c;\u4f8b\u5982 192.168.5.200\u3002<\/li>\n<li>\u67e5\u770b\u5f53\u524d\u7f51\u7edc\u63a5\u53e3:<span class=\"token function\">ip<\/span> a<br \/>\n \u8bb0\u4e0b\u4f60\u8981\u914d\u7f6e\u9759\u6001 IP \u7684\u90a3\u4e2a\u63a5\u53e3\u7684\u540d\u79f0 (\u4f8b\u5982 eth0)\u3002<\/li>\n<li>\u914d\u7f6e\u9759\u6001 IP (\u4f7f\u7528 netplan):\n<ul>\n<li>\u7f16\u8f91 Netplan \u914d\u7f6e\u6587\u4ef6 (\/etc\/netplan\/ \u76ee\u5f55\u4e0b\u7684 .yaml \u6587\u4ef6)\u3002<span class=\"token comment\"># \u7528\u4f60\u7684\u5b9e\u9645\u914d\u7f6e\u6587\u4ef6\u540d\u66ff\u6362 01-netcfg.yaml<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/netplan\/01-netcfg.yaml\n <\/li>\n<li>\u4fee\u6539\u6216\u521b\u5efa\u5982\u4e0b\u5185\u5bb9&#xff1a;<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\">ethernets<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">eth0<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token comment\"># &lt;&#8212;- \u66ff\u6362\u4e3a\u4f60\u7684\u7f51\u5361\u63a5\u53e3\u540d!<\/span><br \/>\n      <span class=\"token key atrule\">dhcp4<\/span><span class=\"token punctuation\">:<\/span> no <span class=\"token comment\"># \u5173\u95edDHCP<\/span><br \/>\n      <span class=\"token key atrule\">addresses<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>192.168.5.200\/24<span class=\"token punctuation\">]<\/span> <span class=\"token comment\"># &lt;&#8212;- \u8bbe\u7f6e\u4f60\u9009\u62e9\u7684\u9759\u6001IP\u548c\u5b50\u7f51\u63a9\u7801(\/24 &#061; 255.255.255.0)<\/span><br \/>\n      <span class=\"token key atrule\">gateway4<\/span><span class=\"token punctuation\">:<\/span> 192.168.5.254 <span class=\"token comment\"># &lt;&#8212;- \u8bbe\u7f6e\u4f60\u7684\u5c40\u57df\u7f51\u9ed8\u8ba4\u7f51\u5173 (\u901a\u5e38\u662f\u4f60\u7684\u4e3b\u8def\u7531\u5668IP)<\/span><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>114.114.114.114<span class=\"token punctuation\">,<\/span> 8.8.8.8<span class=\"token punctuation\">]<\/span> <span class=\"token comment\"># &lt;&#8212;- \u8bbe\u7f6e DNS \u670d\u52a1\u5668 (\u516c\u5171DNS\u6216\u4f60\u7684\u8def\u7531\u5668)<\/span>\n <\/li>\n<li>\u5e94\u7528\u914d\u7f6e\u5e76\u9a8c\u8bc1&#xff1a;<span class=\"token function\">sudo<\/span> netplan apply<br \/>\n<span class=\"token function\">ip<\/span> addr show eth0 <span class=\"token comment\"># \u66ff\u6362\u4e3a\u4f60\u7684\u63a5\u53e3\u540d&#xff0c;\u68c0\u67e5 IP \u662f\u5426\u6b63\u786e<\/span><br \/>\n<span class=\"token function\">ping<\/span> -c <span class=\"token number\">3<\/span> <span class=\"token number\">192.168<\/span>.5.254 <span class=\"token comment\"># \u6d4b\u8bd5\u80fd\u5426 ping \u901a\u7f51\u5173<\/span><br \/>\n<span class=\"token function\">ping<\/span> -c <span class=\"token number\">3<\/span> baidu.com <span class=\"token comment\"># \u6d4b\u8bd5\u80fd\u5426\u8bbf\u95ee\u4e92\u8054\u7f51<\/span>\n <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u66f4\u65b0\u7cfb\u7edf\u5e76\u5b89\u88c5\u5fc5\u8981\u8f6f\u4ef6:<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> upgrade -y<br \/>\n<span class=\"token comment\"># \u5b89\u88c5 OpenVPN \u5ba2\u6237\u7aef \u548c iptables \u89c4\u5219\u6301\u4e45\u5316\u5de5\u5177<\/span><br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> openvpn iptables-persistent -y<br \/>\n<span class=\"token comment\"># \u5b89\u88c5\u8fc7\u7a0b\u4e2d\u4f1a\u8be2\u95ee\u662f\u5426\u4fdd\u5b58\u5f53\u524d\u7684 IPv4 \u548c IPv6 \u89c4\u5219&#xff0c;\u9009\u62e9 &lt;Yes&gt;\u3002<\/span>\n <\/li>\n<li>\n<p>\u68c0\u67e5\u73b0\u6709\u9632\u706b\u5899:<\/p>\n<ul>\n<li>\u6709\u4e9b\u7cfb\u7edf\u9ed8\u8ba4\u542f\u7528 ufw \u6216 firewalld\u3002\u5982\u679c\u542f\u7528&#xff0c;\u5b83\u4eec\u53ef\u80fd\u4f1a\u5e72\u6270 iptables \u89c4\u5219\u3002<span class=\"token function\">sudo<\/span> ufw status<br \/>\n<span class=\"token function\">sudo<\/span> systemctl status firewalld\n <\/li>\n<li>\u5982\u679c\u5b83\u4eec\u662f active (running) \u72b6\u6001&#xff0c;\u4f60\u9700\u8981\u914d\u7f6e\u5b83\u4eec\u4ee5\u5141\u8bb8\u8f6c\u53d1&#xff08;\u8f83\u590d\u6742&#xff09;&#xff0c;\u6216\u8005\u7981\u7528\u5b83\u4eec\u4ee5\u5b8c\u5168\u4f9d\u8d56 iptables&#xff08;\u66f4\u7b80\u5355&#xff0c;\u4f46\u5728\u5b89\u5168\u6027\u4e0a\u9700\u81ea\u884c\u8bc4\u4f30&#xff09;&#xff1a;<span class=\"token comment\"># \u5982\u679c\u51b3\u5b9a\u7981\u7528 ufw (\u793a\u4f8b)<\/span><br \/>\n<span class=\"token comment\"># sudo ufw disable<\/span><br \/>\n<span class=\"token comment\"># sudo systemctl stop ufw<\/span><br \/>\n<span class=\"token comment\"># sudo systemctl disable ufw<\/span>\n <\/li>\n<\/ul>\n<\/li>\n<p>\u7b2c 2 \u6b65&#xff1a;\u914d\u7f6e OpenVPN \u5ba2\u6237\u7aef<\/p>\n<li>\n<p>\u590d\u5236\u5e76\u51c6\u5907 OpenVPN \u914d\u7f6e\u6587\u4ef6:<\/p>\n<ul>\n<li>\u5c06\u4f60\u7684 .ovpn \u6587\u4ef6 (callisto_zhangyu.ovpn) \u4f20\u8f93\u5230\u4e2d\u8f6c\u670d\u52a1\u5668 (\u4f8b\u5982\u7528 scp \u6216 U \u76d8)\u3002\u5047\u8bbe\u5b83\u73b0\u5728\u4f4d\u4e8e\u4e2d\u8f6c\u670d\u52a1\u5668\u7684 ~\/ \u76ee\u5f55\u4e0b\u3002<\/li>\n<li>\u521b\u5efa OpenVPN \u6807\u51c6\u914d\u7f6e\u76ee\u5f55\u5e76\u5c06\u6587\u4ef6\u590d\u5236\u8fdb\u53bb&#xff0c;\u91cd\u547d\u540d\u4e3a .conf&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> -p \/etc\/openvpn\/client<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">cp<\/span> ~\/callisto_zhangyu.ovpn \/etc\/openvpn\/client\/callisto_zhangyu.conf\n <\/li>\n<li>\u5904\u7406\u4f9d\u8d56\u6587\u4ef6:\n<ul>\n<li>\u8bc1\u4e66\/\u5bc6\u94a5: \u5982\u679c .ovpn \u6587\u4ef6\u5185\u4f7f\u7528 ca, cert, key, tls-auth \u7b49\u6307\u4ee4\u5f15\u7528\u4e86\u5916\u90e8\u6587\u4ef6 (.crt, .key, ta.key \u7b49)&#xff0c;\u8bf7\u5c06\u8fd9\u4e9b\u6587\u4ef6\u4e5f\u590d\u5236\u5230 \/etc\/openvpn\/client\/ \u76ee\u5f55\u4e0b\u3002\u786e\u4fdd .conf \u6587\u4ef6\u4e2d\u5f15\u7528\u8fd9\u4e9b\u6587\u4ef6\u65f6\u6ca1\u6709\u8def\u5f84&#xff0c;\u53ea\u6709\u6587\u4ef6\u540d&#xff08;\u56e0\u4e3a\u5b83\u4eec\u5728\u540c\u4e00\u76ee\u5f55&#xff09;\u3002<span class=\"token comment\"># \u793a\u4f8b: \u5982\u679c\u9700\u8981 ca.crt \u548c user.key<\/span><br \/>\n<span class=\"token comment\"># sudo cp ~\/ca.crt \/etc\/openvpn\/client\/<\/span><br \/>\n<span class=\"token comment\"># sudo cp ~\/user.key \/etc\/openvpn\/client\/<\/span>\n <\/li>\n<li>\u7528\u6237\u540d\/\u5bc6\u7801: \u5982\u679c VPN \u9700\u8981\u8ba4\u8bc1&#xff0c;\u7f16\u8f91 .conf \u6587\u4ef6&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/openvpn\/client\/callisto_zhangyu.conf<br \/>\n \u627e\u5230 auth-user-pass \u8fd9\u4e00\u884c (\u5982\u679c\u5b58\u5728)\u3002\u5982\u679c\u5b83\u540e\u9762\u6ca1\u6709\u6307\u5b9a\u6587\u4ef6\u540d&#xff0c;\u5c06\u5176\u6539\u4e3a auth-user-pass auth.txt\u3002\u7136\u540e&#xff0c;\u5728 \/etc\/openvpn\/client\/ \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a auth.txt \u6587\u4ef6&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/openvpn\/client\/auth.txt<br \/>\n \u6587\u4ef6\u5185\u5bb9\u4e3a\u4e24\u884c&#xff1a;\u7b2c\u4e00\u884c\u662f\u4f60\u7684 VPN \u7528\u6237\u540d&#xff0c;\u7b2c\u4e8c\u884c\u662f\u4f60\u7684 VPN \u5bc6\u7801\u3002\u4fdd\u5b58\u5e76\u9000\u51fa\u3002 \u8bbe\u7f6e\u4e25\u683c\u6743\u9650&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">chmod<\/span> <span class=\"token number\">600<\/span> \/etc\/openvpn\/client\/auth.txt\n <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u542f\u52a8\u5e76\u9a8c\u8bc1 OpenVPN \u8fde\u63a5:<\/p>\n<p> <span class=\"token comment\"># \u8bbe\u7f6e\u670d\u52a1\u5f00\u673a\u81ea\u542f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> openvpn-client&#064;callisto_zhangyu<\/p>\n<p><span class=\"token comment\"># \u7acb\u5373\u542f\u52a8\u670d\u52a1<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl start openvpn-client&#064;callisto_zhangyu<\/p>\n<p><span class=\"token comment\"># \u8be6\u7ec6\u68c0\u67e5\u670d\u52a1\u72b6\u6001<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl status openvpn-client&#064;callisto_zhangyu &#8211;no-pager -l<br \/>\n<span class=\"token comment\"># \u6309 &#039;q&#039; \u9000\u51fa\u3002\u7559\u610f\u662f\u5426\u6709\u9519\u8bef\u4fe1\u606f\u3002<\/span><\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6700\u65b0\u7684\u65e5\u5fd7<\/span><br \/>\n<span class=\"token function\">sudo<\/span> journalctl -u openvpn-client&#064;callisto_zhangyu -n <span class=\"token number\">50<\/span> &#8211;no-pager<\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5 VPN \u7f51\u7edc\u63a5\u53e3 (\u901a\u5e38\u662f tun0) \u662f\u5426\u51fa\u73b0\u5e76\u83b7\u5f97 IP<\/span><br \/>\n<span class=\"token function\">ip<\/span> a <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> tun<br \/>\n<span class=\"token comment\"># \u5e94\u8be5\u80fd\u770b\u5230\u7c7b\u4f3c tun0 \u7684\u63a5\u53e3\u548c 10.8.x.x \u7684 IP \u5730\u5740\u3002\u8bb0\u4e0b\u8fd9\u4e2a\u63a5\u53e3\u540d\u3002<\/span><\/p>\n<p><span class=\"token comment\"># ***\u5173\u952e\u6d4b\u8bd5***: \u5728\u4e2d\u8f6c\u670d\u52a1\u5668\u672c\u673a ping \u76ee\u6807 VPN IP<\/span><br \/>\n<span class=\"token function\">ping<\/span> -c <span class=\"token number\">4<\/span> <span class=\"token number\">10.8<\/span>.0.4<br \/>\n<span class=\"token comment\"># \u5fc5\u987b\u80fd ping \u901a&#xff01;\u5426\u5219\u540e\u7eed\u6b65\u9aa4\u65e0\u6548\u3002\u6309 Ctrl&#043;C \u505c\u6b62\u3002<\/span>\n <\/li>\n<p>\u7b2c 3 \u6b65&#xff1a;\u542f\u7528 IP \u8f6c\u53d1<\/p>\n<li>\u7f16\u8f91 sysctl \u914d\u7f6e\u6587\u4ef6:<span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/sysctl.conf\n <\/li>\n<li>\u53d6\u6d88\u6ce8\u91ca\u6216\u6dfb\u52a0: \u627e\u5230 #net.ipv4.ip_forward&#061;1&#xff0c;\u5220\u9664 #\u3002\u82e5\u6ca1\u6709\u5219\u5728\u672b\u5c3e\u6dfb\u52a0 net.ipv4.ip_forward&#061;1\u3002<\/li>\n<li>\u4fdd\u5b58\u5e76\u9000\u51fa\u3002<\/li>\n<li>\u7acb\u5373\u5e94\u7528:<span class=\"token function\">sudo<\/span> sysctl -p\n <\/li>\n<li>\u9a8c\u8bc1: cat \/proc\/sys\/net\/ipv4\/ip_forward \u5e94\u8f93\u51fa 1\u3002<\/li>\n<p>\u7b2c 4 \u6b65&#xff1a;\u914d\u7f6e\u9632\u706b\u5899 (iptables) \u548c NAT<\/p>\n<li>\u518d\u6b21\u786e\u8ba4\u63a5\u53e3\u540d\u79f0:\n<ul>\n<li>\u5c40\u57df\u7f51\u63a5\u53e3 (\u5982 eth0)<\/li>\n<li>VPN \u63a5\u53e3 (\u5982 tun0)<\/li>\n<\/ul>\n<\/li>\n<li>\u8bbe\u7f6e iptables \u89c4\u5219 (\u8bf7\u5c06\u4e0b\u9762\u547d\u4ee4\u4e2d\u7684 eth0 \u548c tun0 \u66ff\u6362\u4e3a\u4f60\u7684\u5b9e\u9645\u63a5\u53e3\u540d):<span class=\"token comment\"># \u89c4\u5219 1: NAT &#8211; \u4f2a\u88c5\u6e90\u5730\u5740<\/span><br \/>\n<span class=\"token comment\"># \u8ba9\u4ece\u5c40\u57df\u7f51(192.168.5.0\/24)\u6765&#xff0c;\u7ecfVPN\u63a5\u53e3(tun0)\u51fa\u53bb\u7684\u6d41\u91cf&#xff0c;\u6e90IP\u53d8\u6210tun0\u7684IP<\/span><br \/>\n<span class=\"token function\">sudo<\/span> iptables -t nat -A POSTROUTING -s <span class=\"token number\">192.168<\/span>.5.0\/24 -o tun0 -j MASQUERADE<br \/>\n<span class=\"token comment\"># \u89e3\u91ca: -t nat \u6307\u5b9a\u64cd\u4f5cnat\u8868; -A POSTROUTING \u6dfb\u52a0\u5230POSTROUTING\u94fe(\u5728\u8def\u7531\u4e4b\u540e\u4fee\u6539);<\/span><br \/>\n<span class=\"token comment\"># -s \u6e90\u5730\u5740\u8303\u56f4; -o \u51fa\u53e3\u63a5\u53e3; -j MASQUERADE \u8fdb\u884c\u6e90\u5730\u5740\u4f2a\u88c5<\/span><\/p>\n<p><span class=\"token comment\"># \u89c4\u5219 2: FORWARD &#8211; \u5141\u8bb8\u8f6c\u53d1\u7279\u5b9a\u6d41\u91cf<\/span><br \/>\n<span class=\"token comment\"># \u5141\u8bb8\u4ece\u5c40\u57df\u7f51\u63a5\u53e3(eth0)\u8fdb&#xff0c;\u6e90\u4e8e192.168.5.0\/24&#xff0c;\u53bb\u5f80VPN\u63a5\u53e3(tun0)&#xff0c;\u76ee\u6807\u662f10.8.0.4\u7684\u6570\u636e\u5305\u901a\u8fc7<\/span><br \/>\n<span class=\"token function\">sudo<\/span> iptables -A FORWARD -i eth0 -s <span class=\"token number\">192.168<\/span>.5.0\/24 -o tun0 -d <span class=\"token number\">10.8<\/span>.0.4 -j ACCEPT<br \/>\n<span class=\"token comment\"># \u89e3\u91ca: -A FORWARD \u6dfb\u52a0\u5230FORWARD\u94fe(\u63a7\u5236\u8f6c\u53d1); -i \u5165\u53e3\u63a5\u53e3; -s \u6e90\u5730\u5740; -o \u51fa\u53e3\u63a5\u53e3; -d \u76ee\u6807\u5730\u5740; -j ACCEPT \u5141\u8bb8\u901a\u8fc7<\/span><\/p>\n<p><span class=\"token comment\"># \u89c4\u5219 3: FORWARD &#8211; \u5141\u8bb8\u8fd4\u56de\u6d41\u91cf<\/span><br \/>\n<span class=\"token comment\"># \u5141\u8bb8\u5df2\u7ecf\u5efa\u7acb\u7684\u8fde\u63a5(RELATED)\u6216\u5c5e\u4e8e\u73b0\u6709\u8fde\u63a5(ESTABLISHED)\u7684\u8fd4\u56de\u6570\u636e\u5305(\u4eceVPN\u63a5\u53e3\u8fdb&#xff0c;\u53bb\u5f80\u5c40\u57df\u7f51\u63a5\u53e3)\u901a\u8fc7<\/span><br \/>\n<span class=\"token function\">sudo<\/span> iptables -A FORWARD -i tun0 -o eth0 -m state &#8211;state RELATED,ESTABLISHED -j ACCEPT<br \/>\n<span class=\"token comment\"># \u89e3\u91ca: -m state \u4f7f\u7528\u8fde\u63a5\u72b6\u6001\u5339\u914d; &#8211;state RELATED,ESTABLISHED \u5339\u914d\u76f8\u5173\u6216\u5df2\u5efa\u7acb\u72b6\u6001; -j ACCEPT \u5141\u8bb8<\/span><\/p>\n<p><span class=\"token comment\"># (\u53ef\u9009&#xff0c;\u66f4\u5b89\u5168): \u5982\u679c\u53ea\u60f3\u5141\u8bb8\u4f60\u7684\u7279\u5b9a\u7535\u8111(192.168.5.9)\u8bbf\u95ee&#xff0c;\u5c06\u89c4\u52192\u66ff\u6362\u4e3a:<\/span><br \/>\n<span class=\"token comment\"># sudo iptables -A FORWARD -i eth0 -s 192.168.5.9 -o tun0 -d 10.8.0.4 -j ACCEPT<\/span>\n <\/li>\n<li>\u4fdd\u5b58 iptables \u89c4\u5219\u4f7f\u5176\u6301\u4e45\u5316:<span class=\"token function\">sudo<\/span> netfilter-persistent save\n <\/li>\n<p>\u7b2c 5 \u6b65&#xff1a;\u914d\u7f6e\u4f60\u7684\u5ba2\u6237\u7aef\u7535\u8111 (192.168.5.9)<\/p>\n<li>\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00 \u547d\u4ee4\u63d0\u793a\u7b26(CMD) \u6216 PowerShell\u3002<\/li>\n<li>\u5220\u9664\u65e7\u8def\u7531 (\u5982\u679c\u5b58\u5728):route delete 10<span class=\"token punctuation\">.<\/span>8<span class=\"token punctuation\">.<\/span>0<span class=\"token punctuation\">.<\/span>4\n <\/li>\n<li>\u6dfb\u52a0\u6307\u5411\u65b0\u4e2d\u8f6c\u7f51\u5173\u7684\u9759\u6001\u8def\u7531:<span class=\"token comment\"># \u5c06 192.168.5.200 \u66ff\u6362\u4e3a\u4f60\u7ed9\u4e2d\u8f6c\u670d\u52a1\u5668\u8bbe\u7f6e\u7684\u5b9e\u9645\u9759\u6001 IP<\/span><br \/>\nroute add 10<span class=\"token punctuation\">.<\/span>8<span class=\"token punctuation\">.<\/span>0<span class=\"token punctuation\">.<\/span>4 mask 255<span class=\"token punctuation\">.<\/span>255<span class=\"token punctuation\">.<\/span>255<span class=\"token punctuation\">.<\/span>255 192<span class=\"token punctuation\">.<\/span>168<span class=\"token punctuation\">.<\/span>5<span class=\"token punctuation\">.<\/span>200 <span class=\"token operator\">&#8211;<\/span>p\n <\/li>\n<li>\u9a8c\u8bc1\u8def\u7531\u662f\u5426\u6dfb\u52a0\u6210\u529f: route print -4 (\u67e5\u627e\u76ee\u6807\u4e3a 10.8.0.4 \u7684\u6761\u76ee)\u3002<\/li>\n<p>\u7b2c 6 \u6b65&#xff1a;\u6d4b\u8bd5<\/p>\n<li>\u786e\u4fdd\u4e2d\u8f6c\u670d\u52a1\u5668 (192.168.5.200) \u8fd0\u884c\u6b63\u5e38&#xff0c;OpenVPN \u5df2\u8fde\u63a5\u3002<\/li>\n<li>\u5728\u5ba2\u6237\u7aef\u7535\u8111 (192.168.5.9) \u4e0a&#xff0c;\u786e\u4fdd\u6ca1\u6709\u8fd0\u884c OpenVPN \u5ba2\u6237\u7aef\u3002<\/li>\n<li>\u5c1d\u8bd5 ping 10.8.0.4\u3002<\/li>\n<li>\u5c1d\u8bd5\u8bbf\u95ee\u4f9d\u8d56 10.8.0.4 \u7684\u7f51\u7edc\u670d\u52a1\u3002<\/li>\n<p>\u7b2c 7 \u6b65&#xff1a;\u5982\u4f55\u505c\u6b62\/\u7981\u7528 VPN \u7f51\u5173\u529f\u80fd<\/p>\n<p>\u5f53\u4f60\u4e0d\u518d\u9700\u8981\u8fd9\u4e2a\u4e2d\u8f6c\u529f\u80fd\u65f6&#xff0c;\u53ef\u4ee5\u6309\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c&#xff1a;<\/p>\n<li>\u5728\u5ba2\u6237\u7aef\u7535\u8111 (192.168.5.9) \u4e0a:\n<ul>\n<li>\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00 CMD \u6216 PowerShell\u3002<\/li>\n<li>\u5220\u9664\u9759\u6001\u8def\u7531&#xff1a;route delete 10<span class=\"token punctuation\">.<\/span>8<span class=\"token punctuation\">.<\/span>0<span class=\"token punctuation\">.<\/span>4\n <\/li>\n<\/ul>\n<\/li>\n<li>\u5728\u4e2d\u8f6c\u7f51\u5173\u670d\u52a1\u5668 (192.168.5.200) \u4e0a:\n<ul>\n<li>\u505c\u6b62 OpenVPN \u670d\u52a1&#xff1a;<span class=\"token function\">sudo<\/span> systemctl stop openvpn-client&#064;callisto_zhangyu\n <\/li>\n<li>(\u53ef\u9009) \u7981\u6b62 OpenVPN \u670d\u52a1\u5f00\u673a\u81ea\u542f&#xff1a;<span class=\"token function\">sudo<\/span> systemctl disable openvpn-client&#064;callisto_zhangyu\n <\/li>\n<li>(\u53ef\u9009) \u7981\u7528 IP \u8f6c\u53d1&#xff1a;<span class=\"token comment\"># \u4e34\u65f6\u7981\u7528<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sysctl -w net.ipv4.ip_forward<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0<\/span><br \/>\n<span class=\"token comment\"># \u6c38\u4e45\u7981\u7528 (\u7f16\u8f91 \/etc\/sysctl.conf, \u5c06 net.ipv4.ip_forward&#061;1 \u6539\u56de 0 \u6216\u6ce8\u91ca\u6389)<\/span><br \/>\n<span class=\"token comment\"># sudo nano \/etc\/sysctl.conf<\/span><br \/>\n<span class=\"token comment\"># sudo sysctl -p<\/span>\n <\/li>\n<li>(\u53ef\u9009) \u6e05\u9664\u6dfb\u52a0\u7684 iptables \u89c4\u5219&#xff1a;\n<ul>\n<li>\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u662f\u91cd\u542f\u670d\u52a1\u5668&#xff08;\u5982\u679c\u89c4\u5219\u6ca1\u6709\u5b8c\u5168\u6301\u4e45\u5316\u6216\u8005\u4f60\u60f3\u6062\u590d\u5230\u9ed8\u8ba4\u72b6\u6001&#xff09;\u3002<\/li>\n<li>\u6216\u8005\u624b\u52a8\u5220\u9664\u89c4\u5219 (\u7528 iptables -D \u52a0\u4e0a\u89c4\u5219\u5185\u5bb9&#xff0c;\u4f8b\u5982 sudo iptables -t nat -D POSTROUTING -s 192.168.5.0\/24 -o tun0 -j MASQUERADE)\u3002<\/li>\n<li>\u6216\u8005\u6e05\u9664\u6240\u6709\u89c4\u5219\u5e76\u4fdd\u5b58\u7a7a\u89c4\u5219\u96c6&#xff08;\u614e\u7528&#xff01;\u4f1a\u6e05\u9664\u6240\u6709\u89c4\u5219&#xff09;&#xff1a;<span class=\"token comment\"># sudo iptables -F # \u6e05\u7a7a filter \u8868\u89c4\u5219<\/span><br \/>\n<span class=\"token comment\"># sudo iptables -t nat -F # \u6e05\u7a7a nat \u8868\u89c4\u5219<\/span><br \/>\n<span class=\"token comment\"># sudo iptables -X # \u5220\u9664\u81ea\u5b9a\u4e49\u94fe<\/span><br \/>\n<span class=\"token comment\"># sudo netfilter-persistent save # \u4fdd\u5b58\u7a7a\u89c4\u5219<\/span>\n <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<p>\u7b2c 8 \u6b65&#xff1a;\u4e0e FRP \u5185\u7f51\u7a7f\u900f\u7684\u6f5c\u5728\u51b2\u7a81\u8bf4\u660e<\/p>\n<p>\u5982\u679c\u4f60\u8ba1\u5212\u5728\u540c\u4e00\u53f0\u4e2d\u8f6c\u7f51\u5173\u670d\u52a1\u5668 (192.168.5.200) \u4e0a\u540c\u65f6\u8fd0\u884c OpenVPN \u5ba2\u6237\u7aef (\u4f5c\u4e3a\u7f51\u5173) \u548c FRP \u5ba2\u6237\u7aef (frpc) (\u6216\u5176\u4ed6\u7c7b\u4f3c\u5185\u7f51\u7a7f\u900f\u5de5\u5177&#xff0c;\u5982 ngrok\u3001cloudflared tunnel)&#xff0c;\u53ef\u80fd\u4f1a\u9047\u5230\u51b2\u7a81&#xff0c;\u4e3b\u8981\u662f\u8def\u7531\u51b2\u7a81\u3002<\/p>\n<ul>\n<li>\u51b2\u7a81\u539f\u56e0:\n<li>\u9ed8\u8ba4\u8def\u7531 (redirect-gateway): \u5982\u679c\u4f60\u7684 OpenVPN \u914d\u7f6e\u6587\u4ef6\u4e2d\u5305\u542b redirect-gateway def1 \u6216\u7c7b\u4f3c\u9009\u9879&#xff0c;\u5b83\u4f1a\u5f3a\u5236\u670d\u52a1\u5668\u7684\u6240\u6709\u51fa\u7ad9\u6d41\u91cf&#xff08;\u5305\u62ec frpc \u8fde\u63a5 frps \u670d\u52a1\u5668\u7684\u6d41\u91cf&#xff09;\u90fd\u901a\u8fc7 VPN \u96a7\u9053\u3002\u5982\u679c frps \u670d\u52a1\u5668\u4f4d\u4e8e\u516c\u5171\u4e92\u8054\u7f51&#xff0c;\u800c VPN \u63d0\u4f9b\u5546\u963b\u6b62\u67d0\u4e9b\u8fde\u63a5\u6216 VPN \u8fde\u63a5\u4e0d\u7a33\u5b9a&#xff0c;frpc \u53ef\u80fd\u65e0\u6cd5\u8fde\u63a5\u6216\u8fde\u63a5\u7f13\u6162\u3002<\/li>\n<li>\u8def\u7531\u8868\u5f71\u54cd: \u5373\u4f7f\u6ca1\u6709 redirect-gateway&#xff0c;OpenVPN \u4e5f\u4f1a\u6dfb\u52a0\u7279\u5b9a\u7684\u8def\u7531\u3002\u8fd9\u53ef\u80fd\u5f71\u54cd frpc \u9009\u62e9\u54ea\u4e2a\u7f51\u7edc\u63a5\u53e3\u548c\u54ea\u4e2a\u6e90 IP \u5730\u5740\u53bb\u8fde\u63a5 frps \u670d\u52a1\u5668\u3002\u4f8b\u5982&#xff0c;frpc \u53ef\u80fd\u9519\u8bef\u5730\u5c1d\u8bd5\u4f7f\u7528 VPN \u7684 tun0 \u63a5\u53e3 IP \u4f5c\u4e3a\u6e90 IP \u53bb\u8fde\u63a5\u516c\u7f51\u7684 frps&#xff0c;\u5bfc\u81f4\u8fde\u63a5\u5931\u8d25\u3002<\/li>\n<\/li>\n<li>\u5982\u4f55\u907f\u514d\u6216\u7f13\u89e3:\n<li>\u68c0\u67e5 OpenVPN \u914d\u7f6e: \u786e\u4fdd\u4f60\u7684 callisto_zhangyu.conf \u6587\u4ef6\u4e2d\u6ca1\u6709 redirect-gateway def1 \u6307\u4ee4&#xff0c;\u9664\u975e\u4f60\u660e\u786e\u9700\u8981\u6240\u6709\u6d41\u91cf\u90fd\u8d70 VPN\u3002\u53ea\u8ba9 OpenVPN \u63a8\u9001\u5fc5\u8981\u7684\u79c1\u6709\u7f51\u7edc\u8def\u7531&#xff08;\u4f8b\u5982 route 10.8.0.0 255.255.255.0&#xff09;\u901a\u5e38\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002<\/li>\n<li>\u7b56\u7565\u8def\u7531 (\u9ad8\u7ea7): \u5728 Linux \u4e0a\u4f7f\u7528 ip rule \u548c ip route \u4e3a frpc \u8fdb\u7a0b\u6216\u76ee\u6807 frps \u670d\u52a1\u5668\u7684\u6d41\u91cf\u6307\u5b9a\u4e00\u4e2a\u4e0d\u540c\u7684\u8def\u7531\u8868&#xff0c;\u5f3a\u5236\u5b83\u4f7f\u7528\u7269\u7406\u7f51\u5361 (eth0) \u548c\u4f60\u7684\u4e3b\u8def\u7531\u5668 (192.168.5.254) \u51fa\u53bb\u3002\u8fd9\u914d\u7f6e\u8f83\u4e3a\u590d\u6742\u3002<\/li>\n<li>FRP \u7ed1\u5b9a\u6e90 IP (\u82e5\u652f\u6301): \u68c0\u67e5 frpc \u7684\u914d\u7f6e\u6587\u4ef6 (frpc.ini) \u662f\u5426\u652f\u6301 bind_addr \u6216\u7c7b\u4f3c\u9009\u9879&#xff0c;\u5c1d\u8bd5\u5c06\u5176\u7ed1\u5b9a\u5230\u670d\u52a1\u5668\u7684\u7269\u7406 IP (192.168.5.200)\u3002<\/li>\n<li>\u5206\u79bb\u670d\u52a1 (\u6700\u7b80\u5355\u53ef\u9760): \u5c06 OpenVPN \u7f51\u5173\u529f\u80fd\u548c FRP \u5185\u7f51\u7a7f\u900f\u529f\u80fd\u90e8\u7f72\u5728\u4e24\u53f0\u4e0d\u540c\u7684\u673a\u5668&#xff08;\u6216\u865a\u62df\u673a&#xff09;\u4e0a\u3002\u8fd9\u662f\u907f\u514d\u6f5c\u5728\u51b2\u7a81\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u3002<\/li>\n<\/li>\n<\/ul>\n<p>\u7b2c 9 \u6b65&#xff1a;\u6545\u969c\u6392\u9664\u63d0\u793a<\/p>\n<ul>\n<li>\u5ba2\u6237\u7aef ping \u4e0d\u901a 10.8.0.4: \u9010\u6b65\u68c0\u67e5&#xff1a;\u5ba2\u6237\u7aef\u8def\u7531\u662f\u5426\u6b63\u786e&#xff1f;\u4e2d\u8f6c\u670d\u52a1\u5668\u9632\u706b\u5899\/NAT\/\u8f6c\u53d1\u662f\u5426\u914d\u7f6e\u6b63\u786e&#xff1f;\u4e2d\u8f6c\u670d\u52a1\u5668\u81ea\u8eab VPN \u662f\u5426\u8fde\u63a5\u4e14\u80fd ping \u901a 10.8.0.4&#xff1f;<\/li>\n<li>\u4e2d\u8f6c\u670d\u52a1\u5668 VPN \u8fde\u4e0d\u4e0a: \u68c0\u67e5 OpenVPN \u65e5\u5fd7 (journalctl)&#xff0c;\u786e\u8ba4\u914d\u7f6e\u6587\u4ef6\u3001\u8bc1\u4e66\/\u5bc6\u94a5\u3001\u7528\u6237\u540d\/\u5bc6\u7801\u662f\u5426\u6b63\u786e&#xff0c;\u7f51\u7edc\u8fde\u63a5\u662f\u5426\u6b63\u5e38\u3002<\/li>\n<li>\u4e2d\u8f6c\u670d\u52a1\u5668\u65e0\u6cd5\u4e0a\u7f51: \u5982\u679c\u914d\u7f6e\u4e86 redirect-gateway \u6216\u8005\u8def\u7531\/DNS \u8bbe\u7f6e\u9519\u8bef&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u4e2d\u8f6c\u670d\u52a1\u5668\u81ea\u8eab\u65e0\u6cd5\u8bbf\u95ee\u4e92\u8054\u7f51\u3002\u68c0\u67e5 \/etc\/resolv.conf \u548c ip route show\u3002<\/li>\n<\/ul>\n<hr \/>\n<p>\u8fd9\u4e2a\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\u5e94\u8be5\u80fd\u66f4\u597d\u5730\u6307\u5bfc\u4f60\u5b8c\u6210\u8bbe\u7f6e\u3002\u795d\u4f60\u6210\u529f&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb927\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf5\u6b21\u3002(\u6216\u5176\u4ed6\u7c7b\u4f3c\u5185\u7f51\u7a7f\u900f\u5de5\u5177\uff0c\u5982 ngrok\u3001cloudflared tunnel)\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u51b2\u7a81\uff0c\u4e3b\u8981\u662f\u3002\u597d\u7684\uff0c\u8fd9\u662f\u4e00\u4e2a\u66f4\u5b8c\u5584\u548c\u6e05\u6670\u7684\u6559\u7a0b\uff0c\u5305\u542b\u5982\u4f55\u5173\u95ed VPN \u529f\u80fd\u4ee5\u53ca\u4e0e FRP \u5185\u7f51\u7a7f\u900f\u53ef\u80fd\u51b2\u7a81\u7684\u8bf4\u660e\u3002\u5229\u7528\u4e00\u53f0 Linux \u670d\u52a1\u5668\u4f5c\u4e3a OpenVPN \u4e2d\u8f6c\u7f51\u5173\uff0c\u4f7f\u4f60\u7684\u5c40\u57df\u7f51\u7535\u8111 (\u5982\u3002) \u65e0\u9700\u76f4\u63a5\u8fde\u63a5 VPN \u5373\u53ef\u8bbf\u95ee VPN \u7f51\u7edc\u8d44\u6e90 (\u5982\u3002\u8fd9\u4e2a\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\u5e94\u8be5\u80fd\u66f4\u597d\u5730\u6307\u5bfc\u4f60\u5b8c\u6210\u8bbe\u7f6e\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":[43,44],"topic":[],"class_list":["post-37142","post","type-post","status-publish","format-standard","hentry","category-server","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8bbe\u7f6e\u4e2d\u4e13\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\/37142.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8bbe\u7f6e\u4e2d\u4e13\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb927\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf5\u6b21\u3002(\u6216\u5176\u4ed6\u7c7b\u4f3c\u5185\u7f51\u7a7f\u900f\u5de5\u5177\uff0c\u5982 ngrok\u3001cloudflared tunnel)\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u51b2\u7a81\uff0c\u4e3b\u8981\u662f\u3002\u597d\u7684\uff0c\u8fd9\u662f\u4e00\u4e2a\u66f4\u5b8c\u5584\u548c\u6e05\u6670\u7684\u6559\u7a0b\uff0c\u5305\u542b\u5982\u4f55\u5173\u95ed VPN \u529f\u80fd\u4ee5\u53ca\u4e0e FRP \u5185\u7f51\u7a7f\u900f\u53ef\u80fd\u51b2\u7a81\u7684\u8bf4\u660e\u3002\u5229\u7528\u4e00\u53f0 Linux \u670d\u52a1\u5668\u4f5c\u4e3a OpenVPN \u4e2d\u8f6c\u7f51\u5173\uff0c\u4f7f\u4f60\u7684\u5c40\u57df\u7f51\u7535\u8111 (\u5982\u3002) \u65e0\u9700\u76f4\u63a5\u8fde\u63a5 VPN \u5373\u53ef\u8bbf\u95ee VPN \u7f51\u7edc\u8d44\u6e90 (\u5982\u3002\u8fd9\u4e2a\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\u5e94\u8be5\u80fd\u66f4\u597d\u5730\u6307\u5bfc\u4f60\u5b8c\u6210\u8bbe\u7f6e\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/37142.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-14T00:11:06+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/37142.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/37142.html\",\"name\":\"\u8bbe\u7f6e\u4e2d\u4e13\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-14T00:11:06+00:00\",\"dateModified\":\"2025-05-14T00:11:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/37142.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/37142.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/37142.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8bbe\u7f6e\u4e2d\u4e13\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":"\u8bbe\u7f6e\u4e2d\u4e13\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\/37142.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8bbe\u7f6e\u4e2d\u4e13\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb927\u6b21\uff0c\u70b9\u8d5e7\u6b21\uff0c\u6536\u85cf5\u6b21\u3002(\u6216\u5176\u4ed6\u7c7b\u4f3c\u5185\u7f51\u7a7f\u900f\u5de5\u5177\uff0c\u5982 ngrok\u3001cloudflared tunnel)\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u51b2\u7a81\uff0c\u4e3b\u8981\u662f\u3002\u597d\u7684\uff0c\u8fd9\u662f\u4e00\u4e2a\u66f4\u5b8c\u5584\u548c\u6e05\u6670\u7684\u6559\u7a0b\uff0c\u5305\u542b\u5982\u4f55\u5173\u95ed VPN \u529f\u80fd\u4ee5\u53ca\u4e0e FRP \u5185\u7f51\u7a7f\u900f\u53ef\u80fd\u51b2\u7a81\u7684\u8bf4\u660e\u3002\u5229\u7528\u4e00\u53f0 Linux \u670d\u52a1\u5668\u4f5c\u4e3a OpenVPN \u4e2d\u8f6c\u7f51\u5173\uff0c\u4f7f\u4f60\u7684\u5c40\u57df\u7f51\u7535\u8111 (\u5982\u3002) \u65e0\u9700\u76f4\u63a5\u8fde\u63a5 VPN \u5373\u53ef\u8bbf\u95ee VPN \u7f51\u7edc\u8d44\u6e90 (\u5982\u3002\u8fd9\u4e2a\u66f4\u8be6\u7ec6\u7684\u6559\u7a0b\u5e94\u8be5\u80fd\u66f4\u597d\u5730\u6307\u5bfc\u4f60\u5b8c\u6210\u8bbe\u7f6e\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/37142.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-14T00:11:06+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/37142.html","url":"https:\/\/www.wsisp.com\/helps\/37142.html","name":"\u8bbe\u7f6e\u4e2d\u4e13\u670d\u52a1\u5668 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-14T00:11:06+00:00","dateModified":"2025-05-14T00:11:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/37142.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/37142.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/37142.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8bbe\u7f6e\u4e2d\u4e13\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\/37142","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=37142"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/37142\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=37142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=37142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=37142"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=37142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}