At least with the official Wireguard app it works, if your desktop also has a Wireguard client and uses a static IP address in your home network.
Wireguard isn't that easily set up as a partial mesh network, given proper implementation, you can simply add your desktop's Wireguard client as another peer.
For that you use the other device's Address
from the [Interface]
section as the AllowedIPs
of (another) [Peer]
section on both devices and add the PublicKey
of the corresponding, other device for the peer.
You'll also need to add the desktop's static IP address as the Endpoint
in the phone's peer configuration, adding the ListenPort
with a colon as a suffix behind it.
The following example configurations should help explain this.
Example phone config file (note: keep and use your already existing, own keys and Address
, these are stand-ins and do not delete any existing [Peer]
section, add another one):
[Interface]
PrivateKey = UPye7pnHrF4+brW2ET4FpaUfMBKRasu3K0p75rsY+1k=
Address = 10.68.20.56/32
[Peer]
<Here should be your already existing Peer's configuration, don't touch it!>
[Peer]
PublicKey = d9sWyYweYKc3GjsJrCtNL68BOpvfHtRQzARuIJslKAo=
AllowedIPs = 10.68.10.24/32
Endpoint = 192.168.16.55:58245
- If you're using the official wireguard app, press on the tunnel's name, press the pencil symbol and press on "Add peer" at the bottom of that last menu.
Computer config (same note and keep any existing [Peer]
sections):
[Interface]
PrivateKey = yNKQGcx85TUFBN54QpzeNqM4sb8mHP8lRqfGx5cqb0U=
Address = 10.68.10.24/32
ListenPort = 58245
[Peer]
PublicKey = Skwxab/0I2CqNSBeTO1j0BUgQKs2SePqpXdibaUUqRY=
AllowedIPs = 10.68.20.56/32
Depending on how you've set Wireguard up on your computer, it could be a bit more complicated to add a peer.
You can probably just edit it in the Network Manager, if you've not chosen another option to set up Wireguard, and add a peer with the necessary information.
You'll likely need to set a ListenPort
yourself. You can use the one from the example or just any other between 32768-65535
. Lower ones would work too.
If necessary, you can find out the current information for the PublicKey
field aswell as the ListenPort
field by using the console command sudo wg show
- the latter one might change, if you've not set one yourself.
After all of that is done, you can simply open up KDE Connect on your phone and pair the device through the 3-dots menu on the top right, using the option Add devices by IP
and adding the Address
of your desktops configuration, without the /32
suffix.
If you don't have an already existing Wireguard configuration on your desktop, you can likely just open the Network Manager and add a "Wireguard VPN". It should also give you a proper setup-wizard, check the example or ask if you need help - or use Windows.