# cat /etc/wireguard/wg0.conf[Interface]Address = 172.16.1.2SaveConfig = truePrivateKey = UBiF85o7937fBK84c2qLFQwEr6eDhLSJsb5SAq1lF3c=[Peer]PublicKey = FEPcisOjLaZsJbYSxb0CI5pvbXwIB3BCjMUPxuaLrH8=AllowedIPs = 172.16.1.254/32Endpoint = peera.example.com:60001EOF最...
Run thesysctlcommand to reread the/etc/sysctl.conffile. Copy sudo sysctl -p You can disregard the error messages that might appear about the command not being able to performstat. Create a directory where you can store the WireGuard key pair, for example: Copy mkdir ~/.wireguard cd ~/.wi...
Once you have created the new client, you will see the option to click the QR code icon which can be scanned for the configuration, click the down arrow to download the conf file or the trash icon to delete the client. Config download options If you click the download button, a<clientn...
Endpoint = peera.example.com:60001 EOF 最后一步是将接口配置文件导入 NetworkManager。如上所述,这一步是重启后保持 WireGuard 接口持续存在的关键。 # nmcli con import type wireguard file /etc/wireguard/wg0.conf Connection 'wg0' (39bdaba7-8d91-4334-bc8f-85fa978777d8) successfully added. 验证...
sudo pacman -Sy curl bash resolvconf Alpine Linux: sudo apk update sudo apk add curl bash resolvconf Other Distributions: For other Linux distributions, you can use the package manager specific to that distribution to installcurl&bash&resolvconf. The package names may vary slightly. ...
Create/etc/init.d/wguifile and make it executable cd/etc/init.d/ cat<<EOF> wgui#!/sbin/openrc-runcommand=/sbin/inotifydcommand_args="/usr/local/bin/wgui /etc/wireguard/wg0.conf:w"pidfile=/run/${RC_SVCNAME}.pidcommand_background=yesEOFchmod +x wgui ...
- <PASSWORD_HASH> - WG_HOST=<IPADDRESS> volumes: - ./config:/etc/wireguard - /lib/modules:/lib/modules ports: - "51820:51820/udp" - "51821:51821/tcp" restart: unless-stopped cap_add: - NET_ADMIN - SYS_MODULE sysctls: - net.ipv4.ip_forward=1 - net.ipv4.conf.all.src_valid_ma...
cat > /etc/wireguard/${SERVER_WG_NIC}.conf <<EOF [Interface] Address = ${SERVER_WG_IPV4}/24,${SERVER_WG_IPV6}/64 ListenPort = ${SERVER_WG_PORT} PrivateKey = ${SERVER_PRIVATE_KEY} [Peer] PublicKey = ${CLIENT_PUBLIC_KEY} ...
Edit the file /etc/wireguard/wg0.conf so that it looks like this: Copy code snippet Copied to Clipboard Error: Could not Copy Copied to Clipboard Error: Could not Copy [Interface] Address = 192.168.2.1/24 SaveConfig = true PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t...
编写服务端配置文件vim /etc/wireguard/wg0.conf写入如下内容: 代码语言:javascript 复制 [Interface]PrivateKey=【服务端私钥privatekey】 Address=10.12.0.1/16PreUp=iptables-t nat-APOSTROUTING-s10.11.0.0/16-o wg0-jMASQUERADEPostUp=iptables-AFORWARD-i wg0-jACCEPT;iptables-AFORWARD-o wg0-jACCEPT;ipta...