简体   繁体   中英

Implementing VPN with L2TP protocol in iOS app

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 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)?

Have done some research in by creating my own logic for L2TP VPN connection on iOS application but suddenly got some error in connection. I am adding the reference for this may it will help you out https://attariclasses.in/ccna-training-certification-online/

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.

You can try hosting an l2tp server on your mac and connect another device remotely to the server using the settings->network->vpn->l2tp and provide the settings. I haven't tried it personally. On the iPhone General->VPN Management->L2tp can be used.

这家公司是否有可能有某种内部框架或包,您可以在您的应用程序中使用他们的 VPN 身份验证?

The Personal VPN feature that allows using built-in protocols doesn't support unencrypted protocols, presumably for security reasons:

Personal VPN only supports recommended VPN protocols; it doesn't support legacy VPN protocols, like PPTP and L2TP.

However, that's not the only way to implement a VPN app. You can also create a Packet Tunnel Provider to tunnel layer 3 packets yourself, or an App Proxy Provider for TCP and UDP connections. A packet tunnel provider would allow using your own L2TP implementation.

This might be solving the wrong problem, though. If this is for a specific company, why not use MDM instead of a custom app? MDM does support L2TP .

It is not possible to create a L2TP VPN connection from an iOS application. Only Apple is currently using the L2TP and PPTP APIs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM