问题
I am experimenting with the new VPNService API with the sample project "ToyVPN". I have not modified the source code and it compiles smoothly, but I cannot seem to get it to connect to my VPN server on ec2. It times out with the error "Got java.lang.IllegalStateException: Timed out". From the server's perspective, no packets are being received from the phone. I am entering in the ip address of the server, 1723, and my password for server address, server port, and shared secret respectively.
I am able to connect to my vpn server using the default ubuntu vpn manager over pap authentication using the same password.
Can someone offer insights on what is going on and how I can make ToyVPN connect to my server?
回答1:
What about sample server implementation from "ToyVPN" project? Why don't you use it? It is easy to set in Linux, all steps and limitations are described in ToyVpnServer.cpp file. Certainly at first you should compile it. I compile it using GCC package:
gcc ToyVpnServer.cpp
Program file named "a.out" will be created in the same directory. Then just run it from command line with the parameters that described in ToyVpnServer.cpp.
It is strange, that you don't see any packets on the your VPN server side. I tried to connect to my VPN server through ToyVpn just to see what will happen. Connection was failed, but there were messages in server logs, that the packets are received, but its size is too small.
Hope this will help.
来源:https://stackoverflow.com/questions/11424022/toyvpn-unable-to-connect-to-vpn-server