Hello,
I am trying to setup a wireguard client on a Almalinux 10 KDE v2.
The wireguard configuration is contained in a file named wg0.conf with the following format:
[Interface]
PrivateKey = <private key>
Address = 10.0.1.5
DNS = 192.168.1.1
[Peer]
PublicKey = <public key>
AllowedIPs = 0.0.0.0/0
Endpoint = <ddns name>:51820
PersistentKeepalive = 25
First, I have installed the wireguard-tools package.
sudo dnf install wireguard-tools
then I copied wg0.conf into /etc/wireguard/
sudo cp wg0.conf /etc/wireguard/
then I started wireguad client using:
sudo wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.0.1.5 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
Failed to set DNS configuration: Could not activate remote peer 'org.freedesktop.resolve1': activation request failed: unknown unit
[#] ip link delete dev wg0
to fix the DNS issue, I have started systemd-resolved
sudo systemctl enable --now systemd-resolved
then the wireguard client started correctly
sudo wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.0.1.5 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
[#] 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
[#] nft -f /dev/fd/63
and browsng the Internet was fine.
But when instead of using wg-quick, I am importing the configuration into NetworkManager via cli
nmcli connection import type wireguard file wg0.conf
A message indicating the connection is successful but it is not possible to browse the Internet.
I have tried the same config via KDE on other distribution and it is working fine.
What is the problem here? How can I configure wireguard via KDE on Almalinux?
Thanks