admin 管理员组

文章数量: 887021

一、服务器的配置

1.解决腾讯云服务器CentOS系统,yum指令由于无法正常使用的问题:
https://blog.csdn/qq_31876443/article/details/125157730?spm=1001.2014.3001.5502

2.安装Wireguard
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

3.执行以下命令(不一定需要)
ip link add dev wg0 type wireguard
ip address add dev wg0 192.168.2.1 peer 192.168.2.2
ip link set up dev wg0

3.cd /etc/wireguard

4.生成密钥
wg genkey | tee sprivatekey | wg pubkey > spublickey
wg genkey | tee cprivatekey | wg pubkey > cpublickey

5.打开防火墙转发功能
echo 1 > /proc/sys/net/ipv4/ip_forward
echo “net.ipv4.ip_forward = 1” >> /etc/sysctl.conf
sysctl -p

6.编写服务器配置文件(摘自csdn:https://blog.csdn/x_mm_c/article/details/117999495)

echo "[Interface]
# 服务器的私匙,对应客户端配置中的公匙(自动读取上面刚刚生成的密匙内容)
PrivateKey = $(cat sprivate

本文标签: 腾讯 服务器 Wireguard