{"id":385321,"date":"2021-03-11T11:41:19","date_gmt":"2021-03-11T03:41:19","guid":{"rendered":"http:\/\/4563.org\/?p=385321"},"modified":"2021-03-11T11:41:19","modified_gmt":"2021-03-11T03:41:19","slug":"%e9%98%bf%e9%87%8c%e4%ba%91%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8e%e5%8a%9e%e5%85%ac%e5%ae%a4%e5%86%85%e7%bd%91%e6%97%a0%e6%b3%95%e9%80%9a%e4%bf%a1%ef%bc%8c%e7%9b%ae%e6%b5%8b%e9%98%b2%e7%81%ab%e5%a2%99","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=385321","title":{"rendered":"\u963f\u91cc\u4e91\u670d\u52a1\u5668\u4e0e\u529e\u516c\u5ba4\u5185\u7f51\u65e0\u6cd5\u901a\u4fe1\uff0c\u76ee\u6d4b\u9632\u706b\u5899\u95ee\u9898\uff0c\u8be5\u5982\u4f55\u6392\u67e5\u6545\u969c"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u963f\u91cc\u4e91\u670d\u52a1\u5668\u4e0e\u529e\u516c\u5ba4\u5185\u7f51\u65e0\u6cd5\u901a\u4fe1\uff0c\u76ee\u6d4b\u9632\u706b\u5899\u95ee\u9898\uff0c\u8be5\u5982\u4f55\u6392\u67e5\u6545\u969c               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <span><i><\/i> 10<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u95ee\u9898\u63cf\u8ff0\uff1a<\/p>\n<ul>\n<li>\u963f\u91cc\u4e91\u4e0a\u540c\u4e00\u4e2a VPC \u5185\uff0c\u6709\u4e24\u53f0 ECS \u670d\u52a1\u5668\uff0c\u5176\u4e2d\u4e00\u53f0\u4e3a<strong>\u81ea\u5df1\u642d\u7684<\/strong> VPN \u7f51\u5173<\/li>\n<li>\u529e\u516c\u5ba4\u8def\u7531\u5668\u901a\u8fc7 WireGuard \u8fde\u63a5\u963f\u91cc\u4e91\u7684 VPN \u7f51\u5173<\/li>\n<li>\u5bb6\u91cc\u8def\u7531\u5668\u4ea6\u901a\u8fc7 WireGuard \u8fde\u63a5\u963f\u91cc\u4e91\u7684 VPN \u7f51\u5173<\/li>\n<li> \u963f\u91cc\u4e91\u7684\u7f51\u5173 ECS \u53ef\u4ee5\u4e0e\u529e\u516c\u5ba4\u3001\u5bb6\u91cc\u7684\u5185\u7f51\u8bbe\u5907\u6b63\u5e38\u901a\u4fe1\uff1a\n<ul>\n<li>\u53ef\u4e92 ping<\/li>\n<li>\u53ef\u4e92\u76f8\u8bbf\u95ee HTTP \u670d\u52a1\u3001SSH \u670d\u52a1<\/li>\n<li>\u56e0\u6b64\u6211\u5224\u65ad\u8def\u7531\u8868\u8bbe\u7f6e\u5e94\u8be5\u90fd\u662f\u6b63\u786e\u7684\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u53e6\u4e00\u53f0 ECS \u65e0\u6cd5\u8bbf\u95ee\u529e\u516c\u5ba4\u5185\u7f51\u8bbe\u5907\u3002<\/li>\n<li>\u4e24\u53f0 ECS \u5904\u4e8e\u540c\u4e00 VPC \u5185\uff0c\u4e24\u4e2a\u53ef\u7528\u533a\uff0c\u53ef\u4e92\u76f8\u901a\u4fe1\u3002<\/li>\n<li>\u5728 VPC \u8def\u7531\u8868\u5185\u8bbe\u7f6e\u4e86\u529e\u516c\u5ba4\u548c\u5bb6\u5ead\u7f51\u7edc\u7684\u5185\u7f51\u5730\u5740\u5757\uff0c\u4e0b\u4e00\u8df3\u8bbe\u7f6e\u4e3a\u7f51\u5173 ECS \u3002<\/li>\n<li>\u5728\u53e6\u4e00\u53f0 ECS \u5185\u53ef\u4ee5 ping \u529e\u516c\u5ba4\u7684\u8bbe\u5907\u3002<\/li>\n<li>\u529e\u516c\u5ba4\u7684\u8bbe\u5907\u4e0d\u53ef\u4ee5 ping ECS \u7684\u670d\u52a1\u5668\u3002<\/li>\n<li>\u65e0\u6cd5\u5728 ECS \u548c \u529e\u516c\u5ba4\u8bbe\u5907\u5185\u5efa\u7acb\u4efb\u4f55 TCP \u8fde\u63a5\u3002<\/li>\n<li>\u7f51\u5173 ECS \u7684 iptables\uff0cFORWARD \u8868\u9ed8\u8ba4 ACCEPT\uff0c\u9664\u4e86 Docker \u4e5f\u6ca1\u6709\u5176\u4ed6\u6761\u76ee\u4e86\u3002<\/li>\n<\/ul>\n<p>\u4e24\u4ef6\u6bd4\u8f83\u79bb\u5947\u7684\u4e8b\u60c5\uff1a<\/p>\n<ul>\n<li>\u6211\u5728\u7f51\u5173\u670d\u52a1\u5668\u4e0a\u7684 Docker \u91cc\u5f00\u4e86\u4e00\u4e2a\u5b50\u7f51\uff0c\u91cc\u9762\u7684 curl \u53ef\u4ee5\u8bbf\u95ee\u53e6\u5916\u4e00\u53f0 ECS \u3002<\/li>\n<li>\u5728\u4eca\u5929\u4e4b\u524d\uff0c\u529e\u516c\u5ba4\u5176\u5b9e\u662f\u53ef\u4ee5\u548c\u53e6\u4e00\u53f0 ECS \u901a\u4fe1\u7684\u3002\u4f46\u662f\uff0c\u4e0a\u4e00\u6b21 setup \u4e5f\u66fe\u7ecf\u77ed\u6682\u51fa\u73b0\u8fc7\u7c7b\u4f3c\u7684\u73b0\u8c61\uff0c\u53ea\u4e0d\u8fc7\u5728 VPC \u8def\u7531\u8868\u91cc\u6dfb\u52a0\u4e86\u529e\u516c\u5ba4\u8def\u7531\u6761\u76ee\u540e\uff0c\u8fc7\u4e86\u51e0\u5206\u949f\u81ea\u5df1\u5c31\u89e3\u51b3\u4e86\u3002<\/li>\n<li>\u5728\u51fa\u95ee\u9898\u4e4b\u524d\uff0c\u6211\u4eca\u5929\u521a\u521a\u7b2c\u4e00\u6b21\u8d2d\u4e70\u4e86 RDS \u5b9e\u4f8b\u4e00\u4efd\uff0c\u4e0d\u77e5\u9053\u6709\u6ca1\u6709\u5173\u7cfb\u3002<\/li>\n<\/ul>\n<p>\u5b8c\u5168\u4e0d\u61c2 Linux \u7684\u5c0f\u767d\u4e00\u679a\uff0c\u60f3\u95ee\u95ee\u6709\u6ca1\u6709\u4ec0\u4e48\u529e\u6cd5\u53ef\u4ee5\u6392\u67e5\u6545\u969c\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>17<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5366390\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5728\u529e\u516c\u5ba4\u7684\u8def\u7531\u5668\u4e0a tracepath\uff0c\u80fd\u8fde\u63a5\u5230\u7f51\u5173\u670d\u52a1\u5668\uff0c\u62ff\u5230\u7684\u662f VPN \u91cc\u7684\u5730\u5740\uff0c\u7136\u540e\u5c31\u7edf\u4e00 no reply \u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366391\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Qetesh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u79cd\u7f51\u7edc\u67b6\u6784\u5efa\u8bae\u8003\u8651 nat \u6216\u8005\u5728\u5176\u4ed6 ecs \u542f\u7528 wireguard                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366392\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Qetesh \u662f\u6709\u5728\u8003\u8651 NAT \u4e86\uff0c\u4e0d\u8fc7\u8fd8\u662f\u60f3\u5148\u6392\u67e5\u4e00\u6ce2\u95ee\u9898\u3002\u53ea\u6709\u7f51\u5173\u670d\u52a1\u5668\u6709\u516c\u7f51\u8bbf\u95ee\uff08\u6700\u5916\u9762\u653e\u4e86\u963f\u91cc\u4e91\u7684 NAT \u7f51\u5173\uff09\uff0c\u6240\u4ee5\u6bcf\u4e2a ECS \u585e\u4e00\u4e2a WireGuard \u611f\u89c9\u4e0d\u592a\u73b0\u5b9e\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366393\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : saytesnake <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6309\u7167\u8fd9\u6837\u7684\u9700\u6c42\uff0cNAT to NAT \u624d\u662f\u6b63\u89e3\u3002<\/p>\n<p>https:\/\/anyisalin.github.io\/2018\/11\/21\/fast-flexible-nat-to-nat-vpn-wireguard\/                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366394\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AIFNI45Mdxn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6392\u67e5\u65b9\u5411\uff1a<br \/>1 \u3001\u9996\u5148\u9700\u8981\u5bf9\u4e24\u7aef\u7684\u7f51\u7edc\u73af\u5883\u68c0\u67e5\u4e0b\uff0c\u662f\u5426\u6709\u7f51\u6bb5\u51b2\u7a81\uff0c\u5982\u679c\u4e24\u6bb5\u7684\u7f51\u7edc\u6709\u91cd\u53e0\uff0c\u8fd9\u4e2a\u80af\u5b9a\u662f\u4e0d\u884c\u7684\u3002<br \/>2 \u3001\u7b2c\u4e00\u4e2a\u60c5\u51b5\u6392\u9664\u540e\uff0c\u9700\u8981\u68c0\u67e5 \u4e24\u7aef \u5145\u5f53\u7f51\u5173\u8bbe\u5907\u914d\u7f6e\u7684\u8def\u7531\u662f\u5426 ok \u3002<br \/>3 \u3001\u4e24\u7aef\u7684\u8def\u7531\u6b63\u5e38\u7684\u8bdd\uff0c\u4e00\u822c\u5c31\u6ca1\u6709\u4ec0\u4e48\u5927\u95ee\u9898\u7684\uff0c\u5c31\u9700\u8981\u5177\u4f53\u95ee\u9898\u5177\u4f53\u770b\u4e86\u3002<\/p>\n<p>\u4e24\u53f0\u540c VPC \u7684 ECS\uff0c\u4e00\u53f0\u521b\u5efa\u4e86 Docker\uff0c\u5bb9\u5668\u5185\u53ef\u4ee5\u8bbf\u95ee\u53e6\u5916\u4e00\u53f0\u4e3b\u673a\uff0c\u8fd9\u4e2a\u662f\u56e0\u4e3a ECS \u4e4b\u95f4\u8def\u7531\u3001ECS \u4e0e\u5bb9\u5668\u7684\u8def\u7531\u90fd\u662f\u6709\u7684\uff0c\u80af\u5b9a\u5c31\u53ef\u4ee5\u901a\u4fe1\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366395\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AIFNI45Mdxn <br \/>\u8c22\u8c22\u3002<br \/>1. \u7f51\u6bb5\u5168\u90e8\u90fd\u662f\u6211\u81ea\u5df1\u5206\u914d\u7684\uff0c\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u963f\u91cc\u4e91\u662f 172.X\uff0c\u516c\u53f8\u662f 10.X \u3002<br \/>2. \u516c\u53f8\u7aef\u8def\u7531\u76ee\u6d4b\u662f\u6ca1\u6709\u95ee\u9898\uff0c\u56e0\u4e3a\u5bb6\u91cc\u90e8\u7f72\u4e86\u4e00\u6478\u4e00\u6837\u7684\u7cfb\u7edf\uff0c\u901a\u8fc7\u963f\u91cc\u4e91\u4e2d\u8f6c\uff0c\u5bb6\u91cc\u548c\u516c\u53f8\u4e92\u76f8\u901a\u4fe1\u6210\u529f\u3002\u963f\u91cc\u4e91\u91cc\u7684\u7f51\u5173\u672c\u8eab\u7684\u7a0b\u5e8f\u4e5f\u53ef\u4ee5\u8bbf\u95ee\u516c\u53f8\u5185\u90e8\u3002\u76ee\u524d\u963f\u91cc\u4e91\u7f51\u5173\u8dd1\u4e86\u4e00\u4e2a GitLab\uff0c\u5728\u516c\u53f8\u6709\u4e00\u4e2a GitLab Runner\uff0c\u6b63\u5e38\u4f7f\u7528\u3002\u4ee5\u53ca\u4e24\u8fb9\u90fd\u7528 cURL \u8dd1\u8fc7\uff0c\u53ef\u4ee5\u8bbf\u95ee\u3002<br \/>3. \u6240\u4ee5\u5c31\u96be\u53d7\u4e86\u2026\u2026<\/p>\n<p>\u5173\u4e8e Docker\uff0c\u5176\u5b9e\u6211\u662f\u56e0\u4e3a\u6bd4\u8f83\u786e\u4fe1\u8def\u7531\u90fd\u662f\u5bf9\u7684\uff0c\u6240\u4ee5\u624d\u8bd5\u4e86\u4e00\u4e0b\uff0c\u4f46\u4e5f\u4e0d\u80fd\u8bf4\u660e\u4ec0\u4e48\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366396\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u72af\u4e86\u4e00\u4e2a\u9519\uff0c\u6211\u6ca1\u6709\u5728 VPC \u7684\u8def\u7531\u8868\u91cc\u6dfb\u52a0 WireGuard \u5ba2\u6237\u7aef\u7684\u7f51\u6bb5\u3002\u6211\u753b\u4e00\u6b21\u6211\u7684\u7f51\u7edc\u62d3\u6251\u56fe\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366397\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u73b0\u5728\u963f\u91cc\u4e91\u5185\u90e8\u8bbe\u5907\u53ef\u4ee5\u8bbf\u95ee\u516c\u53f8\u7684\u8def\u7531\u5668\u4e86\uff0c\u7b97\u662f\u8fdb\u6b65                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366398\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : huangmingyou <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u5c42\u4e00\u5c42\u7684 tcpdump \u6293\u5305                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366399\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : podel <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u963f\u91cc\u4e91 VPC \u8bbe\u7f6e\u9759\u6001\u8def\u7531\u8868\u3002 \u672c\u5730\u5185\u7f51\u7f51\u6bb5\u6307\u5411 VPN \u7f51\u5173\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366400\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : podel <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u7ed9\u6211\u4eec\u516c\u53f8\u5c31\u662f\u8fd9\u4e48\u914d\u7f6e\u7684 <br \/>\u963f\u91cc\u4e91 VPC &lt;-&gt; VPN \u7f51\u5173(ECS,\u4f7f\u7528 OpenVPN Server) &lt;-&gt; \u672c\u5730\u670d\u52a1\u5668(OpenWrt \u7cfb\u7edf\uff0c\u4f7f\u7528 OpenVPN Client)<\/p>\n<p>\u5176\u4e2d\u963f\u91cc\u4e91 VPC \u9700\u8981\u8bbe\u7f6e \u9759\u6001\u8def\u7531\u3002 \u672c\u5730\u5c40\u57df\u7f51\u8bbe\u7f6e\u9759\u6001\u8def\u7531\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366401\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : podel <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5bf9\u4e86 \u53e6\u5916 \u4f7f\u7528\u7684\u662f OpenVPN \u7684 TAP \u8bbe\u5907\u505a\u4e8c\u5c42\u8f6c\u53d1\u3002 \u4e4b\u524d TUN \u8bbe\u5907\u8def\u7531\u4e0a\u6b7b\u6d3b\u5f04\u4e0d\u8fc7\u53bb\u3002<br \/>ECS \u4e0a\u9762\u4e5f\u8981\u8bbe\u7f6e\u597d \u6307\u5411\u672c\u5730\u5185\u7f51 \u9759\u6001\u8def\u7531\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366402\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zyzll1234 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56e0\u4e3a\u516c\u53f8\u9632\u706b\u5899\u4e0a\u53ea\u80fd\u7528 symetiric NAT \u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366403\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @podel \u6211\u4e4b\u524d\u5c31\u662f\u8fd9\u4e48\u5e72\u7684\u3002\u6211\u521a\u521a\u624d\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f\u516c\u53f8\u8def\u7531\u5668\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u81ea\u52a8\u7684\u505a\u4e86\u4e00\u6b21 NAT\uff0c\u6211\u660e\u660e\u6ca1\u6709\u914d\u7f6e NAT \u3002\u603b\u4e4b\u6211\u7684\u95ee\u9898\u5728\u628a VPN \u7f51\u6bb5\uff08\u4e0d\u662f\u5185\u7f51\u7f51\u6bb5\uff09\u52a0\u8fdb VPC \u8def\u7531\u540e\u5f97\u5230\u4e86\u89e3\u51b3\u3002\u4f46\u662f\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u963f\u91cc\u4e91\u975e VPN \u670d\u52a1\u5668\u4f9d\u7136\u65e0\u6cd5\u8fde\u63a5\u516c\u53f8\u5185\u7f51\u8bbe\u5907\uff0c\u867d\u7136\u53ef\u4ee5 ping \u901a\u3002\u8fd8\u8981\u518d\u8bd5\u8bd5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366404\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Okay\uff0c\u516c\u53f8\u5185\u90e8\u7684 NAT \u6211\u7834\u6848\u4e86\uff0c\u6211\u662f\u76f4\u63a5\u7528 systemd-networkd \u914d\u7f6e\u7684\uff0cVPN + \u8def\u7531\uff0c\u7136\u540e\u5728\u5bf9\u5e94\u7684 LAN \u7f51\u7edc\u4e0a\u6211\u76f4\u63a5\u5f00\u542f\u4e86 IPMasquerade = true\uff0c\u4e5f\u5c31\u662f SNAT \u6a21\u5f0f\u4e86\u3002<\/p>\n<p>@podel \u4f60\u8bf4\u7684 TAP \u3001TUN \u3001\u4e8c\u5c42\u8f6c\u53d1\u6211\u8fd8\u770b\u4e0d\u592a\u61c2\uff0c\u6211\u81ea\u5df1\u518d\u6478\u7d22\u6478\u7d22\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366405\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @saytesnake \u8c22\u8c22\u8001\u54e5\uff0c\u6700\u7ec8\u61d2\u5f97\u6298\u817e\u4e86\uff0c\u8fd8\u662f\u8d70\u4f60\u7684\u53cc NAT \u9053\u8def\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5366406\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : minsheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6240\u4ee5\uff0c\u5927\u81f4\u7834\u6848\u4e86\uff0c\u603b\u7ed3\u4e00\u4e0b\u3002\u6211\u7684\u7f51\u7edc\u67b6\u6784\u662f\uff1a<\/p>\n<p>* \u963f\u91cc\u4e91 VPC\uff0c\u516c\u53f8\u5185\u7f51\u8def\u7531\u5230\u7f51\u5173\u670d\u52a1\u5668 A \uff1b<br \/>* \u7f51\u5173\u670d\u52a1\u5668 A \u901a\u8fc7 WireGuard \u8fde\u63a5\u5230\u516c\u53f8 \/\u5bb6\u5ead\u8def\u7531\u5668\uff1b<br \/>* \u516c\u53f8 \/\u5bb6\u5ead\u8def\u7531\u5668\uff0c\u5bf9 LAN \u7684\u5168\u90e8\u8bbe\u5907\u505a\u4e86\u4e00\u5c42 NAT\uff0cNAT \u80cc\u540e\u662f\u516c\u53f8 \/\u5bb6\u5ead\u7684\u8bbe\u5907\u3002\u8fd9\u662f\u901a\u8fc7 systemd-networkd \u8bbe\u7f6e\u7684\uff0c\u5e76\u6ca1\u6709\u6839\u636e\u76ee\u6807\u5730\u5740 \/\u8bbe\u5907\u9009\u62e9\u6027\u5173\u95ed\u3002<\/p>\n<p>\u6211\u72af\u4e86\u4e24\u4e2a\u9519\u8bef\uff1a<\/p>\n<p>* \u6211\u6ca1\u6709\u628a WireGuard \u7684\u7f51\u6bb5\u6dfb\u52a0\u5230 VPC \u7684\u8def\u7531\u8868\u91cc\uff0c\u5bfc\u81f4\u4ece\u516c\u53f8\u5185\u90e8\u53d1\u51fa\u7684\u88ab NAT \u7684\u5305\uff08\u7528\u7684\u662f WireGuard \u7684 IP \uff09\uff0c\u627e\u4e0d\u5230\u56de\u4f20\u7684\u5730\u5740\uff0c\u6240\u4ee5\u65e0\u6cd5\u5efa\u7acb\u4ece\u516c\u53f8\u5230 VPC \u7684\u8fde\u63a5\u3002<br \/>* \u6211\u6ca1\u6709\u5bf9\u6765\u81ea VPC \u7684\u975e\u7f51\u5173\u670d\u52a1\u5668\u7684\u5305\u505a NAT \u3002\u6211\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u8fd9\u4f1a\u5bfc\u81f4\u95ee\u9898\uff0c\u4f46\u662f\u53cd\u6b63\u5b83\u5c31\u662f\u4e0d\u80fd work                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u963f\u91cc\u4e91\u670d\u52a1\u5668\u4e0e\u529e\u516c\u5ba4\u5185\u7f51\u65e0\u6cd5\u901a\u4fe1\uff0c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/385321"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=385321"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/385321\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385321"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}