{"id":4732,"date":"2020-05-31T09:47:51","date_gmt":"2020-05-31T01:47:51","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=4732"},"modified":"2020-08-24T17:24:38","modified_gmt":"2020-08-24T09:24:38","slug":"%e5%9c%a8%e5%85%b7%e6%9c%89%e5%8f%8cwan%e6%8e%a5%e5%8f%a3%e7%9a%84pfsense%e4%b8%8a%e4%b8%baopenvpn%e8%ae%be%e7%bd%ae%e6%95%85%e9%9a%9c%e8%bd%ac%e7%a7%bb","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=4732","title":{"rendered":"\u5728\u5177\u6709\u53ccWAN\u63a5\u53e3\u7684pfSense\u4e0a\u4e3aOpenVPN\u8bbe\u7f6e\u6545\u969c\u8f6c\u79fb"},"content":{"rendered":"<p style=\"text-align: justify;\">\u5982\u679c\u4f60\u7684\u7f51\u7edc\u6709\u4e24\u4e2aWAN\u63a5\u53e3\uff0c\u90a3\u4e48\u5728\u4e00\u4e2aWAN\u51fa\u73b0\u6545\u969c\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u672c\u6587\u7684\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u8ba9OpenVPN\u4f7f\u7528\u53e6\u4e00\u4e2a\u6b63\u5e38\u7684WAN\u63a5\u53e3\u4fdd\u6301VPN\u8fde\u63a5\u3002<\/p>\n<h1 id=\"step-01-setup-openvpn\" style=\"text-align: justify;\">\u4e00\u3001\u8bbe\u7f6eOPENVPN<\/h1>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230\u201c<strong>VPN<\/strong>\u201d\u83dc\u5355\uff0c\u7136\u540e\u4ece\u4e0b\u62c9\u5217\u8868\u4e2d\u9009\u62e9\u201c<strong>OpenVPN<\/strong>\u201d\u3002<\/p>\n<p style=\"text-align: justify;\">\u70b9\u51fb\u5e76\u6253\u5f00\u201c<strong>\u5411\u5bfc<\/strong>\u201d<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4734\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/2.png\" width=\"852\" height=\"396\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/2.png 852w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/2-300x139.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/2-768x357.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/2-500x232.png 500w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u9009\u62e9\u201c<strong>\u672c\u5730\u7528\u6237\u8bbf\u95ee<\/strong>\u201d\u4f5c\u4e3a\u8eab\u4efd\u9a8c\u8bc1\u652f\u6301\u7c7b\u578b\u3002\u5355\u51fb\u4e0b\u4e00\u6b65\uff0c\u7136\u540e\u8f6c\u5230\u201c<strong>\u521b\u5efaCA\u8bc1\u4e66<\/strong>\u201d\u90e8\u5206\u3002\u4f7f\u7528<strong>\u63cf\u8ff0\u540d\u79f0<\/strong>\uff0c<strong>\u56fd\u5bb6\/\u5730\u533a\u4ee3\u7801<\/strong>\uff0c<strong>\u7701<\/strong>\uff0c<strong>\u5e02<\/strong>\u548c<strong>\u7ec4\u7ec7<\/strong>\u521b\u5efa\u65b0\u7684CA\u8bc1\u4e66\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4735\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3.png\" width=\"1144\" height=\"801\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3.png 1144w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3-300x210.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3-1024x717.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3-768x538.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/3-428x300.png 428w\" sizes=\"auto, (max-width: 1144px) 100vw, 1144px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u7136\u540e\u8f6c\u5230\u4e0b\u4e00\u6b65\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u670d\u52a1\u5668\u8bc1\u4e66\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4736\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4.png\" width=\"1140\" height=\"809\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4.png 1140w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4-300x213.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4-1024x727.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4-768x545.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/4-423x300.png 423w\" sizes=\"auto, (max-width: 1140px) 100vw, 1140px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u70b9\u51fb\u4e0b\u4e00\u6b65\u3002\u4fee\u6539OpenVPN \u7684\u201c<strong>\u5e38\u89c4\u8bbe\u7f6e<\/strong>\u201d\uff0c\u9009\u62e9\u4e00\u4e2a\u8981\u914d\u7f6e\u7684<strong>\u63a5\u53e3<\/strong>\u3002\u8fd9\u91cc\u9009\u62e9WAN1\u63a5\u53e3\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4737\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/5.png\" width=\"912\" height=\"444\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/5.png 912w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/5-300x146.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/5-768x374.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/5-500x243.png 500w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u6839\u636e\u9700\u8981\uff0c\u4fee\u6539\u201c<strong>\u52a0\u5bc6\u7b97\u6cd5<\/strong> \u201d\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4738\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/6.png\" width=\"911\" height=\"593\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/6.png 911w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/6-300x195.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/6-768x500.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/6-461x300.png 461w\" sizes=\"auto, (max-width: 911px) 100vw, 911px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u8f6c\u5230\u201c<strong>\u96a7\u9053\u8bbe\u7f6e<\/strong>\u201d\u90e8\u5206\u3002<\/p>\n<p style=\"text-align: justify;\">\u6dfb\u52a0\u201c<strong>\u96a7\u9053\u7f51\u7edc<\/strong>\u201d\u5730\u5740\u3002\u8fd9\u662f\u4e00\u4e2a\u865a\u62df\u7f51\u7edc\u5730\u5740\uff0c\u53ef\u63d0\u4f9bIP\u5730\u5740\u8fdb\u884c\u52a0\u5bc6\u8fde\u63a5\u3002\u5b83\u6709\u52a9\u4e8eOpenVPN\u670d\u52a1\u5668\u4e0e\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u79c1\u4eba\u901a\u4fe1\u3002\u8fd9\u91cc\u8f93\u5165\u4e00\u4e2a\u5728\u4f60\u7684\u7f51\u7edc\u4e2d\u4e0d\u5b58\u5728\u7684\u7f51\u7edc\u5730\u5740\u3002\u7136\u540e\uff0c\u6dfb\u52a0\u201c<strong>\u672c\u5730\u7f51\u7edc<\/strong>\u201d\u7684\u7f51\u7edc\u5730\u5740\uff0c\u8fd9\u4e2a\u7f51\u7edc\u5e94\u8be5\u662f\u4f60\u8981\u901a\u8fc7OpenVPN\u8bbf\u95ee\u7684\u7f51\u7edc\u3002<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u53ea\u9700\u542f\u7528\u201c<b>\u5ba2\u6237\u7aef\u524d\u901a\u4fe1<\/b>\u201d\u5373\u53ef\u542f\u7528\u4e0e\u5176\u4ed6OpenVPN\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u901a\u4fe1\u3002<\/li>\n<li>\u8fd9\u91cc\u53ef\u80fd\u9700\u8981\u4e3a\u201c<strong>\u5ba2\u6237\u7aef\u8bbe\u7f6e<\/strong> \u201d\u90e8\u5206\u8f93\u5165\u201c<strong>\u57df\u540d<\/strong>\u201d\u548c\u201c<strong>DNS\u670d\u52a1\u5668<\/strong>\u201d<\/li>\n<li>\u6700\u540e\u9700\u8981\u201c<strong>\u914d\u7f6e\u9632\u706b\u5899<\/strong>\u201d\u6765\u5141\u8bb8\u901a\u8fc7\u96a7\u9053\u7f51\u7edc\u8fdb\u884c\u8fde\u63a5\u3002<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4739\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/7.png\" width=\"912\" height=\"545\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/7.png 912w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/7-300x179.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/7-768x459.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/05\/7-500x300.png 500w\" sizes=\"auto, (max-width: 912px) 100vw, 912px\" \/><\/a>\u7136\u540e\u5355\u51fb\u5b8c\u6210\u6309\u94ae\u3002OpenVPN Server\u5e38\u89c4\u914d\u7f6e\u5df2\u5b8c\u6210\u3002<\/p>\n<p style=\"text-align: justify;\">\u7531\u4e8e\u6211\u4eec\u5c06\u4f7f\u75282\u4e2aWan\u63a5\u53e3\uff0c\u56e0\u6b64\u9700\u8981\u521b\u5efa\u4e24\u4e2a\u9632\u706b\u5899NAT\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219\u3002<\/p>\n<h1 id=\"step-02-create-port-forwarding-rules\" style=\"text-align: justify;\">\u4e8c\u3001\u521b\u5efa\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219\u3002<\/h1>\n<p style=\"text-align: justify;\">\u73b0\u5728\u8f6c\u5230\u201c<strong>\u9632\u706b\u5899<\/strong> \u201d\u9009\u9879\u5361\uff0c\u7136\u540e\u4ece\u4e0b\u62c9\u83dc\u5355\u4e2d\u9009\u62e9\u201c<strong>NAT<\/strong>\u00a0\u201d\u3002\u4e3aWAN1\u63a5\u53e3\u521b\u5efa\u4e24\u4e2a\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219\u3002\u5c06\u6765\u81eaWAN1\u548cWAN2\u63a5\u53e3\u7684OpenVPN\u8fde\u63a5\u8f6c\u53d1\u5230\u672c\u5730\u4e3b\u673a\u3002<\/p>\n<p style=\"text-align: justify;\">\u4f8b\u5982\uff1a\u5982\u679c\u6709\u4e24\u4e2aWAN\uff0c\u5e76\u4e14OpenVPN\u670d\u52a1\u5668\u5728\u7aef\u53e31194\u4e0a\u8fd0\u884c\uff0c\u8bf7\u5c06\u63a5\u53e3\u8bbe\u7f6e\u4e3aLocalhost\uff0c\u7136\u540e\u6dfb\u52a0\u4e24\u4e2a\u7aef\u53e3\u8f6c\u53d1\uff1a<\/p>\n<pre style=\"text-align: justify;\"><span style=\"color: #000000;\">WAN1-UDP\uff0c\u6e90*\uff0c\u76ee\u6807WAN1\u5730\u5740\uff0c\u7aef\u53e31194\uff0c\u91cd\u5b9a\u5411\u76ee\u6807127.0.0.1\uff0c\u7aef\u53e31194 <\/span>\r\n\r\n<span style=\"color: #000000;\">WAN2-UDP\uff0c\u6e90*\uff0c\u76ee\u6807WAN2\u5730\u5740\uff0c\u7aef\u53e31194\uff0c\u91cd\u5b9a\u5411\u76ee\u6807127.0.0.1\uff0c\u7aef\u53e31194<\/span><\/pre>\n<p style=\"text-align: justify;\">\u540c\u65f6\u4e3aWAN2\u63a5\u53e3\u521b\u5efa\u76f8\u540c\u7684\u89c4\u5219\u3002<\/p>\n<h1 id=\"step-03-install-openvpn-client-export-package\" style=\"text-align: justify;\">\u4e09\u3001\u5b89\u88c5\u201cOPENVPN CLIENT EXPORT\u201d\u63d2\u4ef6<\/h1>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230\u201c<strong>\u7cfb\u7edf<\/strong>\u201d\u83dc\u5355\uff0c\u7136\u540e\u9009\u62e9\u201c\u63d2\u4ef6\u7ba1\u7406 \u201d\uff0c\u641c\u7d22\u201c <strong>openvpn-client-export<\/strong> \u201d\u63d2\u4ef6\u5e76\u5b89\u88c5\u3002<\/p>\n<h1 style=\"text-align: justify;\">\u56db\u3001\u521b\u5efaOpenVPN\u7528\u6237<\/h1>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230\u201c<strong>\u7cfb\u7edf<\/strong> \u201d&gt;\u201c<strong>\u7528\u6237<\/strong><strong>\u7ba1\u7406<\/strong> \u201d\uff0c\u521b\u5efa\u4e00\u4e2aOpenVPN\u5ba2\u6237\u7aef\u7528\u6237\u3002\u53ef\u4ee5\u9009\u62e9\u542f\u7528\u201c<strong>\u8bc1\u4e66<\/strong>\u00a0\u201d\u9009\u9879\u4e3a\u6bcf\u4e2a\u7528\u6237\u521b\u5efa\u7528\u6237\u8bc1\u4e66<\/p>\n<h1 id=\"step-04-openvpn-server-modification\" style=\"text-align: justify;\">\u4e94\u3001\u4fee\u6539OPENVPN\u670d\u52a1\u5668<\/h1>\n<p style=\"text-align: justify;\">\u8f6c\u5230OpenVPN\u4e2d\u7684\u201c<strong>\u5ba2\u6237\u7aef\u5bfc\u51fa<\/strong>\u00a0\u201d\u90e8\u5206\u3002\u4fee\u6539\u201c<strong>OpenVPN Server<\/strong>\u00a0\u201d\u8bbe\u7f6e\u3002\u5c06\u201c<strong>\u4e3b\u673a\u540d\u89e3\u6790<\/strong> \u201d\u00a0\u66f4\u6539\u4e3a\u201c localhost\u201d\uff0c\u5c06\u8fd9\u4e9b\u6761\u76ee\u6dfb\u52a0\u5230\u201c\u00a0<b>\u9ad8\u7ea7\u914d\u7f6e\u9009\u9879<\/b>\u201d\u4e2d\u3002<\/p>\n<p style=\"text-align: justify;\">\u8fd9\u4e9b\u662fOpenVPN\u8fde\u63a5\u8981\u4f7f\u7528\u7684\u516c\u5171IP\u5730\u5740\u3002<\/p>\n<pre style=\"text-align: justify;\"><code class=\"language-plaintext highlighter-rouge\">remote 192.168.0.2 1194 udp<\/code> <code class=\"language-plaintext highlighter-rouge\">remote 192.168.10.250 1194 udp<\/code><\/pre>\n<p style=\"text-align: justify;\">\u81f3\u6b64\uff0c\u53ccWAN\u8fde\u63a5\u7684OpenVPN\u914d\u7f6e\u5df2\u5b8c\u6210\u3002\u73b0\u5728\u5982\u679c\u4e00\u4e2a\u94fe\u63a5\u65ad\u5f00\uff0c\u5219\u53e6\u4e00\u4e2a\u63a5\u53e3\u5f00\u59cb\u8d77\u4f5c\u7528\u3002\u4f46\u662f\u8981\u6ce8\u610f\u4e0e\u53e6\u4e00\u4e2a\u63a5\u53e3\u6062\u590d\u8fde\u63a5\u53ef\u80fd\u9700\u8981\u8fd160\u79d2\u5de6\u53f3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4f60\u7684\u7f51\u7edc\u6709\u4e24\u4e2aWAN\u63a5\u53e3\uff0c\u90a3\u4e48\u5728\u4e00\u4e2aWAN\u51fa\u73b0\u6545\u969c\u7684\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7\u672c\u6587\u7684\u8bbe\u7f6e\uff0c &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=4732\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[114],"class_list":["post-4732","post","type-post","status-publish","format-standard","hentry","category-pfsense","tag-openvpn"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/4732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4732"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/4732\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}