3

We are looking for configure VPN programatically using Protocol- L2TP/IPsec android open source code.

I have tried the https://android.googlesource.com/platform/development/+/master/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnClient.java

Here it's configuring the user profile info

Intent intent = new Intent(this, ToyVpnService.class)
.putExtra(prefix + ".ADDRESS", mServerAddress.getText().toString())
.putExtra(prefix + ".PORT", mServerPort.getText().toString())
.putExtra(prefix + ".SECRET", mSharedSecret.getText().toString());
startService(intent);

I want to manage the NAME, TYPE, SERVER ADDRESS, IPSEC Pre-shared Key for server VPN setup after that connection with shared USERID and Password.

user909026
  • 41
  • 1
  • 3

1 Answers1

0

I didn't find the way to use configurations with ToyVpn. My solution is strongSwan open source vpn client

Stanislav Bondar
  • 6,056
  • 2
  • 34
  • 46
  • Thank you very much, let me try strongSwan from Google Play store APK. Is this working with my specification configuration or not – user909026 Mar 06 '17 at 18:47
  • I have tried with installing this apk - https://play.google.com/store/apps/details?id=org.strongswan.android but that's not working for me. When direct i am doing the configuration settings on Mobile settings then working fine but not working with StrongSwan input with my own profile. – user909026 Mar 06 '17 at 18:56
  • I am compiling the source code using NDK, I will update you soon. – user909026 Mar 06 '17 at 19:18
  • No, strongSwan does not implement L2TP. I have cross checked the things any another open source code for strongSwan – user909026 Mar 09 '17 at 09:55
  • I have below info Server-X.X.X.X Protocol- L2TP/IPsec PSK- 123456 PORT- L2TP -udp 1701 After connecting, this are the dialer credentials- username- XXXX password- XXXX please let me know how can i connect this via android code – user909026 Mar 09 '17 at 12:20
  • You can look at {https://github.com/vmlinz/strongswan-android} project. Connection starts from profile and vpn type creation. See `VpnProfile.java` and `VpnType.java` – Stanislav Bondar Mar 09 '17 at 14:34
  • @user909026 I hope u do well, and I want to know did u made to create a Lt2p VPN in android programmatically if yes please answer since I need so urgent. –  Nov 05 '17 at 06:13
  • @kh_4 Did you find any code for L2TP, were you able to implement it? – Micer Feb 03 '18 at 07:53
  • @Micer did you find a solution? – Roman Soviak Sep 26 '18 at 16:09
  • @user7856586 No sorry, I tried to use Strongswan, but it's quite complex. – Micer Nov 03 '18 at 21:57
  • @Micer thx we made it by using c libs from [open vpn](https://github.com/schwabe/ics-openvpn) – Roman Soviak Nov 05 '18 at 13:01
  • @StanislavBondar this library is working fine for you? – Jad Chahine Jul 25 '19 at 20:03