{"id":215,"date":"2018-07-29T11:42:23","date_gmt":"2018-07-29T03:42:23","guid":{"rendered":"https:\/\/pfsense.freeddns.org\/wp\/?p=215"},"modified":"2022-11-02T14:48:02","modified_gmt":"2022-11-02T06:48:02","slug":"pfsense-book%e4%b9%8bweb%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%b4%9f%e8%bd%bd%e5%b9%b3%e8%a1%a1%e9%85%8d%e7%bd%ae%e7%a4%ba%e4%be%8b","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=215","title":{"rendered":"pfSense book\u4e4bWeb\u670d\u52a1\u5668\u8d1f\u8f7d\u5e73\u8861\u914d\u7f6e\u793a\u4f8b"},"content":{"rendered":"<p>\u5728pfsense\u7684\u7f51\u5173\u548c\u670d\u52a1\u5668\u4e2d\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u8d1f\u8f7d\u5e73\u8861\u529f\u80fd\u3002\u7f51\u5173\u8d1f\u8f7d\u5e73\u8861\u53ef\u4ee5\u901a\u8fc7\u591a\u4e2aWAN\u8fde\u63a5\u5206\u53d1Internet\u7ed1\u5b9a\u7684\u6d41\u91cf\u3002\u670d\u52a1\u5668\u8d1f\u8f7d\u5e73\u8861\u7ba1\u7406\u4f20\u5165\u6d41\u91cf\uff0c\u56e0\u6b64\u5b83\u5229\u7528\u591a\u4e2a\u5185\u90e8\u670d\u52a1\u5668\u8fdb\u884c\u8d1f\u8f7d\u5206\u914d\u548c\u5197\u4f59\uff0c\u670d\u52a1\u5668\u8d1f\u8f7d\u5e73\u8861\u5141\u8bb8\u6d41\u91cf\u5728\u591a\u4e2a\u5185\u90e8\u670d\u52a1\u5668\u4e4b\u95f4\u5206\u914d\uff0c\u5b83\u6700\u5e38\u7528\u4e8eWeb\u670d\u52a1\u5668\u548cSMTP\u670d\u52a1\u5668\u3002\u4e0b\u9762\u6211\u4eec\u5c31\u4ee5\u5b9e\u4f8b\u6765\u4ecb\u7ecd\u670d\u52a1\u5668\u8d1f\u8f7d\u5e73\u8861\u7684\u8bbe\u7f6e\u3002<\/p>\n<p>\u4e0b\u9762\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7pfsense2.32\u914d\u7f6eWeb\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u5e73\u8861\u3002<\/p>\n<h2>\u7f51\u7edc\u73af\u5883<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1936\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/diagrams-serverlb-example.png\" alt=\"\" width=\"560\" height=\"179\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/diagrams-serverlb-example.png 560w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/diagrams-serverlb-example-300x96.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/diagrams-serverlb-example-500x160.png 500w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/p>\n<p>\u4e0a\u56fe\u4e3a\u793a\u4f8b\u7f51\u7edc\u73af\u5883\u3002\u5b83\u7531\u5355\u4e2a\u9632\u706b\u5899\u7ec4\u6210\uff0c\u4f7f\u7528\u5176WAN IP\u5730\u5740\u6c60\uff0cDMZ\u6bb5\u4e0a\u6709\u4e24\u4e2aWeb\u670d\u52a1\u5668\u3002<\/p>\n<h2>\u914d\u7f6e\u5730\u5740\u6c60<\/h2>\n<ul class=\" list-paddingleft-2\">\n<li>\u5bfc\u822a\u5230\u00a0Services &gt; Load Balancer<\/li>\n<li>\u5355\u51fbPools\u00a0\u6807\u7b7e<\/li>\n<li>\u5355\u51fb <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1666\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/fa-plus.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u00a0\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u5730\u5740\u6c60<\/li>\n<li>\u5982\u56fe\u6240\u793a\uff0c\u4f7f\u7528\u4ee5\u4e0b\u8bbe\u7f6e\uff1a<br \/>\n<table class=\"docutils field-list\">\n<colgroup>\n<col class=\"field-name\" \/>\n<col class=\"field-body\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr class=\"field-odd field firstRow\">\n<th class=\"field-name\">Name:<\/th>\n<td class=\"field-body\">WebServers<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Mode:<\/th>\n<td class=\"field-body\">Load Balance<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\">Description:<\/th>\n<td class=\"field-body\">Web\u00a0server\u00a0Pool<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Port:<\/th>\n<td class=\"field-body\">80<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\">Retry:<\/th>\n<td class=\"field-body\">5<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Pool Members:<\/th>\n<td class=\"field-body\">\u6dfb\u52a0\u4e24\u4e2aWeb\u670d\u52a1\u5668 (10.6.0.11\u00a0\u548c10.6.0.12)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\u5355\u51fbSave<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1938\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-pool.png\" alt=\"\" width=\"941\" height=\"641\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-pool.png 941w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-pool-300x204.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-pool-768x523.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-pool-440x300.png 440w\" sizes=\"auto, (max-width: 941px) 100vw, 941px\" \/><\/p>\n<p>\u5730\u5740\u6c60\u914d\u7f6e<\/p>\n<h2>\u914d\u7f6e\u865a\u62df\u670d\u52a1\u5668<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1939\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-virtualserver.png\" alt=\"\" width=\"940\" height=\"424\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-virtualserver.png 940w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-virtualserver-300x135.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-virtualserver-768x346.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-virtualserver-500x226.png 500w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p>\n<p>\u865a\u62df\u670d\u52a1\u5668\u914d\u7f6e<\/p>\n<ul class=\" list-paddingleft-2\">\n<li>\u5355\u51fbVirtual Servers\u6807\u7b7e<\/li>\n<li>\u5355\u51fb <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1666\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/fa-plus.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u00a0\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u865a\u62df\u670d\u52a1\u5668<\/li>\n<li>\u5982\u56fe\u6240\u793a\uff0c\u4f7f\u7528\u4ee5\u4e0b\u8bbe\u7f6e:<br \/>\n<table class=\"docutils field-list\">\n<colgroup>\n<col class=\"field-name\" \/>\n<col class=\"field-body\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr class=\"field-odd field firstRow\">\n<th class=\"field-name\">Name:<\/th>\n<td class=\"field-body\">WebVirtualServer<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Description:<\/th>\n<td class=\"field-body\">Web\u00a0Server<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\">IP Address:<\/th>\n<td class=\"field-body\">The firewall\u2019s WAN IP address,\u00a0198.51.100.6<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Port:<\/th>\n<td class=\"field-body\">80<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\" colspan=\"2\">Virtual Server Pool:<\/th>\n<\/tr>\n<tr class=\"field-odd field\">\n<td><\/td>\n<td class=\"field-body\">WebServers<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Fall Back Pool:<\/th>\n<td class=\"field-body\">None<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\u5355\u51fb\u00a0Submit\uff08\u63d0\u4ea4\uff09<\/li>\n<li>\u5355\u51fb\u00a0Apply Changes\uff08\u5e94\u7528\u66f4\u6539\uff09<\/li>\n<\/ul>\n<p>\u6ce8\u610f\uff1a\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u5982\u679c\u4e24\u4e2a\u6c60\u670d\u52a1\u5668\u90fd\u5173\u95ed\uff0c\u5219\u865a\u62df\u670d\u52a1\u5668\u65e0\u6cd5\u8bbf\u95ee\u3002 \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u865a\u62df\u670d\u52a1\u5668\uff0c\u9632\u706b\u5899\u5c06\u4f1a\u8d77\u4f5c\u7528\u3002 \u5982\u679c\u9632\u706b\u5899\u4e0a\u7684\u67d0\u4e9b\u5e94\u7528\u7ed1\u5b9a\u523080\u7aef\u53e3\uff0c\u90a3\u4e48\u5ba2\u6237\u7aef\u5c31\u4f1a\u76f4\u8fbe\u7ed1\u5b9a\u4e86\u8fd9\u4e2a\u7aef\u53e3\u7684\u5e94\u7528\u3002 \u8fd9\u53ef\u80fd\u5305\u62ec\u901a\u8fc7\u7aef\u53e380\u8bbf\u95ee\u5185\u7f6eWeb GUI\uff0c\u56e0\u6b64\u5e94\u8be5\u5728System &gt; Advanced\u00a0&gt;\u00a0Admin Access\u00a0\u9009\u9879\u5361\u4e0a\u7981\u7528\u6216\u91c7\u7528\u5176\u4ed6\u7aef\u53e3\u3002<\/p>\n<h2>\u914d\u7f6e\u9632\u706b\u5899\u89c4\u5219<\/h2>\n<p>\u9632\u706b\u5899\u89c4\u5219\u5fc5\u987b\u914d\u7f6e\u4e3a\u5141\u8bb8\u8bbf\u95ee\u6c60\u4e2d\u7684\u670d\u52a1\u5668\u3002 \u89c4\u5219\u5fc5\u987b\u5141\u8bb8\u6d41\u91cf\u4f7f\u7528\u5185\u90e8IP\u5730\u5740\u548c\u7aef\u53e3\uff0c\u5e76\u4e14\u5bf9\u865a\u62df\u670d\u52a1\u5668\u914d\u7f6e\u4e2d\u4f7f\u7528\u7684\u5916\u90e8IP\u5730\u5740\u548c\u7aef\u53e3\u4e0d\u9700\u8981\u4efb\u4f55\u89c4\u5219\u9650\u5236\u3002<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u5305\u542b\u6c60\u4e2d\u6240\u6709\u670d\u52a1\u5668\u7684\u522b\u540d\uff0c\u56e0\u6b64\u53ef\u4ee5\u4f7f\u7528\u5355\u4e2a\u9632\u706b\u5899\u89c4\u5219\u8fdb\u884c\u8bbf\u95ee\u3002<\/p>\n<ul class=\" list-paddingleft-2\">\n<li>\u5bfc\u822a\u5230Firewall &gt; Aliases<\/li>\n<li>\u5355\u51fb <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1666\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/fa-plus.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u6dfb\u52a0 \u4e00\u4e2a\u522b\u540d<\/li>\n<li>\u5982\u56fe\u6240\u793a\uff0c\u4f7f\u7528\u4ee5\u4e0b\u8bbe\u7f6e:<br \/>\n<table class=\"docutils field-list\">\n<colgroup>\n<col class=\"field-name\" \/>\n<col class=\"field-body\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr class=\"field-odd field firstRow\">\n<th class=\"field-name\" width=\"62\">Name:<\/th>\n<td class=\"field-body\" width=\"439\">www_servers<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\" width=\"67\">Type:<\/th>\n<td class=\"field-body\" width=\"439\">Hosts<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\" width=\"72\">Hosts:<\/th>\n<td class=\"field-body\" width=\"439\">\u4e24\u4e2aWeb\u670d\u52a1\u5668IP\u5730\u5740:\u00a010.6.0.11\u00a0\u548c\u00a010.6.0.12<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\u5355\u51fb\u00a0Save<\/li>\n<li>\u5355\u51fb\u00a0Apply Changes\uff08\u5e94\u7528\u66f4\u6539\uff09<\/li>\n<\/ul>\n<p>\u56fe\u4e2d\u7684\u201cName\u201d\u663e\u793a\u4e86\u7528\u4e8e\u6b64\u793a\u4f8b\u914d\u7f6e\u7684\u522b\u540d\uff0c\u5176\u4e2d\u5305\u542b\u4e24\u4e2aWeb\u670d\u52a1\u5668\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1940\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-alias.png\" alt=\"\" width=\"939\" height=\"422\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-alias.png 939w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-alias-300x135.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-alias-768x345.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-alias-500x225.png 500w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/p>\n<p>Web \u670d\u52a1\u5668\u522b\u540d\u8bbe\u7f6e<\/p>\n<p>\u4e0b\u4e00\u6b65\uff0c\u7528\u8fd9\u4e2a\u522b\u540d\u521b\u5efa\u4e00\u4e2a\u9632\u706b\u5899\u89c4\u5219: \u5bfc\u822a\u5230Firewall &gt; Rules \uff0c\u5207\u6362\u5230\u5916\u90e8\u8fde\u63a5\u8bbf\u95ee\u7684\u63a5\u53e3\uff08\u4f8b\u5982WAN\uff09\uff0c \u5355\u51fb <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1693\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/fa-level-up.png\" alt=\"\" width=\"25\" height=\"25\" \/>\u00a0\u5728\u9876\u90e8\u6dfb\u52a0\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u8bbe\u7f6e\u5982\u4e0b:<\/p>\n<blockquote>\n<table class=\"docutils field-list\">\n<colgroup>\n<col class=\"field-name\" \/>\n<col class=\"field-body\" \/><\/colgroup>\n<tbody valign=\"top\">\n<tr class=\"field-odd field firstRow\">\n<th class=\"field-name\">Interface:<\/th>\n<td class=\"field-body\">WAN<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\">Protocol:<\/th>\n<td class=\"field-body\">TCP<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\">Source:<\/th>\n<td class=\"field-body\">any<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\" colspan=\"2\">Destination Type:<\/th>\n<\/tr>\n<tr class=\"field-even field\">\n<td><\/td>\n<td class=\"field-body\">Single Host or Alias<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\" colspan=\"2\">Destination Address:<\/th>\n<\/tr>\n<tr class=\"field-odd field\">\n<td><\/td>\n<td class=\"field-body\">www_servers<\/td>\n<\/tr>\n<tr class=\"field-even field\">\n<th class=\"field-name\" colspan=\"2\">Destination Port Range:<\/th>\n<\/tr>\n<tr class=\"field-even field\">\n<td><\/td>\n<td class=\"field-body\">HTTP<\/td>\n<\/tr>\n<tr class=\"field-odd field\">\n<th class=\"field-name\">Description:<\/th>\n<td class=\"field-body\">Allow\u00a0to\u00a0Web\u00a0Server<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/blockquote>\n<ul class=\"simple list-paddingleft-2\">\n<li>\u5355\u51fb\u00a0Save<\/li>\n<li>\u5355\u51fb\u00a0Apply Changes\uff08\u5e94\u7528\u66f4\u6539\uff09<\/li>\n<\/ul>\n<p>\u4e0b\u56fe\u4e3aWeb\u670d\u52a1\u5668\u8bbe\u7f6e\u7684\u9632\u706b\u5899\u89c4\u5219\uff0c\u672a\u663e\u793a\u7684\u9009\u9879\u4fdd\u7559\u9ed8\u8ba4\u503c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1942\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwruleedit.png\" alt=\"\" width=\"940\" height=\"677\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwruleedit.png 940w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwruleedit-300x216.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwruleedit-768x553.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwruleedit-417x300.png 417w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/p>\n<p>\u4e3aWeb\u670d\u52a1\u5668\u6dfb\u52a0\u9632\u706b\u5899\u89c4\u5219<\/p>\n<p>\u5217\u8868\u4e2d\u663e\u793a\u7684\u89c4\u5219\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1941\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwrule.png\" alt=\"\" width=\"1141\" height=\"39\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwrule.png 1141w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwrule-1024x35.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwrule-300x10.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwrule-768x26.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-fwrule-500x17.png 500w\" sizes=\"auto, (max-width: 1141px) 100vw, 1141px\" \/><\/p>\n<p>Web \u670d\u52a1\u5668\u9632\u706b\u5899\u89c4\u5219<\/p>\n<h2>\u67e5\u770b\u8d1f\u8f7d\u5e73\u8861\u72b6\u6001<\/h2>\n<p>\u73b0\u5728\u5df2\u7ecf\u914d\u7f6e\u4e86\u8d1f\u8f7d\u5e73\u8861\u5668\uff0c\u8981\u67e5\u770b\u5176\u72b6\u6001\uff0c\u8bf7\u6d4f\u89c8\u5230Status &gt; Load Balancer\uff0c\u7136\u540e\u5355\u51fb\u201cVirtual Servers\u201d\u9009\u9879\u5361\u3002\u6b64\u9875\u9762\u663e\u793a\u6574\u4e2a\u670d\u52a1\u5668\u7684\u72b6\u6001\uff0c\u901a\u5e38\u5217\u4e3a\u201cActive\uff08\u8054\u673a\uff09\u201d\u6216\u201cDown\uff08\u8131\u673a\uff09\u201d\u3002<\/p>\n<p>Pools\u9009\u9879\u5361\u663e\u793a\u6c60\u7684\u6bcf\u4e2a\u6210\u5458\u7684\u5355\u72ec\u72b6\u6001\uff08\u5982\u4e0b\u56fe\u6240\u793a\uff09\u3002\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u8054\u673a\u72b6\u6001\uff0c\u670d\u52a1\u5668\u7684\u884c\u4e3a\u7eff\u8272\uff0c\u5982\u679c\u670d\u52a1\u5668\u5904\u4e8e\u8131\u673a\u72b6\u6001\uff0c\u5219\u4e3a\u7ea2\u8272\u3002<\/p>\n<p>\u6b64\u5916\uff0c\u6c60\u4e2d\u7684\u6bcf\u4e2a\u670d\u52a1\u5668\u90fd\u6709\u4e00\u4e2a\u590d\u9009\u6846\u3002 \u5df2\u68c0\u67e5\u7684\u670d\u52a1\u5668\u5728\u6c60\u4e2d\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\uff0c\u6c60\u4e2d\u5df2\u7981\u7528\u672a\u9009\u4e2d\u7684\u670d\u52a1\u5668\uff0c\u4e0e\u5728\u6c60\u7f16\u8f91\u9875\u9762\u4e0a\u542f\u7528\u548c\u7981\u7528\u5217\u8868\u4e4b\u95f4\u79fb\u52a8\u7684\u670d\u52a1\u5668\u76f8\u540c\u3002 \u8981\u7981\u7528\u670d\u52a1\u5668\uff1a\u53d6\u6d88\u9009\u4e2d\u5b83\uff0c\u7136\u540e\u5355\u51fb\u4fdd\u5b58\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1943\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-status-online.png\" alt=\"\" width=\"939\" height=\"229\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-status-online.png 939w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-status-online-300x73.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-status-online-768x187.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2018\/07\/serverlb-status-online-500x122.png 500w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/p>\n<p>\u5982\u679c\u5728\u5176\u4e2d\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a\u505c\u6b62\u4e86Web\u670d\u52a1\u5668\u670d\u52a1\uff0c\u6216\u8005\u5982\u679c\u4f7f\u7528ICMP\u76d1\u89c6\u5668\u5c06\u670d\u52a1\u5668\u5b8c\u5168\u4ece\u7f51\u7edc\u4e2d\u5220\u9664\uff0c\u5219\u72b6\u6001\u5c06\u66f4\u65b0\u4e3a\u201c\u8131\u673a\u201d\uff0c\u5e76\u5c06\u670d\u52a1\u5668\u4ece\u6c60\u4e2d\u5220\u9664\u3002<\/p>\n<h2>\u9a8c\u8bc1\u8d1f\u8f7d\u5e73\u8861<\/h2>\n<p>\u4e3a\u4e86\u9a8c\u8bc1\u8d1f\u8f7d\u5e73\u8861,\u00a0curl\u00a0\u662f\u786e\u4fddWeb\u6d4f\u89c8\u5668\u7f13\u5b58\u548c\u6301\u4e45\u8fde\u63a5\u4e0d\u5f71\u54cd\u6d4b\u8bd5\u7ed3\u679c\u7684\u6700\u4f73\u9009\u62e9\u3002curl\u00a0\u53ef\u4ee5\u4ece\u00a0<a href=\"http:\/\/curl.haxx.se\/\" target=\"_blank\" rel=\"noopener noreferrer\">curl\u00a0<\/a>\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\uff0c\u6709\u5404\u79cd\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002\u00a0\u8981\u4f7f\u7528\u5b83\uff0c\u53ea\u9700\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4:<\/p>\n<pre>curl\u00a0http:\/\/mysite<\/pre>\n<p>\u5728\u8be5\u547d\u4ee4\u4e2d\uff0c\u5c06198.51.100.6\u66ff\u6362\u4e3a\u7ad9\u70b9\u7684IP\u5730\u5740\u6216\u4e3b\u673a\u540d\u3002 \u8fd9\u5fc5\u987b\u4ece\u7f51\u7edc\u5916\u90e8\u8fdb\u884c\u6d4b\u8bd5\uff08\u4f8b\u5982\uff0c\u4eceWAN\u4e0a\u7684\u8fdc\u7a0b\u7f51\u7edc\u6216\u5ba2\u6237\u7aef\uff09\u3002 \u4f8b\u5982\uff0c\u5728\u5916\u7f51\u7528curl\u8fdb\u884c\u6d4b\u8bd5\uff1a<\/p>\n<pre>#\u00a0curl\u00a0http:\/\/198.51.100.6\r\n\u00a0This\u00a0is\u00a0server\u00a0www2\u00a0-\u00a010.6.0.12\r\n#\u00a0curl\u00a0http:\/\/198.51.100.6\r\n\u00a0This\u00a0is\u00a0server\u00a0www1\u00a0-\u00a010.6.0.11<\/pre>\n<p>\u6d4b\u8bd5\u8d1f\u8f7d\u5e73\u8861\u65f6\uff0c\u8bbe\u7f6e\u6bcf\u4e2a\u670d\u52a1\u5668\u8fd4\u56de\u6307\u5b9a\u5176\u4e3b\u673a\u540d\u3001IP\u5730\u5740\u6216\u4e24\u8005\uff0c\u56e0\u6b64\u660e\u786e\u54ea\u4e2a\u670d\u52a1\u5668\u54cd\u5e94\u8be5\u8bf7\u6c42\u3002 \u5982\u679c\u672a\u542f\u7528\u7c98\u6027\u8fde\u63a5\uff0c\u5219\u4e0d\u540c\u7684\u670d\u52a1\u5668\u5c06\u54cd\u5e94\u6bcf\u4e2a\u8bf7\u6c42\u3002<\/p>\n<h1>\u6545\u969c\u6392\u9664<\/h1>\n<p><strong>\u4e0d\u80fd\u8fde\u63a5\u5230\u8d1f\u8f7d\u5e73\u8861<\/strong><\/p>\n<p>\u4e0d\u80fd\u8fde\u63a5\u5230\u8d1f\u8f7d\u5e73\u8861\u5668\u901a\u5e38\u662f\u4f7f\u7528\u6d4b\u8bd5\u65b9\u6cd5\u4e0d\u5f53\u9020\u6210\u7684\uff0c\u8fd9\u901a\u5e38\u662fHTTP\u7279\u6709\u7684\u3002 Web\u6d4f\u89c8\u5668\u901a\u5e38\u4f1a\u4fdd\u6301\u4e0eWeb\u670d\u52a1\u5668\u5efa\u7acb\u7684\u8fde\u63a5\uff0c\u5e76\u4e14\u70b9\u51fb\u5237\u65b0\u4f1a\u91cd\u65b0\u4f7f\u7528\u73b0\u6709\u7684\u8fde\u63a5\u3002 \u5355\u4e2a\u8fde\u63a5\u5c06\u6c38\u8fdc\u4e0d\u4f1a\u66f4\u6539\u4e3a\u53e6\u4e00\u4e2a\u5e73\u8861\u670d\u52a1\u5668\u3002 \u53e6\u4e00\u4e2a\u5e38\u89c1\u7684\u95ee\u9898\u662f\u7f51\u7edc\u6d4f\u89c8\u5668\u7f13\u5b58\uff0c\u6d4f\u89c8\u5668\u53ea\u4ece\u7f13\u5b58\u8bfb\u53d6\u6570\u636e\uff0c\u672a\u771f\u6b63\u518d\u6b21\u5237\u65b0\u9875\u9762\u3002 \u6700\u597d\u4f7f\u7528\u8bf8\u5982curl\u7b49\u547d\u4ee4\u884c\u5de5\u5177\u6765\u6d4b\u8bd5\uff0c\u56e0\u4e3a\u5b83\u786e\u4fdd\u6d4b\u8bd5\u4e0d\u53d7Web\u6d4f\u89c8\u5668\u6d4b\u8bd5\u4e2d\u56fa\u6709\u95ee\u9898\u7684\u5f71\u54cd\u3002curl\u6ca1\u6709\u7f13\u5b58\uff0c\u5e76\u5728\u6bcf\u6b21\u8fd0\u884c\u65f6\u90fd\u4f1a\u91cd\u65b0\u5efa\u7acb\u4e0e\u670d\u52a1\u5668\u7684\u65b0\u8fde\u63a5\u3002<\/p>\n<p>\u5982\u679c\u542f\u7528\u4e86\u7c98\u6027\u8fde\u63a5\uff0c\u8bf7\u786e\u4fdd\u4ece\u591a\u4e2a\u6e90IP\u5730\u5740\u6267\u884c\u6d4b\u8bd5\u3002\u6765\u81ea\u5355\u4e2a\u6e90IP\u5730\u5740\u7684\u6d4b\u8bd5\u5c06\u8f6c\u5230\u5355\u4e2a\u670d\u52a1\u5668\uff0c\u9664\u975e\u8fde\u63a5\u5c1d\u8bd5\u4e4b\u95f4\u7ecf\u8fc7\u4e86\u8f83\u957f\u7684\u65f6\u95f4\u3002<\/p>\n<h2><\/h2>\n<h2><strong>\u5173\u95ed\u670d\u52a1\u5668\u672a\u6807\u8bb0\u4e3a\u79bb\u7ebf<\/strong><\/h2>\n<p>\u5982\u679c\u670d\u52a1\u5668\u5173\u95ed\u4f46\u6ca1\u6709\u6807\u8bb0\u4e3a\u8131\u673a\uff0c\u90a3\u662f\u56e0\u4e3a\u8d1f\u8f7d\u5e73\u8861\u5b88\u62a4\u7a0b\u5e8f\u6267\u884c\u7684\u76d1\u89c6\u4fe1\u53f7\u4ecd\u7136\u5904\u4e8e\u542f\u52a8\u72b6\u6001\u3002 \u5982\u679c\u4f7f\u7528TCP\u76d1\u89c6\u5668\uff0cTCP\u7aef\u53e3\u5fc5\u987b\u4ecd\u7136\u63a5\u53d7\u8fde\u63a5\u3002 \u8be5\u7aef\u53e3\u4e0a\u7684\u670d\u52a1\u53ef\u4ee5\u4ee5\u591a\u79cd\u65b9\u5f0f\u65ad\u5f00\uff0c\u4ecd\u7136\u53ef\u4ee5\u56de\u590dTCP\u8fde\u63a5\u3002 \u5bf9\u4e8eICMP\u76d1\u89c6\u5668\uff0c\u8fd9\u4e2a\u95ee\u9898\u66f4\u52a0\u4e25\u91cd\uff0c\u56e0\u4e3a\u670d\u52a1\u5668\u53ef\u4ee5\u6302\u8d77\u6216\u6545\u969c\uff0c\u6ca1\u6709\u4efb\u4f55\u76d1\u542c\u670d\u52a1\uff0c\u4ecd\u7136\u53ef\u4ee5\u56de\u7b54ping\u3002<\/p>\n<h2><strong>\u5728\u7ebf\u670d\u52a1\u5668\u672a\u6807\u8bb0\u4e3a\u5728\u7ebf<\/strong><\/h2>\n<p>\u5982\u679c\u670d\u52a1\u5668\u5728\u7ebf\uff0c\u4f46\u6ca1\u6709\u6807\u8bb0\u4e3a\u5728\u7ebf\uff0c\u90a3\u662f\u56e0\u4e3a\u4ece\u8d1f\u8f7d\u5e73\u8861\u5b88\u62a4\u7a0b\u5e8f\u76d1\u89c6\u5668\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u5b83\u4e0d\u662f\u8054\u673a\u7684\u3002 \u670d\u52a1\u5668\u5fc5\u987b\u5728\u6240\u4f7f\u7528\u7684TCP\u7aef\u53e3\u4e0a\u56de\u7b54\u6216\u54cd\u5e94\u6765\u81ea\u6700\u9760\u8fd1\u670d\u52a1\u5668\u7684\u9632\u706b\u5899\u63a5\u53e3IP\u5730\u5740\u7684ping\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u670d\u52a1\u5668\u5728LAN\u4e0a\uff0c\u5219\u670d\u52a1\u5668\u5fc5\u987b\u5e94\u7b54\u4ece\u9632\u706b\u5899\u7684LAN IP\u5730\u5740\u53d1\u8d77\u7684\u8bf7\u6c42\u3002 \u8981\u9a8c\u8bc1ICMP\u76d1\u89c6\u5668\uff0c\u8bf7\u5bfc\u822a\u5230\u5230Diagnostics &gt; Ping\uff0c\u5e76\u4f7f\u7528\u670d\u52a1\u5668\u6240\u5728\u7684\u63a5\u53e3Ping\u670d\u52a1\u5668IP\u5730\u5740\u3002<\/p>\n<p>\u5bf9\u4e8eTCP\u76d1\u89c6\u5668\uff0c\u8bf7\u4f7f\u7528\u201cDiagnostics &gt; Test Port\u201d\uff0c\u5e76\u9009\u62e9\u9632\u706b\u5899\u7684LAN\u63a5\u53e3\u4f5c\u4e3a\u6e90\uff0c\u5c06Web\u670d\u52a1\u5668\u7684IP\u5730\u5740\u548c\u7aef\u53e3\u4f5c\u4e3a\u76ee\u6807\u3002<\/p>\n<p>\u53e6\u4e00\u79cd\u6d4b\u8bd5\u65b9\u6cd5\u662f\u4f7f\u7528\u9632\u706b\u5899\u7684shell\u63d0\u793a\u7b26\uff0c\u4f7f\u7528console\u6216ssh\u83dc\u5355\u9009\u98798\u548cnc\u547d\u4ee4\uff1a<\/p>\n<pre>#\u00a0nc\u00a0-vz\u00a010.6.0.12\u00a080nc:\u00a0\r\nconnect\u00a0to\u00a010.6.0.12\u00a0port\u00a080\u00a0(tcp)\u00a0failed:\u00a0Operation\u00a0timed\u00a0out<\/pre>\n<p>\u4e0a\u9762\u662f\u4e00\u4e2a\u5931\u8d25\u7684\u4f8b\u5b50\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u6210\u529f\u8fde\u63a5\u7684\u4f8b\u5b50:<\/p>\n<pre>#\u00a0nc\u00a0-vz\u00a010.6.0.12\u00a080\r\nConnection\u00a0to\u00a010.6.0.12\u00a080\u00a0port\u00a0[tcp\/http]\u00a0succeeded!<\/pre>\n<p>\u5982\u679c\u8fde\u63a5\u5931\u8d25\uff0c\u8bf7\u5728Web\u670d\u52a1\u5668\u4e0a\u8fdb\u4e00\u6b65\u8fdb\u884c\u6545\u969c\u6392\u9664\u3002<\/p>\n<h2><strong>\u4e0e\u6c60\u670d\u52a1\u5668\u5728\u540c\u4e00\u5b50\u7f51\u4e2d\u7684\u5ba2\u6237\u7aef\u65e0\u6cd5\u8bbf\u95ee\u865a\u62df\u670d\u52a1\u5668<\/strong><\/h2>\n<p>\u4e0e\u6c60\u670d\u52a1\u5668\u5728\u540c\u4e00\u5b50\u7f51\u4e2d\u7684\u5ba2\u6237\u7aef\u7cfb\u7edf\u5c06\u65e0\u6cd5\u4f7f\u7528\u6b64\u8d1f\u8f7d\u5e73\u8861\u65b9\u6cd5\u6b63\u786e\u8fde\u63a5\u3002 relayd\u5c06\u8fde\u63a5\u8f6c\u53d1\u5230\u5177\u6709\u5ba2\u6237\u7aef\u6e90\u5730\u5740\u7684Web\u670d\u52a1\u5668\u3002\u7136\u540e\uff0c\u670d\u52a1\u5668\u5c06\u5c1d\u8bd5\u76f4\u63a5\u54cd\u5e94\u5ba2\u6237\u7aef\u3002\u5982\u679c\u670d\u52a1\u5668\u5177\u6709\u5230\u5ba2\u6237\u7aef\u7684\u76f4\u63a5\u8def\u5f84\uff0c\u4f8b\u5982\u901a\u8fc7\u540c\u4e00\u5b50\u7f51\u4e2d\u7684\u672c\u5730\u8fde\u63a5\u7684NIC\uff0c\u5b83\u5c06\u4e0d\u4f1a\u6b63\u5e38\u901a\u8fc7\u9632\u706b\u5899\u56de\u6d41\uff0c\u5ba2\u6237\u7aef\u5c06\u4ece\u670d\u52a1\u5668\u7684\u672c\u5730IP\u5730\u5740\u6536\u5230\u56de\u590d\uff0c\u800c\u4e0d\u4f1a\u5728relayd\u4e2d\u6536\u5230\u8be5IP\u5730\u5740\u3002\u7136\u540e\uff0c\u7531\u4e8e\u4ece\u5ba2\u6237\u7aef\u7684\u89d2\u5ea6\u770b\uff0c\u670d\u52a1\u5668IP\u5730\u5740\u4e0d\u6b63\u786e\uff0c\u8fde\u63a5\u88ab\u4e22\u5f03\u4e3a\u65e0\u6548\u3002<\/p>\n<p>\u8fd9\u6837\u505a\u7684\u4e00\u4e2a\u65b9\u6cd5\u662f\u4f7f\u7528\u624b\u52a8\u51fa\u7ad9NAT\u548c\u5236\u5b9a\u624b\u52a8\u51fa\u7ad9NAT\u89c4\u5219\uff0c\u4ee5\u4fbf\u4eceLAN\u5b50\u7f51\u5230\u8fbeWeb\u670d\u52a1\u5668\u7684\u5185\u90e8\u63a5\u53e3\uff08LAN\uff09\u7684\u6d41\u91cf\u8f6c\u6362\u4e3aLAN\u7684\u63a5\u53e3\u5730\u5740\u3002\u8fd9\u6837\uff0c\u6d41\u91cf\u4f3c\u4e4e\u6e90\u4e8e\u9632\u706b\u5899\uff0c\u670d\u52a1\u5668\u5c06\u54cd\u5e94\u5230\u9632\u706b\u5899\uff0c\u7136\u540e\u9632\u706b\u5899\u5c06\u8be5\u6d41\u91cf\u4e2d\u7ee7\u5230\u5ba2\u6237\u7aef\u4f7f\u7528\u7684\u9884\u671f\u5730\u5740\u3002\u539f\u59cb\u7684\u5ba2\u6237\u7aef\u6e90IP\u5730\u5740\u5728\u8be5\u8fc7\u7a0b\u4e2d\u4e22\u5931\uff0c\u6700\u4f73\u7684\u89e3\u51b3\u65b9\u6848\u662f\u5c06\u670d\u52a1\u5668\u79fb\u52a8\u5230\u4e0d\u540c\u7684\u7f51\u6bb5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728pfsense\u7684\u7f51\u5173\u548c\u670d\u52a1\u5668\u4e2d\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u8d1f\u8f7d\u5e73\u8861\u529f\u80fd\u3002\u7f51\u5173\u8d1f\u8f7d\u5e73\u8861\u53ef\u4ee5\u901a\u8fc7\u591a &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=215\">\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":[401],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-pfsense","tag-401"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/215","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=215"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/215\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}