{"id":5765,"date":"2020-08-24T16:41:13","date_gmt":"2020-08-24T08:41:13","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=5765"},"modified":"2020-08-24T17:23:19","modified_gmt":"2020-08-24T09:23:19","slug":"pfsense%e4%b8%adwireguard%e8%bf%9b%e8%a1%8cvpn%e8%bf%9e%e6%8e%a5","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=5765","title":{"rendered":"pfSense\u4e2d\u4f7f\u7528WireGuard\u8fdb\u884cVPN\u8fde\u63a5"},"content":{"rendered":"<p style=\"text-align: justify;\">\u867d\u7136\u5728OPNsense\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u63d2\u4ef6\u5b89\u88c5\u7684\u65b9\u5f0f\u5b9e\u73b0\u5bf9WireGuard\u7684\u652f\u6301\uff0c\u4f46pfSense\u5b98\u65b9\u63d2\u4ef6\u5217\u8868\u5e76\u4e0d\u5305\u542bWireGuard\u3002\u5728<a href=\"https:\/\/github.com\/Ascrod\/pfSense-pkg-wireguard\">github<\/a>\u4e0a\u6709\u70ed\u5fc3\u7684\u7f51\u53cb\u5236\u4f5c\u4e86\u4f9bpfSense\u4f7f\u7528\u7684WireGuard\u63d2\u4ef6\uff0c\u5e76\u4e14\u6784\u5efa\u4e86\u7b2c\u4e00\u4e2a\u521d\u59cb\u7248\u672c<a class=\"d-flex flex-items-center min-width-0\" href=\"https:\/\/github.com\/Ascrod\/pfSense-pkg-wireguard\/releases\/download\/v1.0.0\/pfSense-pkg-wireguard-1.0.0.txz\" rel=\"nofollow\"><span class=\"pl-2 flex-auto min-width-0 text-bold\">pfSense-pkg-wireguard-1.0.0.txz<\/span><\/a>\uff0c\u7ecf\u8fc7\u4f5c\u8005\u8bd5\u7528\uff0c\u7a33\u5b9a\u6027\u53ef\u4ee5\u4fdd\u8bc1\u3002\u5177\u4f53\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<h1 style=\"text-align: justify;\"><a id=\"user-content-build\" class=\"anchor\" href=\"https:\/\/github.com\/Ascrod\/pfSense-pkg-wireguard#build\" aria-hidden=\"true\"><\/a>\u6784\u5efa<\/h1>\n<p style=\"text-align: justify;\">\u6784\u5efa\u8fc7\u7a0b\u4e0e\u5176\u4ed6FreeBSD\u548cpfSense\u8f6f\u4ef6\u5305\u76f8\u540c\u3002\u4f60\u9700\u8981\u8bbe\u7f6eFreeBSD\u6784\u5efa\u73af\u5883\uff0c\u5e76\u5728\u4e0a\u9762\u5b89\u88c5\u548c\u6784\u5efawireguard\u548cwireguard\u3002\u53ef\u4ee5\u67e5\u770bpfSense\u8f6f\u4ef6\u5305<a href=\"https:\/\/docs.netgate.com\/pfsense\/en\/latest\/development\/developing-packages.html#testing-building-individual-packages\">\u5f00\u53d1\u6587\u6863<\/a>\u4ee5\u83b7\u53d6\u66f4\u591a\u4fe1\u606f\u3002<\/p>\n<h1 style=\"text-align: justify;\"><a id=\"user-content-installation\" class=\"anchor\" href=\"https:\/\/github.com\/Ascrod\/pfSense-pkg-wireguard#installation\" aria-hidden=\"true\"><\/a>\u5b89\u88c5<\/h1>\n<p style=\"text-align: justify;\">\u8be5\u8f6f\u4ef6\u5305\u53d6\u51b3\u4e8eFreeBSD\u7684wireguard\u548cwireguard-go\u7aef\u53e3\u3002\u9996\u5148\u8981\u786e\u4fdd\u4e0e\u4f60\u4f7f\u7528\u7684pfSense\u76f8\u540c\u7684FreeBSD\u7248\u672c\u3002\u9009\u62e9\u5728\u8be5FreeBSD\u7248\u672c\u4e0b\u8f7d\u6216\u6784\u5efa\u8fd9\u4e9b\u8f6f\u4ef6\u5305\uff0c\u7136\u540e\u5728\u5b89\u88c5\u8be5\u8f6f\u4ef6\u5305\u4e4b\u524d\u4f7f\u7528pkg\u624b\u52a8\u8fdb\u884c\u5b89\u88c5\u3002\u6839\u636e\u4f60\u6240\u4f7f\u7528\u7684\u7684pfSense\u7248\u672c\uff0c\u5728FreeBSD 11\u5b58\u50a8\u5e93\u6216FreeBSD 12\u5b58\u50a8\u5e93\u4e2d\u67e5\u627ewireguard\u548cwireguard-go\u7684\u6700\u65b0\u8f6f\u4ef6\u5305\u94fe\u63a5\u3002<a id=\"user-content-example\" class=\"anchor\" href=\"https:\/\/github.com\/Ascrod\/pfSense-pkg-wireguard#example\" aria-hidden=\"true\"><\/a>\u4f8b\u5982\uff1a<\/p>\n<pre class=\"highlight highlight-source-shell\" style=\"text-align: justify;\">pkg add https:\/\/pkg.freebsd.org\/FreeBSD:11:amd64\/latest\/All\/wireguard-go-0.0.20200320.txz\r\npkg add https:\/\/pkg.freebsd.org\/FreeBSD:11:amd64\/latest\/All\/wireguard-1.0.20200513.txz\r\n<span class=\"pl-c\"># pkg add https:\/\/pkg.freebsd.org\/FreeBSD:11:amd64\/latest\/All\/bash-5.0.17.txz # if dependency is missing<\/span>\r\npkg add https:\/\/github.com\/Ashus\/pfSense-pkg-wireguard\/releases\/download\/v1.0.1\/pfSense-pkg-wireguard-1.0.1-freebsd11-amd64.txz<\/pre>\n<h1 style=\"text-align: justify;\"><a id=\"user-content-configuration\" class=\"anchor\" href=\"https:\/\/github.com\/Ascrod\/pfSense-pkg-wireguard#configuration\" aria-hidden=\"true\"><\/a>\u914d\u7f6e<\/h1>\n<div id=\"translation\" style=\"text-align: justify;\">\n<div class=\"gtx-body\">\u914d\u7f6e\u63a5\u53e3\u548c\u4efb\u610f\u6570\u91cf\u7684\u5bf9\u7aef\u3002\u7136\u540e\u8f6c\u5230\u201c\u5206\u914d\u63a5\u53e3\u201d\u9875\u9762\uff0c\u4e3atunwg0\u521b\u5efa\u4e00\u4e2a\u65b0\u63a5\u53e3\u3002\u91cd\u547d\u540d\u5e76\u542f\u7528\u5b83\uff0c\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u4e0d\u8981\u8fdb\u884c\u4efb\u4f55\u5176\u4ed6\u8bbe\u7f6e\u3002<span class=\"\">\u8bbe\u7f6e\u597d\u63a5\u53e3\u540e\uff0c\u5c31\u53ef\u4ee5\u5c06VPN\u7684\u7aef\u53e3\uff08\u5982<\/span><code>51000<\/code><span class=\"\">\uff09<\/span><span class=\"\">\u8f6c\u53d1<\/span><span class=\"\">\u5230\u63a5\u53e3\u7684IP\uff0c\u5e76\u50cf\u5176\u4ed6\u4efb\u4f55\u63a5\u53e3\u4e00\u6837\u4e3a\u5176\u5206\u914d\u9632\u706b\u5899\u89c4\u5219<\/span>\u3002<\/div>\n<div><\/div>\n<div class=\"gtx-body\">\u5982\u679c\u9700\u8981\u66f4\u591a\u63a5\u53e3\uff0c\u53ef\u4ee5\u5c06tunwg1.conf\u6216\u66f4\u591a\u5177\u6709\u9012\u589e\u63a5\u53e3\u53f7\u7684\u6587\u4ef6\u6dfb\u52a0\u5230\/usr \/local\/etc\/wireguard \/\u76ee\u5f55\u3002\u5f53\u524d\u8fd8\u65e0\u6cd5\u901a\u8fc7GUI\u754c\u9762\u8fdb\u884c\u7f16\u8f91\uff0c\u6ce8\u610f\u6bcf\u6b21\u6dfb\u52a0\u66f4\u591a\u63a5\u53e3\u65f6\uff0c\u90fd\u9700\u8981\u91cd\u65b0\u5b89\u88c5\u8be5\u8f6f\u4ef6\u5305\u5e76\u91cd\u65b0\u542f\u7528wireguard\u670d\u52a1\u3002\u6bcf\u6b21\u91cd\u65b0\u542f\u7528\u670d\u52a1\u65f6\uff0c\u90fd\u4f1a\u518d\u6b21\u4ece\u6587\u4ef6\u4e2d\u68c0\u6d4b\u6240\u6709VPN\u96a7\u9053\uff0c\u786e\u4fdd\u5b83\u4eec\u53ef\u4ee5\u5728\u91cd\u65b0\u542f\u52a8\u540e\u6301\u7eed\u5b58\u5728\uff0c\u4e5f\u53ef\u4ee5\u4e00\u6b21\u4eceGUI\u4e2d\u91cd\u65b0\u52a0\u8f7d\u3002\u6709\u5173\u914d\u7f6eWireGuard\u7684\u5e2e\u52a9\uff0c\u8bf7\u9605\u8bfb<a href=\"https:\/\/git.zx2c4.com\/wireguard-tools\/about\/src\/man\/wg.8#CONFIGURATION%20FILE%20FORMAT\">\u5b98\u65b9\u6587\u6863<\/a>\u3002<\/div>\n<div><\/div>\n<div>\u4ee5\u4e0b\u4e3a\u914d\u7f6e\u5b9e\u4f8b\u56fe\u7247\uff1a<\/div>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5768\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit.png\" width=\"1171\" height=\"900\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit.png 1171w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit-300x231.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit-1024x787.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit-768x590.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020558105-wg_if_edit-390x300.png 390w\" sizes=\"auto, (max-width: 1171px) 100vw, 1171px\" \/><\/a><\/p>\n<p><em>WireGuard \u63a5\u53e3\u8bbe\u7f6e<\/em><\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5769\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit.png\" width=\"1172\" height=\"904\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit.png 1172w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit-300x231.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit-1024x790.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit-768x592.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020619797-wg_peer_edit-389x300.png 389w\" sizes=\"auto, (max-width: 1172px) 100vw, 1172px\" \/><\/a><\/p>\n<p><em>\u5bf9\u7aef\u8bbe\u7f6e<\/em><\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5770\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers.png\" width=\"1166\" height=\"907\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers.png 1166w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers-300x233.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers-1024x797.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers-768x597.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020611896-wg_peers-386x300.png 386w\" sizes=\"auto, (max-width: 1166px) 100vw, 1166px\" \/><\/a><\/p>\n<p><em>\u5bf9\u7aef\u5217\u8868<\/em><\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5771\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service.png\" width=\"1166\" height=\"905\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service.png 1166w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service-300x233.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service-1024x795.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service-768x596.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020627818-wg_service-387x300.png 387w\" sizes=\"auto, (max-width: 1166px) 100vw, 1166px\" \/><\/a><\/p>\n<p><em>\u7cfb\u7edf\u670d\u52a1\u5217\u8868<\/em><\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5772\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status.png\" width=\"1174\" height=\"902\" srcset=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status.png 1174w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status-300x230.png 300w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status-1024x787.png 1024w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status-768x590.png 768w, https:\/\/blog.pfchina.org\/wp-content\/uploads\/2020\/08\/1583020635138-wg_status-390x300.png 390w\" sizes=\"auto, (max-width: 1174px) 100vw, 1174px\" \/><\/a><\/p>\n<p><em>WireGuard\u8fde\u63a5\u72b6\u6001<\/em><\/p>\n<\/div>\n<p style=\"text-align: justify;\">\u6709\u5173WireGuard\u63d2\u4ef6\u7684\u8be6\u7ec6\u4f7f\u7528\u53ca\u95ee\u9898\u89e3\u51b3\u529e\u6cd5\uff0c\u8bf7\u53c2\u9605netgate\u8bba\u575b\u4e0a\u5173\u4e8e\u8be5\u63d2\u4ef6\u7684<a href=\"https:\/\/forum.netgate.com\/topic\/150943\/i-made-a-wireguard-package-for-pfsense\">\u8ba8\u8bba<\/a>\uff0c\u6216\u53c2\u9605<a href=\"https:\/\/forums.torguard.net\/index.php?\/topic\/1975-ascrod-ashus-pfsense-pkg-wireguard-tutorial-guide\/\">pfSense-pkg-wireguard\u5b89\u88c5\u6559\u7a0b<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u867d\u7136\u5728OPNsense\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u63d2\u4ef6\u5b89\u88c5\u7684\u65b9\u5f0f\u5b9e\u73b0\u5bf9WireGuard\u7684\u652f\u6301\uff0c &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=5765\">\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":[101],"class_list":["post-5765","post","type-post","status-publish","format-standard","hentry","category-pfsense","tag-wireguard"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/5765","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=5765"}],"version-history":[{"count":0,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/5765\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}