Сервер
[Interface]
Address = 10.9.0.1/24
PrivateKey =
ListenPort = 51820
[Peer]
PublicKey =
AllowedIPs = 10.9.0.2/32
Клиент
[Interface]
PrivateKey =
Address = 10.9.0.2/24
[Peer]
PublicKey =
AllowedIPs = 0.0.0.0/0
Endpoint = 192.168.19.97:51820
PersistentKeepalive = 25
Сервер
sudo wg-quick up /etc/wireguard/wg0.conf
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.9.0.1/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
Клиент
tester@tester:~$ sudo wg-quick up /etc/wireguard/wg0.conf
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.9.0.2/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
[#] iptables-restore -n
Handshake установился, поскольку на сервере
sudo wg
interface: wg0
public key:
private key: (hidden)
listening port: 51820
peer:
endpoint: 192.168.19.98:35280
allowed ips: 10.9.0.2/32
latest handshake: 1 minute, 24 seconds ago
transfer: 180 B received, 92 B sent
На клиенте
sudo wg
interface: wg0
public key:
private key: (hidden)
listening port: 35280
fwmark: 0xca6c
peer:
endpoint: 192.168.19.97:51820
allowed ips: 0.0.0.0/0
latest handshake: 2 minutes, 41 seconds ago
transfer: 92 B received, 8.05 KiB sent
persistent keepalive: every 25 seconds
Маршруты
Сервер
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.19.254 0.0.0.0 UG 100 0 0 ens33
10.9.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wg0
192.168.19.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
192.168.19.254 0.0.0.0 255.255.255.255 UH 100 0 0 ens33
Клиент
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.19.254 0.0.0.0 UG 100 0 0 enp0s3
10.9.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wg0
192.168.19.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3
192.168.19.254 0.0.0.0 255.255.255.255 UH 100 0 0 enp0s3
Пинг просто зависает
ping 10.9.0.1
PING 10.9.0.1 (10.9.0.1) 56(84) bytes of data.
IP сервера 192.168.19.97 (Wireguard 10.9.0.1)
IP клиента 192.168.19.98 ( Wireguard 10.9.0.2)
Подскажите в чем проблема?