{"id":5630,"date":"2020-07-23T09:21:01","date_gmt":"2020-07-23T01:21:01","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=5630"},"modified":"2022-11-22T20:54:39","modified_gmt":"2022-11-22T12:54:39","slug":"%e5%9c%a8pfsense%e4%b8%ad%e4%bd%bf%e7%94%a8%e8%b7%af%e7%94%b1ipsecvti","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=5630","title":{"rendered":"pfSense\u4f7f\u7528\u8def\u7531IPsec(VTI)"},"content":{"rendered":"<header>\n<p style=\"text-align: justify;\"><strong>\u57fa\u4e8e\u8def\u7531<\/strong>\u7684IPsec\u662f\u7ba1\u7406IPsec\u6d41\u91cf\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u3002if_ipsec(4)\u4eceFreeBSD 11.1+\u5f00\u59cb\u7528\u4e8e\u865a\u62df\u96a7\u9053\u63a5\u53e3\uff08Virtual tunnel interface\uff0c\u7b80\u79f0VTI\uff09\uff0c\u5e76\u4e14\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u8def\u7531\u8868\u5b9a\u5411\u6d41\u91cf\u3002\u5b83\u4e0d\u4f9d\u8d56\u4e25\u683c\u7684\u5185\u6838\u5b89\u5168\u5173\u8054\u5339\u914d\uff0c\u4f8b\u5982\u57fa\u4e8e\u7b56\u7565\u7684\uff08\u96a7\u9053\u5f0f\uff09IPsec\u3002\u4ece2.4.4\u5f00\u59cb\u59cb\uff0cpfSense\u5f00\u59cb\u63d0\u4f9bIPsec(VTI)\u529f\u80fd\u3002<\/p>\n<p style=\"text-align: justify;\"><code class=\"docutils literal notranslate\"><span class=\"pre\">ipsecX<\/span><\/code>\u8def\u7531\u7684 IPsec \u96a7\u9053\u5728\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u522b\u521b\u5efa\u4e00\u4e2a\u63a5\u53e3\uff0c\u8fd9\u4e2a\u63a5\u53e3\u6709\u81ea\u5df1\u7684 IP \u5730\u5740\u3002\u5728\u5206\u914d\u63a5\u53e3\u540e\u53ef\u7528\u4e8e\u9759\u6001\u6216\u52a8\u6001\u8def\u7531\u3001\u5b88\u62a4\u8fdb\u7a0b\u7ed1\u5b9a\u3001\u6d41\u91cf\u76d1\u63a7\u7b49\u3002<\/p>\n<p style=\"text-align: justify;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff0cIPsec(VTI)\u6700\u5e38\u7528\u7684\u529f\u80fd\uff0c\u5c31\u662f\u901a\u8fc7IPsec VPN\u96a7\u9053\u7f51\u7edc\u4f7f\u7528\u8fdc\u7a0b\u7f51\u5173\u3002<\/strong><\/p>\n<p style=\"text-align: justify;\">\u5728\u672c\u4f8b\u4e2d\uff0c\u5b9a\u4e49\u7684\u4f20\u8f93\u7f51\u7edc\u4f7f\u7528\/ 30\u63a9\u7801\uff0c\u56e0\u4e3a\u53ea\u9700\u8981\u4e24\u4e2aIP\uff0c\u4e00\u4e2a\u7aef\u70b9\u4e00\u4e2a\uff0c\u672c\u4f8b\u4f7f\u752810.10.10.1\/30\u3002<\/p>\n<\/header>\n<div style=\"text-align: justify;\"><\/div>\n<h1 style=\"text-align: justify;\"><span style=\"color: #000000; font-weight: bold;\">IPsec\u914d\u7f6e<\/span><\/h1>\n<p style=\"text-align: justify;\">\u50cf\u901a\u5e38\u4e00\u6837\u521b\u5efaIPsec\u9636\u6bb51\u6761\u76ee\uff08\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\uff09\u3002\u5728\u8282\u70b91\u4e0a\uff0c\u6309\u4ee5\u4e0b\u683c\u5f0f\u521b\u5efaIPsec\u9636\u6bb52\u6761\u76ee\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u6a21\u5f0f\uff1a\u8def\u7531\uff08VTI\uff09<\/li>\n<li>\u672c\u5730\u7f51\u7edc\uff1a <code>10.10.10.1\/30<\/code><\/li>\n<li>\u8fdc\u7a0b\u7f51\u7edc\uff1a\u00a0<code>10.10.10.2<\/code><\/li>\n<li>\u6839\u636e\u9700\u8981\u8bbe\u7f6e\u63d0\u6848\u90e8\u5206\u3002<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58\uff0c\u7136\u540e\u5355\u51fb\u5e94\u7528\u66f4\u6539<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5637\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52.png\" alt=\"\" width=\"1152\" height=\"1325\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52.png 1152w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52-261x300.png 261w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52-890x1024.png 890w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52-768x883.png 768w\" sizes=\"auto, (max-width: 1152px) 100vw, 1152px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5728\u8282\u70b92\u4e0a\uff0c\u521b\u5efa\u4e0e\u8282\u70b91\u7c7b\u4f3c\u7684IPsec\u9636\u6bb52\u6761\u76ee\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u6a21\u5f0f\uff1a\u8def\u7531\uff08VTI\uff09<\/li>\n<li>\u672c\u5730\u7f51\u7edc\uff1a <code>10.10.10.2\/30<\/code><\/li>\n<li>\u8fdc\u7a0b\u7f51\u7edc\uff1a\u00a0<code>10.10.10.1<\/code><\/li>\n<li>\u63d0\u6848\u90e8\u5206\u4e0e\u8282\u70b91\u76f8\u540c\u3002<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58\uff0c\u7136\u540e\u5355\u51fb\u5e94\u7528\u66f4\u6539<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5638\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52.png\" alt=\"\" width=\"1149\" height=\"1330\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52.png 1149w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52-259x300.png 259w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52-885x1024.png 885w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_VPN_IPsec_\u96a7\u9053_\u7f16\u8f91\u9636\u6bb52-768x889.png 768w\" sizes=\"auto, (max-width: 1149px) 100vw, 1149px\" \/><\/a><\/p>\n<h1 style=\"text-align: justify;\"><span id=\"2_%E6%8E%A5%E5%8F%A3%E7%9A%84%E5%88%86%E9%85%8D\" class=\"ez-toc-section\"><\/span><span id=\"Attribution_d'une_interface\"><\/span><span id=\"Attribution_d.27une_interface\" class=\"mw-headline\"><span class=\"mw-headline-number\">\u5206\u914dVTI<\/span><\/span><\/h1>\n<p style=\"text-align: justify;\">\u5728\u8282\u70b91\u548c\u8282\u70b92\u4e0a\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u5bfc\u822a\u5230<strong>Interfaces &gt; Assignments\uff08\u7f51\u7edc\u63a5\u53e3&gt;\u63a5\u53e3\u7ba1\u7406\uff09<\/strong><\/li>\n<li>\u4ece\u5217\u8868\u4e2d\u9009\u62e9\u63a5\u53e3\u53ef\u7528\u7f51\u7edc\u63a5\u53e3<code>ipsec1000<\/code>\uff0c\u7136\u540e\u5355\u51fb\u201c\u6dfb\u52a0\u201d\u3002\u6ce8\u610f\u521b\u5efa\u7684\u63a5\u53e3\uff08<code>OPTx<\/code>\uff09\u3002<\/li>\n<li>\u5355\u51fb\u201c\u63a5\u53e3\u201d&gt;\u00a0<code>OPTx<\/code><\/li>\n<li>\u9009\u4e2d\u201c\u542f\u7528\u201d\u9009\u6846\uff0c\u5e76\u5728\u201c\u63cf\u8ff0\u201d\u5b57\u6bb5\u4e2d\u4e3a\u63a5\u53e3\u6307\u5b9a\u5408\u9002\u7684\u540d\u79f0\u3002<\/li>\n<li>\u6839\u636e\u9700\u8981\u586b\u5199\u5176\u4ed6\u5b57\u6bb5\u3002<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58\uff0c\u7136\u540e\u5355\u51fb\u5e94\u7528\u66f4\u6539<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">\u8282\u70b91\u63a5\u53e3\u5206\u914d\uff1a<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5656\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments.png\" alt=\"\" width=\"1138\" height=\"516\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments.png 1138w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments-300x136.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments-1024x464.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments-768x348.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_Interface_Assignments-500x227.png 500w\" sizes=\"auto, (max-width: 1138px) 100vw, 1138px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5636\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_.png\" alt=\"\" width=\"1144\" height=\"757\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_.png 1144w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_-300x199.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_-1024x678.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_-768x508.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec1000_-453x300.png 453w\" sizes=\"auto, (max-width: 1144px) 100vw, 1144px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u8282\u70b92\u63a5\u53e3\u5206\u914d<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5655\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406.png\" alt=\"\" width=\"1144\" height=\"485\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406.png 1144w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406-300x127.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406-1024x434.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406-768x326.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_\u63a5\u53e3\u7ba1\u7406-500x212.png 500w\" sizes=\"auto, (max-width: 1144px) 100vw, 1144px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5639\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1.png\" alt=\"\" width=\"1144\" height=\"521\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1.png 1144w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1-300x137.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1-1024x466.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1-768x350.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7f51\u7edc\u63a5\u53e3_VTI_ipsec2000_-1-500x228.png 500w\" sizes=\"auto, (max-width: 1144px) 100vw, 1144px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230pfSense\u7cfb\u7edf\u4eea\u8868\u677f\u4e0a\uff0c\u5e94\u8be5\u53ef\u4ee5\u770b\u5230VIT\u7f51\u5173\u7684\u8fde\u63a5\u4fe1\u606f\uff08\u6ce8\u610f\u6b63\u786e\u8bbe\u7f6e\u7f51\u5173\u76d1\u63a7IP\uff0c\u8282\u70b91\u7684\u7f51\u5173\u76d1\u63a7IP\u8bbe\u4e3a\u8282\u70b92\u7684IP\u5730\u5740\uff1a10.10.10.2\uff09\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS-201-\u72b6\u6001-\u4eea\u8868\u5927\u5385.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5640\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS-201-\u72b6\u6001-\u4eea\u8868\u5927\u5385.png\" alt=\"\" width=\"568\" height=\"328\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS-201-\u72b6\u6001-\u4eea\u8868\u5927\u5385.png 568w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS-201-\u72b6\u6001-\u4eea\u8868\u5927\u5385-300x173.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS-201-\u72b6\u6001-\u4eea\u8868\u5927\u5385-500x289.png 500w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a><\/p>\n<h1 style=\"text-align: justify;\"><span id=\"3_%E8%B7%AF%E7%94%B1%E8%AE%BE%E7%BD%AE\" class=\"ez-toc-section\"><\/span><span id=\"Routage\" class=\"mw-headline\"><span class=\"mw-headline-number\">\u8bbe\u7f6e\u9759\u6001<\/span>\u8def\u7531<\/span><\/h1>\n<p style=\"text-align: justify;\">\u5bfc\u822a\u5230<strong>System &gt; Routing\uff08\u7cfb\u7edf&gt;\u8def\u7531\u7ba1\u7406\uff09<\/strong>\uff0c\u7136\u540e\u5355\u51fb\u9759\u6001\u8def\u7531\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728\u8282\u70b91\u4e0a\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u5355\u51fb\u6dfb\u52a0<\/li>\n<li>\u5728\u76ee\u6807\u7f51\u7edc\u5b57\u6bb5\u4e2d\uff0c\u8f93\u5165\u8282\u70b92\u7684 LAN\u7f51\u7edc\u7684\u8303\u56f4<\/li>\n<li>\u5728\u201c\u7f51\u5173\u201d\u5b57\u6bb5\u4e2d\uff0c\u9009\u62e9IPsec\u7f51\u5173\uff08\u5b83\u4e0e\u4f60\u521b\u5efa\u7684\u540e\u7f00\u4e3a_VTIV4\u7684\u63a5\u53e3\u540c\u540d\uff09<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58\uff0c\u7136\u540e\u5355\u51fb\u5e94\u7528<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5642\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531.png\" alt=\"\" width=\"1146\" height=\"302\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531.png 1146w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-300x79.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-1024x270.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-768x202.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-500x132.png 500w\" sizes=\"auto, (max-width: 1146px) 100vw, 1146px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u5728\u8282\u70b92\u4e0a\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u5355\u51fb\u6dfb\u52a0<\/li>\n<li>\u5728\u76ee\u6807\u7f51\u7edc\u5b57\u6bb5\u4e2d\uff0c\u8f93\u5165\u8282\u70b91\u7684LAN\u7f51\u7edc\u8303\u56f4<\/li>\n<li>\u5728\u201c\u7f51\u5173\u201d\u5b57\u6bb5\u4e2d\uff0c\u9009\u62e9IPsec\u7f51\u5173\uff08\u5b83\u4e0e\u4f60\u521b\u5efa\u7684\u540e\u7f00\u4e3a_VTIV4\u7684\u63a5\u53e3\u540c\u540d\uff09<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58\uff0c\u7136\u540e\u5355\u51fb\u5e94\u7528<\/li>\n<\/ul>\n<h1 style=\"text-align: justify;\"><span id=\"3_1%E7%AD%96%E7%95%A5%E8%B7%AF%E7%94%B1\" class=\"ez-toc-section\"><\/span><span id=\"Redirection_de_trafic_(Policy_Routing)\"><\/span><span class=\"mw-headline\"><span class=\"mw-headline-number\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5641\" style=\"color: #333333; font-weight: 300;\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531.png\" alt=\"\" width=\"1147\" height=\"305\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531.png 1147w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-300x80.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-1024x272.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-768x204.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u7cfb\u7edf_\u8def\u7531\u7ba1\u7406_\u9759\u6001\u8def\u7531-500x133.png 500w\" sizes=\"auto, (max-width: 1147px) 100vw, 1147px\" \/><\/span><\/span><\/h1>\n<h1 style=\"text-align: justify;\"><span id=\"Firewall_du_tunnel_IPsec\" class=\"mw-headline\">\u8bbe\u7f6eIPsec\u9632\u706b\u5899\u89c4\u5219<\/span><\/h1>\n<p style=\"text-align: justify;\">\u6240\u6709IPsec\u96a7\u9053\u7684\u9632\u706b\u5899\u7ba1\u7406\u90fd\u5728IPsec\u63a5\u53e3\u9009\u9879\u5361\u4e2d\u5b8c\u6210\uff08\u4e0d\u662f\u5728\u4f60\u521b\u5efa\u7684\u63a5\u53e3\u9009\u9879\u5361\u4e0a\uff09\u3002\u53ea\u9700\u8981\u8981\u521b\u5efa\u4e00\u4e2aany\u5230any\u7684\u89c4\u5219\u5373\u53ef\u3002<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5631\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565.png\" alt=\"\" width=\"1147\" height=\"284\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565.png 1147w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565-300x74.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565-1024x254.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565-768x190.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXS_201_RULE_\u9632\u706b\u5899\u7b56\u7565-500x124.png 500w\" sizes=\"auto, (max-width: 1147px) 100vw, 1147px\" \/><\/a><\/p>\n<h1 style=\"text-align: justify;\"><span id=\"Redirection_de_trafic_.28Policy_Routing.29\" class=\"mw-headline\"><span class=\"mw-headline-number\">\u8bbe\u7f6e<\/span>\u7b56\u7565\u8def\u7531<\/span><\/h1>\n<p style=\"text-align: justify;\">\u5f3a\u5236\u5c06\u8282\u70b91\u7684LAN IP\u7684\u5bf9\u5916\u6d41\u91cf\u901a\u8fc7\u8282\u70b92\u7684WAN IP\u51fa\u7ad9\u3002<\/p>\n<p style=\"text-align: justify;\">\u5728\u8282\u70b91\u4e0a\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u521b\u5efaLAN\u9632\u706b\u5899\u89c4\u5219\uff0c\u6839\u636e\u9700\u8981\u8bbe\u7f6e\u4e0d\u540c\u7684\u5b57\u6bb5<\/li>\n<li>\u5728\u9ad8\u7ea7\u9009\u9879\u7684<strong>\u7f51\u5173<\/strong>\u5b57\u6bb5\u4e0a\uff0c\u9009\u62e9IPsec\u96a7\u9053\u7f51\u5173<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58\uff0c\u7136\u540e\u5355\u51fb\u5e94\u7528<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5633\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91.png\" alt=\"\" width=\"1157\" height=\"365\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91.png 1157w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91-300x95.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91-1024x323.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91-768x242.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_\u7f16\u8f91-500x158.png 500w\" sizes=\"auto, (max-width: 1157px) 100vw, 1157px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5634\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1.png\" alt=\"\" width=\"1153\" height=\"293\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1.png 1153w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1-300x76.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1-1024x260.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1-768x195.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_201_\u9632\u706b\u5899_\u89c4\u5219\u7b56\u7565_LAN1-500x127.png 500w\" sizes=\"auto, (max-width: 1153px) 100vw, 1153px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u8bbe\u7f6e\u540e\uff0c\u8282\u70b91\u7684LAN\u5bf9\u5916\u8bbf\u95ee\u6d41\u91cf\u5c06\u901a\u8fc7\u8282\u70b92\u7684WAN IP\u51fa\u7ad9\uff0c\u8282\u70b92\u7684\u51fa\u7ad9NAT\u5fc5\u987b\u914d\u7f6e\u4e3a\u81ea\u52a8\u6a21\u5f0f\u6216\u6df7\u5408\u6a21\u5f0f\u3002<\/p>\n<p style=\"text-align: justify;\">\u5982\u679c\u4e0d\u662f\uff0c\u8bf7\u5728\u8282\u70b92\u4e0a\u8fdb\u884c\u5982\u4e0b\u8bbe\u7f6e\uff1a<\/p>\n<ul style=\"text-align: justify;\">\n<li>\u5bfc\u822a\u5230<strong>Firewall &gt; NAT\uff08\u9632\u706b\u5899&gt;NAT\uff09<\/strong>\uff0c\u7136\u540e\u5355\u51fb\u51fa\u7ad9<\/li>\n<li>\u9009\u62e9\u81ea\u52a8\u51fa\u7ad9NAT\u89c4\u5219\u751f\u6210<\/li>\n<li>\u5355\u51fb\u4fdd\u5b58<\/li>\n<li>\u5728\u81ea\u52a8\u6a21\u5f0f\u4e0b\uff0cpfsense\u4e3a\u5206\u914d\u7ed9IPsec\u7f51\u5173\u7684\u6240\u6709\u8def\u7531\u81ea\u52a8\u521b\u5efa\u51fa\u7ad9NAT\u89c4\u5219<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5632\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9.png\" alt=\"\" width=\"1143\" height=\"265\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9.png 1143w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9-300x70.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9-1024x237.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9-768x178.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/07\/JXGS_101_\u9632\u706b\u5899_\u5730\u5740\u8f6c\u6362_\u51fa\u7ad9-500x116.png 500w\" sizes=\"auto, (max-width: 1143px) 100vw, 1143px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u7ecf\u8fc7\u4ee5\u4e0a\u8bbe\u7f6e\uff0c\u8282\u70b91\u7684LAN \u7f51\u7edc\u5ba2\u6237\u7aef\u5c31\u53ef\u4ee5\u901a\u8fc7IPsec\u96a7\u9053\u7f51\u7edc\u4ece\u8282\u70b92\u8fdb\u884c\u51fa\u7ad9\u3002\u68c0\u67e5\u662f\u5426\u901a\u8fc7\u8282\u70b92\u51fa\u7ad9\uff0c\u53ef\u4ee5\u901a\u8fc7<a href=\"http:\/\/ip111.cn\/\">ip111<\/a>\u7f51\u7ad9\u68c0\u67e5\u51fa\u7ad9IP\u8fdb\u884c\u9a8c\u8bc1\u3002\u5982\u679c\u4e0d\u80fd\u6b63\u5e38\u8bbf\u95ee\u6216\u51fa\u7ad9\uff0c\u8bf7\u68c0\u67e5\u5ba2\u6237\u7aefIP\u5730\u5740\u3001DNS\u8bbe\u7f6e\uff0c\u4ee5\u53caIPsec\u96a7\u9053\u662f\u5426\u6b63\u5e38\u8fde\u63a5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u57fa\u4e8e\u8def\u7531\u7684IPsec\u662f\u7ba1\u7406IPsec\u6d41\u91cf\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u3002if_ipsec(4)\u4eceF &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=5630\">\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":[166],"class_list":["post-5630","post","type-post","status-publish","format-standard","hentry","category-pfsense","tag-ipsec"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/5630","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=5630"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/5630\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}