一、基础环境
服务端IP:11.11.11.11 客户端IP:22.22.22.22
01234567891011 $ uname -aLinux VM-4-3-debian 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux$ cat /etc/os-releasePRETTY_NAME="Debian GNU/Linux 12 (bookworm)"NAME="Debian GNU/Linux"VERSION_ID="12"VERSION="12 (bookworm)"VERSION_CODENAME=bookwormID=debianHOME_URL="https://www.debian.org/"SUPPORT_URL="https://www.debian.org/support"BUG_REPORT_URL="https://bugs.debian.org/"二、基本配置
文 章 源 自 note.t4x.orgByrd's Blog-https://note.t4x.org/basic/safe-wireguard-config/
01 $ wget -O wireguard.sh https://get.vpnsetup.net/wg$ apt-get -yqq install wireguard qrencode resolvconf
三、常规配置
Login
针对Stunnel版本中/usr/local/bin/udp2raw_amd64 -c -l 127.0.0.1:51830 -r 127.0.0.1:8443 --raw-mode faketcp -a -k "YourSecretPassword"存在数据丢包的情况做了部分修复.增加了--retry-on-error[出错重试]、--keep-rule[保持规则]、--seq-mode[每个数据包增加序列号]、--seq-mode[尝试修复由 GRO 导致的巨大数据包问题]解决了ping丢包的问题。基本启动顺序应该是wireguard、 udp2raw、stunnel.
参考URL:
# 用于计算AllowedIPs,排除IP
1:https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
