1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| 参考视频: https://www.youtube.com/watch?v=GZRTnP4lyuo 参考文章: https://www.the-digital-life.com/wireguard-docker/ docker官网: https://hub.docker.com/r/linuxserver/wireguard
apt install docker docker-compose sed -i 's/mouse=a/mouse-=a/g' /usr/share/vim/vim81/defaults.vim;
sudo mkdir /opt/wireguard-server
vim /opt/wireguard-server/docker-compose.yaml version: "2.1" services: wireguard: image: linuxserver/wireguard container_name: wireguard cap_add: - NET_ADMIN - SYS_MODULE environment: - PUID=1000 - PGID=1000 - TZ=Europe/London - SERVERURL=wireguard.domain.com - SERVERPORT=51820 - PEERS=1 - PEERDNS=auto - INTERNAL_SUBNET=10.13.13.0 volumes: - /opt/wireguard-server/config:/config - /lib/modules:/lib/modules ports: - 51820:51820/udp sysctls: - net.ipv4.conf.all.src_valid_mark=1 restart: unless-stopped
cd /opt/wireguard-server docker-compose up -d
cd /opt/wireguard-server/config/peer1 直接用peer1.conf的配置参数 导入到TunSafe 连接的时候提示地址错误. 这时需要修改客户端配置文件的配置参数Address 例如: Address = 10.13.13.2 改为 Address = 10.13.13.2/24
|