{"id":1153,"date":"2019-03-30T15:03:24","date_gmt":"2019-03-30T07:03:24","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=1153"},"modified":"2021-11-17T10:55:43","modified_gmt":"2021-11-17T02:55:43","slug":"pfsense-%e5%90%8c%e4%b8%80%e7%bd%91%e7%bb%9c%e4%b8%8a%e7%9a%84%e7%ab%99%e7%82%b9%e5%88%b0%e7%ab%99%e7%82%b9ipsec-vpn","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=1153","title":{"rendered":"pfSense-\u76f8\u540c\u5b50\u7f51\u7684\u7ad9\u70b9\u5230\u7ad9\u70b9IPSec VPN"},"content":{"rendered":"<header>\u914d\u7f6e\u8fc7\u7ad9\u70b9\u5230\u7ad9\u70b9VPN\u8fde\u63a5\u7684\u4eba\u90fd\u77e5\u9053\uff0c\u5982\u679c\u4e24\u4e2a\u7ad9\u70b9\u5177\u6709\u76f8\u540c\u7684\u5b50\u7f51\uff0c\u5219\u6c38\u8fdc\u4e0d\u4f1a\u5c06\u6d41\u91cf\u53d1\u9001\u5230VPN\u3002\u539f\u56e0\u662f\u5982\u679c\u5ba2\u6237\u7aef\u60f3\u8981\u4e0e\u540c\u4e00\u7f51\u7edc\u4e0a\u7684\u76ee\u6807\u5730\u5740\u901a\u4fe1\uff0c\u5219\u4e0d\u4f1a\u5c06\u6570\u636e\u5305\u53d1\u9001\u5230\u9ed8\u8ba4\u7f51\u5173\uff0c\u800c\u662f\u76f4\u63a5\u53d1\u9001\u5230\u672c\u5730\u7f51\u7edc\u3002\u6c38\u8fdc\u4e0d\u4f1a\u5230\u8fbe\u8fdc\u7a0b\u7f51\u7edc\u4e2d\u7684\u539f\u59cb\u76ee\u6807\u3002<\/header>\n<header><\/header>\n<div style=\"text-align: justify;\">\u4f46\u662f\u8fd9\u79cd\u60c5\u51b5\u6709\u89e3\u51b3\u65b9\u6848\u3002\u5176\u4e2d\u4e4b\u4e00\u662fNAT\uff08\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff09\u3002NAT\u5c06\u4e00\u4e2a\u6216\u591a\u4e2aIP\u5730\u5740\u8f6c\u6362\u4e3a\u4e00\u4e2a\u6216\u591a\u4e2aIP\u5730\u5740\u3002\u7531\u4e8e\u53cc\u65b9\u672c\u5730\u53d1\u9001\u6570\u636e\u5305\u4f1a\u51fa\u73b0\u95ee\u9898\uff0c\u56e0\u6b64\u5fc5\u987b\u5728VPN\u7684\u4e24\u7aef\u5f15\u5165NAT\u3002<\/div>\n<div>\n<h2>NAT\u4e2d\u5b8c\u6574\u7f51\u7edc\u793a\u4f8b\uff08\u89c1\u4e0b\u56fe\uff09<\/h2>\n<p>\u7ad9\u70b91\u5c06\u9690\u85cf192.168.0.0\/24\u7f51\u7edc\u540e\u9762\u7684192.168.0.0\/24\u672c\u5730\u7f51\u7edc\u3002<br \/>\n\u7ad9\u70b92\u5c06\u9690\u85cf192.168.0.0\/24\u7f51\u7edc\u540e\u9762\u7684192.168.0.0\/24\u672c\u5730\u7f51\u7edc\u3002<\/p>\n<p>\u6bcf\u5f53\u6765\u81eaLAN\u7684IPSec VPN\u8bf7\u6c42\u51fa\u73b0\u65f6\uff0c\u9632\u706b\u5899\u8f6c\u6362\u6e90IP\u3002 \u5f53\u6570\u636e\u5305\u5230\u8fbeVPN\u65f6\uff0c\u76ee\u6807\u5730\u5740\u4f1a\u53d1\u751f\u53d8\u5316\u3002 \u8fd9\u662f\u7ad9\u70b91\u7684\u60c5\u51b5\uff0c\u5c31\u597d\u50cf\u7ad9\u70b92\u5177\u6709\u7f51\u7edc192.168.2.0\u3002\u00a0\u5728\u7ad9\u70b92\u65f6\u76f8\u5e94\u5730\u53cd\u8f6c\u3002\u5f53\u7136\uff0c\u9700\u8981\u76f8\u5e94\u8c03\u6574\u901a\u4fe1\u3002\u4f8b\u5982\uff0c\u7ad9\u70b92\u4e0a\u7684Web\u670d\u52a1\u5668\u5b9e\u9645\u4e0a\u5177\u6709IP\u5730\u5740192.168.0.60\uff0c\u53ea\u80fd\u901a\u8fc7192.168.2.60\u8bbf\u95ee\u3002<\/p>\n<p>\u7f51\u7edc\u62d3\u6251\u56fe\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<ol>\n<li>\u8bbe\u5907192.168.0.50\uff08S1\uff09\u5bfb\u5740192.168.2.60\u3002<\/li>\n<li>\u7ad9\u70b91\u7684\u9632\u706b\u5899\u8f6c\u6362\u6e90IP<\/li>\n<li>\u7ad9\u70b92\u7684\u9632\u706b\u5899\u8f6c\u6362\u76ee\u6807IP<\/li>\n<li>\u8bbe\u5907192.168.0.60\uff08S2\uff09\u63a5\u6536\u6570\u636e\u5305\u3002<\/li>\n<\/ol>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/vpnsamenetwork_nat2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3108\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/vpnsamenetwork_nat2.png\" alt=\"\" width=\"779\" height=\"666\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/vpnsamenetwork_nat2.png 779w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/vpnsamenetwork_nat2-300x256.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/vpnsamenetwork_nat2-768x657.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/vpnsamenetwork_nat2-351x300.png 351w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/a><\/p>\n<h2>\u5728pfSense\u4e0b\u8bbe\u7f6e<\/h2>\n<p>\u8981\u5728pfSense\u4e2d\u8bbe\u7f6eNAT\uff0c\u5fc5\u987b\u5728Phase2\u96a7\u9053\u4e2d\u6fc0\u6d3bNAT \/ BINAT\u529f\u80fd\u3002<\/p>\n<p>\u7ad9\u70b91<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats1-1024x495.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3110\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats1-1024x495.jpg\" alt=\"\" width=\"1024\" height=\"495\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats1-1024x495.jpg 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats1-1024x495-300x145.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats1-1024x495-768x371.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats1-1024x495-500x242.jpg 500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>\u7ad9\u70b92<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats2-1024x493.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3111\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats2-1024x493.jpg\" alt=\"\" width=\"1024\" height=\"493\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats2-1024x493.jpg 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats2-1024x493-300x144.jpg 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats2-1024x493-768x370.jpg 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2019\/11\/nats2-1024x493-500x241.jpg 500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>\u5fc5\u987b\u6ce8\u610f\u7f51\u7edc\u63a9\u7801\u5e94\u4fdd\u6301\u4e00\u81f4\u3002\u5b83\u65e0\u6cd5\u4ece\/ 16\u7f51\u7edc\u8f6c\u6362\u4e3a\/ 24\u7f51\u7edc\u3002<\/p>\n<p>\u7ecf\u8fc7\u4ee5\u4e0a\u8bbe\u7f6e\uff0cVPN\u4e24\u7aef\u5c31\u53ef\u4ee5\u6b63\u5e38\u4e92\u8bbf\u4e86\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6e\u8fc7\u7ad9\u70b9\u5230\u7ad9\u70b9VPN\u8fde\u63a5\u7684\u4eba\u90fd\u77e5\u9053\uff0c\u5982\u679c\u4e24\u4e2a\u7ad9\u70b9\u5177\u6709\u76f8\u540c\u7684\u5b50\u7f51\uff0c\u5219\u6c38\u8fdc\u4e0d\u4f1a\u5c06\u6d41 &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=1153\">\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":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[166],"class_list":["post-1153","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\/1153","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=1153"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/1153\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}