WireGuard has become the go-to VPN protocol for its simplicity, speed, and strong encryption. One of its most convenient features is the ability to configure WireGuard clients on Android and iOS devices using a built-in QR code scanner. This eliminates the hassle of manually entering long configuration strings and public keys.
However, users of MikroTik routers face a common challenge: MikroTik does not provide built-in tools to generate QR codes. While Linux servers have tools like qrencode
, copying and pasting public keys between MikroTik and mobile devices can be frustrating and error-prone. Fortunately, there is an easy way to simplify this process using WireGuardConfig.com.
In this guide, we will show you step-by-step how to generate WireGuard configurations and QR codes to seamlessly set up your Android and iOS clients.
Why Use QR Codes for WireGuard Configuration?
Manually entering WireGuard configuration parameters, such as private keys, public keys, and endpoints, can be time-consuming. QR codes provide a simple solution:
- Faster Setup: Scan a QR code to configure the client instantly.
- Error-Free: Avoid mistakes caused by manual input.
- Convenient: Perfect for mobile devices with limited screen space.
Step 1: Generate WireGuard Configuration Using WireGuardConfig.com
If you don’t have a Linux system to generate WireGuard configurations and keys, you can use WireGuardConfig.com, a free and user-friendly online tool.
Follow these steps to generate the configuration:
- Go to WireGuardConfig.com.
- Fill in the required details:
- Listen Port: Enter the port your WireGuard server will use (e.g., 51820).
- Client CIDR: Assign an IP address for the client (e.g., 10.0.0.2/32).
- Allowed IPs: Specify the traffic allowed through the tunnel (e.g., 0.0.0.0/0 for all traffic).
- Endpoint (Optional): Add the server’s public IP address and port.
- DNS (Optional): Specify the DNS server to use for the client (e.g., 8.8.8.8).
- Click Generate to create the configuration.
- The tool will generate the following:
- Client Private Key and Public Key.
- Configuration File for the WireGuard client.
- Save the client public key. You will need this when configuring the WireGuard peer on your MikroTik router.
Step 2: Configure the WireGuard Peer on MikroTik
Once you have the client’s public key:
- Log in to your MikroTik router.
- Go to WireGuard settings in the MikroTik web interface or command line.
- Add a new peer for the client:
- Paste the Client Public Key.
- Assign the Allowed IPs for the client (e.g., 10.0.0.2/32).
- Save the peer configuration.
Your MikroTik server is now ready to accept connections from the WireGuard client.
Step 3: Generate a QR Code for the WireGuard Client
Once the client configuration is ready, you need to generate a QR code to simplify the setup on Android and iOS devices.
Follow these steps to create the QR code:
- Go to WireGuardConfig.com QR Code Generator.
- Copy the WireGuard client configuration generated earlier.
- Paste the configuration into the text box.
- Review the settings and make any necessary changes.
- Click Generate QR Code.
- Save or screenshot the QR code for later use.
Note :- Here you have to confirm all setting are ok to configure a client and paste here mikrotik wireguard server public key under [Peer ] section
Step 4: Configure WireGuard Client on Android and iOS
Now that you have the QR code, configuring your WireGuard client on Android or iOS is incredibly easy.
On Android
- Install the WireGuard app from the Google Play Store.
- Open the app and tap the + button to add a new tunnel.
- Select “Scan from QR Code”.
- Use your phone’s camera to scan the QR code.
- Save the tunnel and activate it.
On iOS
- Install the WireGuard app from the Apple App Store.
- Open the app and tap Add Tunnel.
- Select “Create from QR Code”.
- Scan the QR code using your phone’s camera.
- Save and activate the tunnel.
Step 5: Verify the WireGuard Connection
To ensure everything is working correctly:
- Activate the WireGuard tunnel on your mobile device.
- Check your IP address using a tool like WhatIsMyIP.
- Verify that you can access the network resources configured through the WireGuard VPN.
If you encounter issues, double-check the WireGuard peer configuration on your MikroTik router and ensure the public and private keys are correct.
Conclusion
Configuring WireGuard clients on Android and iOS devices using QR codes makes the process fast, efficient, and error-free. While MikroTik routers lack built-in tools for QR code generation, you can use WireGuardConfig.com to easily generate configurations and QR codes.
By following the steps outlined in this guide, you can save time and simplify the setup process for WireGuard VPN clients on mobile devices. Try it today and experience hassle-free WireGuard configuration!