We configured the OpenVPN with pfSense in our last blog post, and I also showed you how you could connect your Windows 10 machine to the pfSense OpenVPN network. Everything worked fine, and now, we will access the OpenVPN via the internet on an IOS device. I am using an iPad for this testing, and the steps mentioned here are identical to the iPhone as well.
Usually, we connect VPN to hide/mask your public IP with a different one to browse the internet securely. I have already configured OpenVPN on my pfSense firewall at my home. I can connect to my home network using the OpenVPN client on my iPad.
Once I connected to the OpenVPN from my iOS device, I should have access to RDP machines and ping all the internal hosts at my home via the internet.
One use case is that you can access your home network from anywhere globally through the internet using OpenVPN. With which you can access your home network files, and access enabled services securely over OpenVPN.
1. Import the OpenVPN configuration to the client.
From your pfSense firewall, you will have to download the configuration file and transfer it to the IPad. Follow the steps below to download the file.
Click on VPN>OpenVPN>Client Export.
Scroll down and click on OpenVPN Connect(iOS/Android.) It will download the OpenVPN file on your machine.
You can share the file with the iPad/iPhone in multiple ways.
If you connected to your local network, maybe you can access the firewall GUI and download it directly to your ios device.
If your device is remotely available, download the file and use any cloud storage sharing app or email to transfer the file to the machine.
Once the file is transferred, you may save it on your ios device-specific folder, as we require to import the configuration later on.
2. Download the OpenVPN client on iOS Device.
Next, we have to download and install the OpenVPN client on your ios device.
Goto Appstore and search for OpenVPN.
And click on install
After it is installed, click on Open.
You may accept the license agreement, and once you are in, you may exit out of the OpenVPN for now.
3. Import the ovpn file to the IPad.
Goto the configuration file that you have downloaded in your file manager.
As you can see, I have the OpenVPN file in my file manager. Just tap on it and hold for a second for the menu to pop up.
Click on the share option from the menu.
In the share option, choose OpenVPN from the list.
You will see the file added under the file section in the OpenVPN client. You may click on Add.
You will be asked to enter the profile name and username enter them on the field.
Also have an option to save the password, For that check the option that says Save password. A password prompt will pop up, enter the password and click on Add on the top right corner.
After you filled the details, you may click on Add on the top right corner, and You will get a prompt asking “OpenVPN Would Like to Add VPN configurations” you may click on Allow.
After you click on Allow, you will be prompted to authenticate your device. After that, the configuration will be added to the device and shows the VPN is disconnected.
3. Connect the Open VPN.
We are now going to connect to OpenVPN over the internet. To make the test more accurate or simulate the real internet connectivity. I am currently outside my house and connected to my mobile hotspot. I got a different public IP as compared to my home firewall public IP.
As you can see, I have my public IP starting with 27.x.x.x, great.
Alright, let’s go ahead and connect. If everything goes well, I should have access the RDP machine, which I have inside my home network
You may click on the toggle button to connect to the VPN. You will be prompted saying Allow OpenVPN to enable VPN connection?
Click on Yes
After few seconds, the VPN will be connected. You can see the status on the top left that says it is connected in green color. You can also see the traffic in a real-time graph and some helpful information about the network you have connected to.
We have successfully connected to the OpenVPN over the internet.
4. Test the VPN connectivity.
First, let me verify if I can reach the internal IP address 10.1.1.1. As you can see, using the ping utility on my iPad, I can reach the internal network just fine. The latency is over 100ms which is expected.
Verify the network using RDP access.
Open the RDP application and try to access the RDP machine which 10.1.1.61.
After few seconds you will be able to access the Remote desktop machine, and you can see it’s IP address is 103.x.x.x that’s my home public IP and the private IP address on the command prompt is 10.1.1.61 and you can also notice the jump in traffic in openvpn as you as I started the RDP access.