In my blog post here I showed you how to setup and configure WireGuard VPN Server side. I that blog post I also tell you what WireGuard is and what the benefits are. Everything in this blog post continues based on the configuration in my previous blog and in this blog post I will show you how to setup WireGuard client on iPhone.
Requirement for this blog: Setup WireGuard VPN server by me.
First we need to download WireGuard for iOS from the Apple App Store. You can do that on your iPhone or click on the link here which will take you directly to the WireGuard app in the App Store.
For your iPhone visit the App Store and search and download WireGuard:
Adding the configuration to the iPhone app is a lot less steps compared to the Windows client. We will generate a QR code on the WireGuard server (the DietPi) and simply scan that QR code on the iPhone WireGuard app.
To do that connect to your DietPi server using SSH and go to the /etc/wireguard directory. There you should have the configuration files for you server and your clients if you followed my blog post about setting up your own WireGuard VPN Server. Let check if everything is there with the ls -l command:
As you can see there I named my client configuration file iphone.conf. To generate the QR code typ the following command:
grep -v '^#' /etc/wireguard/iphone.conf | qrencode -t ansiutf8
A QR code will be generated in the terminal:
Before you do this you have to make sure that your iPhone is connected to the same network as the WireGuard VPN Server. Open the WireGuard app on your iPhone and tap Add a Tunnel and then select the Create from QR Code option:
Scan the QR code with the camera and give the tunnel a name:
Enter your iPhone pincode to add the tunnel:
The iPhone will now automatically add the VPN tunnel in the settings app and then switch to the WireGuard VPN app. There you will see the VPN tunnel:
That’s all for adding a WireGuard tunnel to your iPhone.
Hallo Vikash, dank je wel voor je visie over Wireguard. Ik heb Wireguard geïnstalleerd op een Raspberry Pi 4, die dient als server. ik heb een connectie kunnen leggen vanaf de iMac maar vanaf mijn iPhone lukt het niet! De iPhone verbindt wel (denk ik) maar de verbinding valt onmiddellijk weg. (alleszins de aanduiding VPN rechts boven op het scherm). Kan je me eventueel helpen of tips geven?
Hi Jef,
De wireguard client (ook in iPhone) zou je meer info kunnen geven waarom de verbinding verbreekt. Check daar in de log. Je zou als test ook de wireguard client config die je op de iMac gebruikt op je iPhone kunnen zetten en omgekeerd van de iPhone op je iMac. De client houdt connection logging bij. Succes!