使用Protocol-L2TP / IPsec android开源代码以编程方式配置VPN。

时间:2017-03-06 15:46:54

标签: android vpn ipsec l2tp

我们正在寻找使用Protocol-L2TP / IPsec android开源代码以编程方式配置VPN。

我试过了https://android.googlesource.com/platform/development/+/master/samples/ToyVpn/src/com/example/android/toyvpn/ToyVpnClient.java

这是配置用户个人资料信息

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

我希望在与共享的USERID和密码连接后管理服务器VPN设置的NAME,TYPE,SERVER ADDRESS,IPSEC预共享密钥。

1 个答案:

答案 0 :(得分:0)

我没有找到使用ToyVpn配置的方法。我的解决方案是strongSwan开源vpn客户端