Sparklab's Viscosity and iOS



I have an ASUS router running the FreshTomato.org firmware. I also use Sparklab's Viscosity OpenVPN software on my computers along with their OpenVPN Configuration Generator for each client:
https://www.sparklabs.com/blog/openvpn-configuration-generator/

The OpenVPN Server in FreshTomato on the ASUS router is configured to accept incoming connections. (I can't remember where I got those instructions from. I do remember that that hardest part was setting "Compression" to Disabled on the Basic tab AND THEN setting Viscosity's "Extra OpenVPN configuration commands" on the Advanced tab of every client "cipher AES-256-CBC". Anyway...)

All this is working great with computers connecting to my ASUS router! But now, I want my iPhone to connect to the ASUS router via OpenVPN. That's not been so easy so here is how I got it work.

1. Grab this generic .ovpn file and copy into an editor:

client
dev tun
remote-cert-tls server
cipher AES-256-CBC
pull
nobind
reneg-sec 0
resolv-retry infinite
verb 3
persist-key
persist-tun
remote-random
remote <your.vpn.domain.here> 1194
proto udp
mute-replay-warnings
replay-window 256
auth-user-pass
key-direction 1
data-ciphers AES-256-CBC

<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>

<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>

<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>

2. Change <your.vpn.domain.here> with you actual vpn domain name.
3. Place your server's ca.crt between <ca> and </ca>.
4. Place your end user's .crt between <cert> and </cert>.
5. Place your end user's .key between <key> and </key>.
6. Optionally add "redirect-gateway def1 ipv6" anywhere in the .ovpn file if you want all traffic to go over the VPN tunnel.
7. Save the .ovpn file, but don't put any spaces nor periods (.) in the name! (I lost an hour on that one.)
8. On your iOS device, download and install the free OpenVPN Connect app.
9. Copy your .ovpn file to your iOS device into the OpenVPN application. I understand you can also email the file to your iOS device but that did not work for me.
10. Open the OpenVPN app and you should be presented with your .ovpn file to install. (If not, go back and CHANGE THE NAME to something more simple.)
11. Give your .ovpn file a profile name.
12. Save the profile and accept in the addition of the OpenVPN profile into your device's VPN Settings.
13. You will now be presented with a user name and password. Don't worry about that. Just quit the app.
14. Open Setting --> VPN
15. You should see a VPN configuration with your OpenVPN profile name.
16. Select your OpenVPN profile and click the Status slider.

If all your certificates are configured correctly, you should get an OpenVPN connection to your FreshTomato router!