2

I have a vpn account from a L2TP/IPSEC VPN Server and use four attributes to connect it from Android or Windows devices: IP Adress, User Name, User Password and PreShared Key. I can connect with these details successfully manually. I also want to connect it programmatically in Android 4.x.

I looked into OrbotVPN and ToyVPN projects but couldn't see any details about connecting to existing VPN server. And I think there must be some configuration(server side code) at the remote point (VPN server) to response requests from clients in these projects. But in default; a L2TP/IPSEC VPN server configured already and ready for connections.

Also googled it, all of them says "VpnService is designed for creating custom-protocol VPN applications" but there is no an example of IPSEC implementation.

Is there any example of IPSEC implementation?

Faruk KAHRAMAN
  • 69
  • 1
  • 2
  • 11
  • Android has IPSEC support built in, which is why you aren't going to find much in the way of sample implementations of reinventing that wheel. – CommonsWare Jul 31 '15 at 13:49
  • Yes it supports in user interface, but I want to connect to my VPN server in my application like other vpn clients (HotspotShield, DroidVPN etc.) – Faruk KAHRAMAN Aug 01 '15 at 14:38
  • I'm making an app similar to this. Have you ever figured out a way to do this? – Bk Razor Jan 05 '18 at 00:54
  • Guys, any solutions? – Roman Soviak Sep 26 '18 at 15:18
  • @CommonsWare is this still supported in Android? if not what is the alternative solution? – Jad Chahine Jul 09 '19 at 18:46
  • @JadChahine: Android has built-in VPN options, if that is what you are asking. AFAIK, IPSEC is still one of those options. – CommonsWare Jul 09 '19 at 18:58
  • @CommonsWare thanks for replying, I have to open a VPN L2TP connection and provide to it the secret, the username and password but this seems not supported anymore after Android 4.0? can you provide me some information please? – Jad Chahine Jul 09 '19 at 19:06
  • @JadChahine: I do not recall there being a programmatic API to create a VPN. At most, I would expect that to be something available to device owner apps. – CommonsWare Jul 09 '19 at 19:16
  • @CommonsWare so we are not able to create this connection programmatically? this is what I was looking for.. thanks – Jad Chahine Jul 09 '19 at 19:19
  • @CommonsWare can you check this please? https://stackoverflow.com/questions/56966665/how-to-extend-vpnservice-to-open-an-l2tp-ipsec-connection-in-android-programmati – Jad Chahine Jul 16 '19 at 19:31

0 Answers0