Score:0

Issues setting up wireguard on an Ubuntu 22 machine

io flag

It's the first time I'm trying to set up a wireguard server on a Ubuntu 22 machine and I don't understand what exactly am I doing wrong. I'm using https://github.com/angristan/wireguard-install as an installer for wg, specifying my IP address during the installation and leaving everything as is. It should automatically port-forward and it seems to do it. Here's the wg0.conf file that got generated (I changed AllowedIPs to no avail):

[Interface]
Address = 10.66.66.1/24,fd42:42:42::1/64
ListenPort = 50881
PrivateKey = [redacted]
PostUp = iptables -I INPUT -p udp --dport 50881 -j ACCEPT
PostUp = iptables -I FORWARD -i eth0 -o wg0 -j ACCEPT
PostUp = iptables -I FORWARD -i wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostUp = ip6tables -I FORWARD -i wg0 -j ACCEPT
PostUp = ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D INPUT -p udp --dport 50881 -j ACCEPT
PostDown = iptables -D FORWARD -i eth0 -o wg0 -j ACCEPT
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
PostDown = ip6tables -D FORWARD -i wg0 -j ACCEPT
PostDown = ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

### Client portal
[Peer]
PublicKey = [redacted]
PresharedKey = [redacted]
AllowedIPs = 0.0.0.0/0, ::/0

And here is a client file I'm trying to use to connect:

[Interface]
PrivateKey = [redacted]
Address = 10.66.66.2/32,fd42:42:42::2/128
DNS = 1.1.1.1,1.0.0.1

[Peer]
PublicKey = [redacted]
PresharedKey = [redacted]
Endpoint = [ip of my server]:50881
AllowedIPs = 0.0.0.0/0,::/0

For some reason, the handshake just can't be established. And I just noticed that the second I complete the wireguard installation on server, something immediately happens to my connection, causing every ping to result in Temporary failure in name resolution. I'm nowhere nearly as experienced in linux so I would really appreciate somebody pointing to what exactly am I doing wrong here.

guiverc avatar
cn flag
Are you sure you're using Ubuntu Core 22 Server? It's a different product to Ubuntu 22.04 LTS Server (22 being the *smaller* version of 22.04 intended for cloud/IoT usage, with some parts of it differing)
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.