LOGO 首页 OA教程 ERP教程 模切知识交流 PMS教程 CRM教程 技术文档 其他文档  
 
网站管理员

WireGuard介绍及客户端使用教程

admin
2024年7月24日 18:57 本文热度 5248

WireGuard介绍

WireGuard是Jason A. Donenfeld开发的开源VPN协议。目前支持Linux, macOS, Android以及OpenWrt。iOS和Windows官方客户端还在开发,但第三方Windows客户端已经出现。WireGuard被视为下一代VPN协议,用来替代OpenVPN,IPSec等VPN协议。

<iframe id="aswift_1" name="aswift_1" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=3910067449&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818510&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510043&bpp=8&bdt=4195&idt=-M&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie_enabled=1&eoidce=1&prev_fmts=0x0&nras=2&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=1&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=1012&biw=1903&bih=979&scr_x=0&scr_y=0&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=0&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=2&uci=a!2&btvi=1&fsb=1&dtd=70" data-google-container-id="a!2" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="CJzqvOTBv4cDFUoXewcdoMcGLw" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

官方网站https://www.wireguard.com/

WireGuard协议作为Linux内核模块运行,所以效率极高。使用了最先进的加密技术(利用Curve25519进行密钥交换,ChaCha20和Poly1305用于数据认证,BLAKE2用于散列),安全性毋庸置疑。WireGuard是为嵌入式设备开发的,支持IP地址漫游,也就是网络断开再连,对它不会有影响。WireGuard使用UDP协议传输数据,在不使用的情况下默认不会传输任何 UDP 数据包,所以比常规VPN省电很多,可以像SS一样一直挂着使用。

WireGuard协议的速度几乎秒杀其它VPN协议,测试结果如下图:

WireGuard Android客户端使用教程

<iframe id="aswift_2" name="aswift_2" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=1767445747&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818510&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510043&bpp=3&bdt=4195&idt=-M&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie_enabled=1&eoidce=1&prev_fmts=0x0%2C640x280&nras=3&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=1&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=2199&biw=1903&bih=979&scr_x=0&scr_y=0&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=0&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=3&uci=a!3&btvi=2&fsb=1&dtd=94" data-google-container-id="a!3" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="CNekvuTBv4cDFc2FuQUdpFgIFQ" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

WireGuard协议目前处于实验阶段,但是Mullvad和AzireVPN这两家商业VPN已经部署应用了这个协议。AzireVPN更是为了大规模测试WireGuard,提供免费WireGuard服务,而且没有任何速度,时间,带宽限制,支持IPv6以及P2P,BT下载。

这里就借着AzireVPN介绍下Android上如何使用WireGuard:

  1. 注册AzireVPN账号:<a class="markup--anchor markup--li-anchor" href="https://www.azire%3Ca%20href%3D/" http:="" hqyman.cn="" tags-4.html"="" style="padding: 0px; margin: 0px; text-decoration-line: none; color: rgb(94, 170, 228);">vpn.com/manager/auth/register" target="_blank" rel="nofollow noopener nofollow noopener" data-href="https://www.azirevpn.com/manager/auth/register" style="box-sizing: border-box; background-color: transparent; color: rgb(252, 60, 45); text-decoration-line: none; transition: all 0.3s ease-in 0s; outline: 0px !important;">https://www.azirevpn.com/manager/auth/register,只需要填写用户名USERNAME和密码PASSWORD即可,可以不填Email,这才是注重隐私的VPN供应商. 如果注册需要邀请码Referral code可以填:wf63gFwSQw

  2. 下载配置文件:https://www.azirevpn.com/cfg/wireguard,在这个网址填写注册的用户名密码,点Download Configuration。目前提供了加拿大多伦多(azirevpn-ca1),西班牙马拉加(azirevpn-es1),瑞典斯德哥尔摩(azirevpn-se1),英国伦敦(azirevpn-uk1),美国迈阿密(azirevpn-us1)这5个节点

  3. 安装WireGuard Android客户端,Play下载地址:https://play.google.com/store/apps/details?id=com.wireguard.android

4. 导入配置文件:把之前下载的配置文件传到手机里,手机上打开WireGuard客户端,点右下角加号,选择第一个Create from file or archive,点选传到手机里的配置文件。这时直接点选某个配置文件即可连接VPN,建议选择uk1服务器

<iframe id="aswift_3" name="aswift_3" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=510140889&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818510&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510043&bpp=3&bdt=4195&idt=3&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie_enabled=1&eoidce=1&prev_fmts=0x0%2C640x280%2C640x280&nras=4&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=1&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=3827&biw=1903&bih=979&scr_x=0&scr_y=0&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=0&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=4&uci=a!4&btvi=3&fsb=1&dtd=108" data-google-container-id="a!4" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="CPWLv-TBv4cDFXMyewcduLIKhg" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

Tips:

  1. WireGuard客户端可以允许部分应用绕过VPN,打开WireGuard,点击一个节点配置,在右上角点击铅笔按钮,在中间有蓝色的0 EXCLUDED APPLICATIONS,点击后进入APP排除设置,勾选某个APP就是让这个APP不走VPN通道。选择完成后点右下角蓝色SET EXCLUSIONGS,然后点配置界面右上角的保存按钮即可。

  2. WireGuard Android客户端支持快捷设置面板功能。即在下拉通知栏中可以添加WireGuard快捷设置

WireGuard Windows PC客户端使用教程

上文有介绍过WireGuard以及Android客户端的使用。目前官方尚未释出Windows客户端,但是大神Ludvig Strigeus(?Torrent作者,Spotify主要开发者)发布了第一款可在Windows PC上使用的WireGuard协议客户端TunSafe,支持Windows 7及后续版本。使用步骤134走起:

  1. 下载TunSafe WireGuard客户端,地址 https://tunsafe.com/download。因为目前测试版迭代比较快,功能也更多,使用还算稳定,推荐下载带rc字样的测试版,下图是两个版本对比


TunSafe V1.2


TunSafe V1.4 rc1

2. 安装客户端,直接按同意,下一步,完成

<iframe id="aswift_4" name="aswift_4" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=1770278172&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818526&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510056&bpp=3&bdt=4208&idt=3&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D5a322db1bd3ebc4f%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MYYuYb_PE-TJkHzt7FrdzVVniD2SA&gpic=UID%3D00000ea521fea747%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MZudw-HVWaRXx5NkjKyIl9yLRnwMQ&eo_id_str=ID%3D946835d08cd27a71%3AT%3D1721818508%3ART%3D1721818508%3AS%3DAA-AfjZ3T8e92U0-Z7jOzsy6qd72&prev_fmts=0x0%2C640x280%2C640x280%2C640x280%2C1920x979&nras=6&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=2&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=4946&biw=1903&bih=979&scr_x=0&scr_y=1111&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=3&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=5&uci=a!5&btvi=4&fsb=1&dtd=16482" data-google-container-id="a!5" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="CKWsqOzBv4cDFR_xTAId2GkOEA" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

3.导入WireGuard配置。打开TunSafe,选择Options,选择Import File…导入单个配置,或者可以拖动单个配置文件到TunSafe窗口完成导入。如果想一次性导入多个文件,可以在Options里选择Browse In Explorer,就会打开C:\Program Files\TunSafe\Config这个文件夹,然后将配置文件一起复制到这个文件夹即可。

4.点击客户端的Connect即可连接VPN。Edit Config可以编辑配置文件,文末会副上配置文件编辑说明。

Tips:

  1. 连接完成后也可以打开如下网页测试下自己的服务器位置以及使用的DNS:https://www.dnsleaktest.com

  2. 你也可以将多个节点配置放到一个文件夹中,再将这个文件夹放入C:\Program Files\TunSafe\Config,TunSafe这时会将子文件夹列为二级菜单显示,如下图


Submenus

WireGuard配置文件由VPN供应商提供,或者自建服务器,前文介绍过AzireVPN提供的免费WireGuard服务器,这里就可以使用。解压从AzireVPN下载的zip压缩包,里面有几个.conf配置文件就可以导入。

<iframe id="aswift_5" name="aswift_5" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=3204179050&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818527&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510066&bpp=3&bdt=4218&idt=3&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D5a322db1bd3ebc4f%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MYYuYb_PE-TJkHzt7FrdzVVniD2SA&gpic=UID%3D00000ea521fea747%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MZudw-HVWaRXx5NkjKyIl9yLRnwMQ&eo_id_str=ID%3D946835d08cd27a71%3AT%3D1721818508%3ART%3D1721818508%3AS%3DAA-AfjZ3T8e92U0-Z7jOzsy6qd72&prev_fmts=0x0%2C640x280%2C640x280%2C640x280%2C1920x979%2C640x280&nras=7&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=2&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=5896&biw=1903&bih=979&scr_x=0&scr_y=1987&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=3&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=6&uci=a!6&btvi=5&fsb=1&dtd=17379" data-google-container-id="a!6" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="CIiJ3-zBv4cDFfgYewcdDGAAjg" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

又有福利强势插入:TunSafe同时提供了5个免费的公用服务器,目前速度还不错,分别是Amsterdam / Netherlands(荷兰阿姆斯特丹),Bucharest / Romania(罗马尼亚布加勒斯特), New-York / US(美国纽约),Stockholm / Sweden(瑞典斯德哥尔摩),Düsseldorf / Germany(德国杜塞尔多夫)。使用方法:

  1. 打开TunSafe Windows客户端,点击Options,然后点击Generate Key Pair,打开密钥生成页面,点击Randomize生成密钥,如下图

Generate Key Pair

2. 进入配置下载页面,https://tunsafe.com/vpn,将刚生成的Public Key复制粘贴到此网页中的Enter your public key中,点击Create account,生成配置文件。如下图

<iframe id="aswift_6" name="aswift_6" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=2883041771&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818528&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510076&bpp=3&bdt=4228&idt=3&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D5a322db1bd3ebc4f%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MYYuYb_PE-TJkHzt7FrdzVVniD2SA&gpic=UID%3D00000ea521fea747%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MZudw-HVWaRXx5NkjKyIl9yLRnwMQ&eo_id_str=ID%3D946835d08cd27a71%3AT%3D1721818508%3ART%3D1721818508%3AS%3DAA-AfjZ3T8e92U0-Z7jOzsy6qd72&prev_fmts=0x0%2C640x280%2C640x280%2C640x280%2C1920x979%2C640x280%2C640x280&nras=8&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=2&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=6456&biw=1903&bih=979&scr_x=0&scr_y=2547&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=3&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=7&uci=a!7&btvi=6&fsb=1&dtd=18105" data-google-container-id="a!7" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="COWCjO3Bv4cDFaWPuQUdkccAlA" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

3. 再将生成的Private Key复制到这个页面的Enter your private key里面。这个页面是可以编辑的,你可以看到DNS里面写了Google Public DNS 8.8.8.8,你也可以改成自己想要的DNS,后续所有VPN流量会使用这个DNS。最下面的Endpoint就是服务器地址。一个配置文件只能对应一个服务器,所以你需要将要使用的服务器前面Endpoint的#去掉,将其他不使用的服务器加上#,例如,要使用US服务器,你需要改成如下图。

 

4. 点击Download tunsafe.conf,然后导入到客户端即可使用。你也可以将这几个服务器分成多个单独的配置,每个配置保留不同的Endpoint地址即可。但是要注意每对密钥生成的配置文件只能单个设备使用,其他设备需要重新生成密钥重新下载配置

<iframe id="aswift_7" name="aswift_7" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="640" height="0" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-1735557502348014&output=html&h=280&adk=3393098939&adf=2617760076&w=640&abgtt=6&fwrn=4&fwrnh=100&lmt=1721818528&num_ads=1&rafmt=1&armr=3&sem=mc&pwprc=1482048058&ad_type=text_image&format=640x280&url=http%3A%2F%2Fhqyman.cn%2Fpost%2F661.html&fwr=0&pra=3&rh=160&rw=640&rpe=1&resp_fmts=3&wgl=1&fa=27&dt=1721818510086&bpp=3&bdt=4238&idt=3&shv=r20240722&mjsv=m202407180101&ptt=9&saldr=aa&abxe=1&cookie=ID%3D5a322db1bd3ebc4f%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MYYuYb_PE-TJkHzt7FrdzVVniD2SA&gpic=UID%3D00000ea521fea747%3AT%3D1721818508%3ART%3D1721818508%3AS%3DALNI_MZudw-HVWaRXx5NkjKyIl9yLRnwMQ&eo_id_str=ID%3D946835d08cd27a71%3AT%3D1721818508%3ART%3D1721818508%3AS%3DAA-AfjZ3T8e92U0-Z7jOzsy6qd72&prev_fmts=0x0%2C640x280%2C640x280%2C640x280%2C1920x979%2C640x280%2C640x280%2C640x280&nras=9&correlator=2044342200126&frm=20&pv=1&ga_vid=2069212717.1721818506&ga_sid=1721818509&ga_hid=162625595&ga_fc=1&u_tz=480&u_his=2&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_sd=1&adx=527&ady=7432&biw=1903&bih=979&scr_x=0&scr_y=3540&eid=44759876%2C44759927%2C44759842%2C42532523%2C44795921%2C95332927%2C95334528%2C95334830%2C95337869%2C95338254%2C95336266&oid=2&pvsid=1253706962004064&tmod=1340900499&uas=3&nvt=1&fc=1408&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1920%2C979&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=23&bz=1&psd=W251bGwsbnVsbCxudWxsLDNd&ifi=8&uci=a!8&btvi=7&fsb=1&dtd=18893" data-google-container-id="a!8" tabindex="0" title="Advertisement" aria-label="Advertisement" data-load-complete="true" data-google-query-id="CNKWve3Bv4cDFRc6ewcdXWwG-w" style="padding: 0px; margin: 0px; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 640px; height: 0px;"></iframe>

配置文件说明

这里一般不需要更改

#客户端虚拟网络设备
[Interface]
# 本机的密钥
PrivateKey = gIIBl0OHb3wZjYGqZtgzRml3wec0e5vqXtSvCTfa42w=
# 设置UDP监听端口可以让其他客户端向本机发起连接
# ListenPort = 51820
# VPN连接成功后使用的DNS服务器
# DNS = 8.8.8.8
# 拦截所有DNS请求并强制所有DNS都通过VPN
# BlockDNS = true
# 虚拟网络设备的内网IP地址
Address = 192.168.2.2/24
# 流量拦截功能,是否拦截所有未通过tunsafe的网络请求:
#  route - 使用黑洞路由阻止所有流量(直接丢弃数据包)
#  firewall - 通过Windows防火墙阻止除tunsafe外的所有流量
#  on - 使用默认拦截机制
#  off - 关闭流量拦截
# BlockInternet = route, firewall
# MTU
# MTU = 1420
#服务器配置
[Peer]
# 服务器公钥
PublicKey = hIA3ikjlSOAo0qqrI+rXaS3ZH04Yx7Q2YQ4m2Syz+XE=
# 预共享密钥
PresharedKey  =  SNz4BYc61amtDhzxNCxgYgdV9rPU+WiC8woX47Xf/2Y=
# 需要转发流量的IP范围,如果你要把流量全部转发到服务器就填0.0.0.0/0
AllowedIPs = 192.168.2.0/24
# 服务器IP
Endpoint = 192.168.1.4:8040
# 保持连接参数
PersistentKeepalive = 25
# 当服务器作为默认网关时,是否通过隧道转发多播和广播数据包
# AllowMulticast = false

Reference:

  1. https://en.wikipedia.org/wiki/WireGuard

  2. https://www.wireguard.com/

  3. https://www.azirevpn.com/wireguard

  4. https://tunsafe.com/

  5. https://sskaje.me/2017/06/wireguard-wg-quick-postup的高级玩法/

文章转载:地址直达


该文章在 2024/7/24 18:57:05 编辑过
关键字查询
相关文章
正在查询...
点晴ERP是一款针对中小制造业的专业生产管理软件系统,系统成熟度和易用性得到了国内大量中小企业的青睐。
点晴PMS码头管理系统主要针对港口码头集装箱与散货日常运作、调度、堆场、车队、财务费用、相关报表等业务管理,结合码头的业务特点,围绕调度、堆场作业而开发的。集技术的先进性、管理的有效性于一体,是物流码头及其他港口类企业的高效ERP管理信息系统。
点晴WMS仓储管理系统提供了货物产品管理,销售管理,采购管理,仓储管理,仓库管理,保质期管理,货位管理,库位管理,生产管理,WMS管理系统,标签打印,条形码,二维码管理,批号管理软件。
点晴免费OA是一款软件和通用服务都免费,不限功能、不限时间、不限用户的免费OA协同办公管理系统。
Copyright 2010-2026 ClickSun All Rights Reserved  粤ICP备13012886号-2  粤公网安备44030602007207号