Wireguard no funciona: 'wg0' no es una interfaz WireGuard

Wireguard no funciona: 'wg0' no es una interfaz WireGuard

Tengo un problema con Wireguard. Tengo un VPS basado en Debian y un cliente Manjaro. Aquí está mi /etc/wireguard/wg0.confde un servidor:

[Interface]
Address = 10.0.0.1/24
ListenPort = 194
PrivateKey = <ServerPrivateKey>
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = <ClientPublicKey>
AllowedIPs = 10.0.0.2/32

Aquí está mi /etc/wireguard/wg0.confde un cliente:

[Interface]
Address = 10.0.0.2/32
PrivateKey = <ClientPrivateKey>

[Peer]
PublicKey = <ServerPublicKey>
Endpoint = <ServerIP>:194
AllowedIPs = 0.0.0.0/0, ::/0

Aquí está mi ufw statussalida:

Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
443                        ALLOW       Anywhere                  
80                         ALLOW       Anywhere                  
143                        ALLOW       Anywhere                  
993                        ALLOW       Anywhere                  
51820                      ALLOW       Anywhere                  
IMAPS                      ALLOW       Anywhere                  
POP3                       ALLOW       Anywhere                  
SMTP                       ALLOW       Anywhere                  
194                        ALLOW       Anywhere                  
22 (v6)                    ALLOW       Anywhere (v6)             
443 (v6)                   ALLOW       Anywhere (v6)             
80 (v6)                    ALLOW       Anywhere (v6)             
143 (v6)                   ALLOW       Anywhere (v6)             
993 (v6)                   ALLOW       Anywhere (v6)             
51820 (v6)                 ALLOW       Anywhere (v6)             
IMAPS (v6)                 ALLOW       Anywhere (v6)             
POP3 (v6)                  ALLOW       Anywhere (v6)             
SMTP (v6)                  ALLOW       Anywhere (v6)             
194 (v6)                   ALLOW       Anywhere (v6)

Aquí está mi lsmod | grep wireguardsalida:

wireguard              94208  0
curve25519_x86_64      36864  1 wireguard
libchacha20poly1305    16384  1 wireguard
ip6_udp_tunnel         16384  1 wireguard
udp_tunnel             20480  1 wireguard
libcurve25519_generic    49152  2 curve25519_x86_64,wireguard

Después wg-quick up wg0y wg-quick down wg0en un servidor me sale este error:
wg-quick: `wg0' is not a WireGuard interface
estoy seguro, el error estuvo de mi lado. ¿Pero en qué me equivoqué?

Respuesta1

Lamentablemente, todavía no tengo suficiente reputación para comentar. ¿Has probado un puerto diferente para Wireguard en tu servidor? Normalmente, el sistema operativo Linux utiliza los puertos dentro del rango inferior de 0 a 1023, aunque no sé si el 194 ya se utiliza para algo específico. Pero puedes probar uno en los rangos superiores como 51820 que ya está abierto en tu firewall, o si ya lo usas, prueba 51819 y no olvides abrirlo en tu firewall.

información relacionada