我们只需要在 Linux 终端中输入 route -n(后来演变出了 ip route,也就是 iproute2 提供的命令),...
1. 生成密钥对 mkdir -p /etc/wireguard/wg genkey | sudo tee /etc/wireguard/server_private.key | wg pubkey | sudo tee /etc/wireguard/server_public.key 2. 创建服务器端配置文件 /etc/wireguard/wg0.conf,并填入以下内容:[Interface]Address = 10.0.0.1/24PrivateKey = <服务器私钥,server_pr...
#/opt/wireguard-server/docker-compose.yaml #需要修改`SERVERURL`字段 #`PEERS=8`时会生成8个peer的配置文件 version:'3.7' services: wireguard: image:linuxserver/wireguard container_name:wireguard cap_add: -NET_ADMIN -SYS_MODULE environment: -PUID=1000 -PGID=1000 -TZ=Africa/Nairobi#set correct t...
NAME="Kylin Linux Advanced Server" VERSION="V10 (Lance)" ID="kylin" VERSION_ID="V10" PRETTY_NAME="Kylin Linux Advanced Server V10 (Lance)" ANSI_COLOR="0;31" 4.19.90-52.22.v2207.ky10.x86_64 开启内核IP转发 echonet.ipv4.ip_forward = 1 >> /etc/sysctl.conf 不重启系统立即生效,使用s...
新开一个session创建wg2 docker run --rm -it --entrypoint=bash \ --name=wg2 \ --cap-add=NET_ADMIN \ --cap-add=SYS_MODULE \ -e PUID=1000 \ -e PGID=1000 \ -v /lib/modules:/lib/modules \ --sysctl="net.ipv4.conf.all.src_valid_mark=1" \ linuxserver/wireguard # 在新开一个...
填写好配置信息后,直接点击UPDATE SERVER CONFIGURATION保存,同时会生成配置文件wg0.conf: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 ?→ cat/etc/wireguard/wg0.conf # Updated:2021-01-2003:59:37.718655459+0000UTC/Created:2021-01-2003:32:28.045982181+0000UTC[Interface]Address=10.6.6.1/24ListenPo...
系统:Ubuntu Server 18.04.1 LTS 64bit 可访问网络的 PC x 1 系统:Windows11 Ubuntu 服务器 IP 地址 42.192.113.207 WireGuard 主端虚拟 IP 地址 172.16.1.11 PC WireGuard 对端虚拟地址:172.16.1.14 安装WireGuard 服务器 sudo apt install -y wireguard ...
---services:wireguard:image:lscr.io/linuxserver/wireguard:latestcontainer_name:wireguardcap_add: -NET_ADMIN-SYS_MODULE#optionalenvironment: -PUID=1000-PGID=1000-TZ=Etc/UTC-SERVERURL=wireguard.domain.com#optional-SERVERPORT=51820#optional-PEERS=1#optional-PEERDNS=auto#optional-INTERNAL_SUBNET=10.13....
PrivateKey = <private key of the server> Address = 192.168.66.1/32 ListenPort = 8999 Configuring the Linux, macOS, or Windows WireGuard clientLink to this anchor Install WireGuard. On Linux, you can install WireGuard the same way you did for the server. To install WireGuard on macOS just ...
均使用Linux系统(经测试不适用于windows系统) 实战步骤 安装wireguard 首先我们要在两台机器间建立一个虚拟局域网(除了wireguard,zerotier之类的软件也是可以的),先在本地与远程两台机器上安装wireguard,并生成公钥和私钥。 # 安装wireguard apt install wireguard ...