官方文档写的很详细..............
唯一不足就是要先翻墙.....
安装
Windows [7, 8.1, 10, 11, 2008R2, 2012R2, 2016, 2019, 2022 – v0.5.3]
macOS [应用程序商店 – v1.0.16]
Ubuntu [模块 – v1.0.20210606 – 过时和工具 – v1.0.20210914]
$ sudo apt install wireguard
安卓[播放商店 – v1.0.20231018 & direct apk文件 – v1.0.20231018]
iOS [应用程序商店 – v1.0.16]
Debian [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
# apt install wireguard
Debian版本比Bullseye版本早的用户应该启用反向移植。
Fedora [工具 – v1.0.20210914]
$ sudo dnf install wireguard-tools
Mageia [工具 – v1.0.20210914]
$ sudo urpmi wireguard-tools
Arch [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
$ sudo pacman -S wireguard-tools
内核<5.6的用户也可以选择wireguard-lts
或wireguard-dkms
+linux-headers
,具体取决于使用的内核。
OpenSUSE/SLE [工具 – v1.0.20210914]
$ sudo zypper install wireguard-tools
Slackware [工具 – v1.0.20210914]
$ sudo slackpkg install wireguard-tools
Alpine [工具 – v1.0.20210914]
# apk add -U wireguard-tools
Gentoo [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
# emerge wireguard-tools
The wireguard-modules
ebuild also exists for compatibility with older kernels.
Exherbo [模块 – vunknown – 过时 & 工具 – vunknown – 过时]
# cave resolve -x wireguard
NixOS [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
environment.systemPackages = [ pkgs.wireguard pkgs.wireguard-tools ];
Nix on Darwin [userspace go – v0.0.20230223 & 工具 – v1.0.20210914]
$ nix-env -iA nixpkgs.wireguard-tools
OpenWRT [工具 – v1.0.20210914]
# opkg install wireguard
可以在维基上找到进一步的安装和配置说明。
Oracle Linux 8 [UEK6 & tools – v1.0.20200827 – 过时]
# dnf install oraclelinux-developer-release-el8
# dnf config-manager --disable ol8_developer
# dnf config-manager --enable ol8_developer_UEKR6
# dnf config-manager --save --setopt=ol8_developer_UEKR6.includepkgs='wireguard-tools*'
# dnf install wireguard-tools
红帽企业Linux 8 [module-kmod – vunknown – 过时,module-dkms – vunknown – 过时,&工具 – v1.0.20210914]
方法1:最简单的方法是通过ELRepo的预建模块:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
$ sudo yum install kmod-wireguard wireguard-tools
方法2:运行非标准内核的用户可能希望使用DKMS软件包:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
$ sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
$ sudo yum copr enable jdoss/wireguard
$ sudo yum install wireguard-dkms wireguard-tools
CentOS 8 [module-plus – v1.0.20210606 – 过时,module-kmod – vunknown – 过时,module-dkms – vunknown – 过时,&工具 – v1.0.20210914]
方法1:签名模块可作为CentOS内核plus的内置模块:
$ sudo yum install yum-utils epel-release
$ sudo yum-config-manager --setopt=centosplus.includepkgs="kernel-plus, kernel-plus-*" --setopt=centosplus.enabled=1 --save
$ sudo sed -e 's/^DEFAULTKERNEL=kernel-core$/DEFAULTKERNEL=kernel-plus-core/' -i /etc/sysconfig/kernel
$ sudo yum install kernel-plus wireguard-tools
$ sudo reboot
方法2:最简单的方法是通过ELRepo的预建模块:
$ sudo yum install elrepo-release epel-release
$ sudo yum install kmod-wireguard wireguard-tools
方法3:运行非标准内核的用户可能希望使用DKMS软件包:
$ sudo yum install epel-release
$ sudo yum config-manager --set-enabled PowerTools
$ sudo yum copr enable jdoss/wireguard
$ sudo yum install wireguard-dkms wireguard-tools
Oracle Linux 7 [UEK6 & tools – v1.0.20200827 – 过时]
# yum install oraclelinux-developer-release-el7
# yum-config-manager --disable ol7_developer
# yum-config-manager --enable ol7_developer_UEKR6
# yum-config-manager --save --setopt=ol7_developer_UEKR6.includepkgs='wireguard-tools*'
# yum install wireguard-tools
Red Hat Enterprise Linux 7 [module-kmod – vunknown – 过时,module-dkms – vunknown – 过时,&工具 – v1.0.20210914]
方法1:最简单的方法是通过ELRepo的预建模块:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
$ sudo yum install kmod-wireguard wireguard-tools
方法2:运行非标准内核的用户可能希望使用DKMS软件包:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo
$ sudo yum install wireguard-dkms wireguard-tools
CentOS 7 [module-plus – v1.0.20220627,module-kmod – vunknown – 过时,module-dkms – vunknown – 过时,&tools – v1.0.20210914]
方法1:签名模块可作为CentOS内核plus的内置模块:
$ sudo yum install yum-utils epel-release
$ sudo yum-config-manager --setopt=centosplus.includepkgs=kernel-plus --enablerepo=centosplus --save
$ sudo sed -e 's/^DEFAULTKERNEL=kernel$/DEFAULTKERNEL=kernel-plus/' -i /etc/sysconfig/kernel
$ sudo yum install kernel-plus wireguard-tools
$ sudo reboot
方法2:希望坚持使用标准内核的用户可以使用ELRepo的预建模块:
$ sudo yum install epel-release elrepo-release
$ sudo yum install yum-plugin-elrepo
$ sudo yum install kmod-wireguard wireguard-tools
方法3:运行非标准内核的用户可能希望使用DKMS软件包:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo curl -o /etc/yum.repos.d/jdoss-wireguard-epel-7.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo
$ sudo yum install wireguard-dkms wireguard-tools
FreeBSD [kmod – vunknown – 过时,用户空间去 – v0.0.20230223 & 工具 – v1.0.20210914]
# pkg install wireguard
OpenBSD [工具 – v1.0.20210914]
# pkg_add wireguard-tools
Termux [工具 – v1.0.20210914]
# pkg install wireguard-tools
无效[模块 – v1.0.20220627 & 工具 – v1.0.20210914]
# xbps-install -S wireguard-tools wireguard-dkms
Adélie Linux [模块 – vunknown – 过时和工具 – vunknown – 过时]
# apk add wireguard-tools wireguard-module
来源法师[工具 – v1.0.20210914]
# cast wireguard-tools
Buildroot [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y
BR2_PACKAGE_WIREGUARD_TOOLS=y
EdgeOS [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
$ sudo dpkg -i wireguard-{type}-{version}.deb
首先从发布页面下载正确的预构建文件,然后使用dpkg
安装,如上所述。
AstLinux [模块 – v1.0.20220627 & 工具 – v1.0.20210914]
BR2_PACKAGE_WIREGUARD_TOOLS=y
BR2_PACKAGE_WIREGUARD=y
Milis [模块 – v1.0.20200908 – 过时和工具 – v1.0.20200827 – 过时]
# mps kur wireguard-tools wireguard-linux-compat
macOS Homebrew和MacPorts – Basic CLI [homebrew userspace go – vunknown – out of date & homebrew tools – vunknown – out of date] & [macports userspace go – v0.0.20230223 & macports tools – v1.0.20210914]
$ brew install wireguard-tools
或
$ port install wireguard-tools
有关更多信息,请参阅跨平台文档。