Implementing VPN with L2TP protocol in iOS app

IosSwiftVpnNetworkextensionL2tp

Ios Problem Overview


In iOS settings, there are options to create a VPN configuration using IPSec, IKEv2, and L2TP. Using the NetworkExtension framework from Apple there's an option to create VPN using IPSec and IKEv2 protocols only. They do work but problem is that I need to create a connection via L2TP since that's only supported by the company's firewall.

There's a question https://stackoverflow.com/questions/26257872/ios-app-with-custom-vpn-connect from 2014 and it's answered with:

> If you want to connect programmatically in ios 8 you can use only IPSec or IKEv2 protocols. L2TP and PPTP protocols are private for apple. It is not possible to use L2TP and PPTP APIs in your applications. Only Apple is currently using these APIs.

Is there any way to create a L2TP VPN connection from an iOS application (Swift)?

Ios Solutions


Solution 1 - Ios

You can make use of every proxy app available on Android playstore. Basically youre iOS device will make use of the hostpot from android phone. Remember youre android phone must be connected to L2TP VPN. Every proxy will put all the connection of VPN shared to iOS device.

iOS device in settings we need to add ip and port. You will now be connected to VPN on iOS.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNajdan TomićView Question on Stackoverflow
Solution 1 - IosHrushikesh SawantView Answer on Stackoverflow