Score:0

Wireguard is not working: 'wg0' is not a WireGuard interface

hu flag

I've got an issue with wireguard. I have a debian-based VPS, and a Manjaro client. Here is my /etc/wireguard/wg0.conf of a server:

[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

Here is my /etc/wireguard/wg0.conf of a client:

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

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

Here is my ufw status output:

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)

Here is my lsmod | grep wireguard output:

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

After wg-quick up wg0 and wg-quick down wg0 on a server I've got this error:
wg-quick: `wg0' is not a WireGuard interface
I'm sure, the mistake was on my side. But where was I mistaken?

Laughing Laugh wwwwwww avatar
hu flag
I solved this issue by changing port to default wireguard one (194 was already used) and by changing interface form `eth0` to `ens3`
Score:1
de flag

Sadly, I do not have enough reputation to comment yet. Have you tried a different port for Wireguard on your server? Typically, ports within the lower range from 0 to 1023 are used by the linux OS, although I do not know if 194 is used for something specific already. But you could try one in the upper ranges like 51820 which is already open in your firewall, or if you use that already try 51819 and don't forget to open it in your firewall.

Laughing Laugh wwwwwww avatar
hu flag
Thank you for your comment! Yeah, I solved this issue by changing port to default one and by changing an interface from eth0 to ens3
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.