В общем, суть такая, взял себе vps и решил поставить на него wireguard. По гайдам все вроде настроил, подключаюсь через клиент в windows, показывает, что все подключено, но вот ip не меняется, то есть по сути подключения нет. Система на сервере centos8, net.ipv4.ip_forward = 1
Файл wg0.conf:
[Interface]
PrivateKey = "Private key"
Address = 10.0.0.1/24
ListenPort = 51830
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = "Public key"
AllowedIPs = 10.0.0.2/32
Файл конфигурации в клиенте:
[Interface]
PrivateKey = "Private key"
Address = 10.0.0.2/32
DNS = 8.8.8.8
[Peer]
PublicKey = "Public key"
AllowedIPs = 0.0.0.0/32
Endpoint = 5.45.64.79:51830
PersistentKeepalive = 20
systemctl status wg-quick@wg0.service:
Loaded: loaded (/usr/lib/systemd/system/wg-quick@.service; enabled; vendor preset: disabled)
Active: active (exited) since Wed 2022-11-23 11:19:21 UTC; 6h ago
Docs: man:wg-quick(8)
man:wg(8)
https://www.wireguard.com/
https://www.wireguard.com/quickstart/
https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
Process: 984 ExecStop=/usr/bin/wg-quick down wg0 (code=exited, status=0/SUCCESS)
Process: 1010 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=0/SUCCESS)
Main PID: 1010 (code=exited, status=0/SUCCESS)
Nov 23 11:19:21 server.domain.com systemd[1]: wg-quick@wg0.service: Succeeded.
Nov 23 11:19:21 server.domain.com systemd[1]: Stopped WireGuard via wg-quick(8) for wg0.
Nov 23 11:19:21 server.domain.com systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Nov 23 11:19:21 server.domain.com wg-quick[1010]: [#] ip link add wg0 type wireguard
Nov 23 11:19:21 server.domain.com wg-quick[1010]: [#] wg setconf wg0 /dev/fd/63
Nov 23 11:19:21 server.domain.com wg-quick[1010]: [#] ip -4 address add 10.0.0.1/24 dev wg0
Nov 23 11:19:21 server.domain.com wg-quick[1010]: [#] ip link set mtu 1420 up dev wg0
Nov 23 11:19:21 server.domain.com wg-quick[1010]: [#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Nov 23 11:19:21 server.domain.com systemd[1]: Started WireGuard via wg-quick(8) for wg0.