通过 PHP 或其他服务器端脚本进行 VPN 连接?
好吧,首先我要说的是,我只通过 Windows 通过控制面板设置连接来处理 VPN 访问。这非常简单,因为一切几乎都是点击式设置。
我现在正在做一个项目,我需要访问专用网络上的计算机云(没有直接到云的公共IP,因此只能在网络上时才能访问)。我的项目涉及一个需要“以某种方式”访问该云的网站。由于我缺乏通过命令行使用 VPN 以及如何以编程方式连接到 VPN 的经验/知识,我遇到了一个轻微的障碍,我希望这里有人可以帮助我。
我需要编写什么样的服务器端脚本才能建立并运行 VPN 连接?该网站托管在一台 Linux 机器上。他们是 Linux 下的“默认”VPN 实用程序吗?我可以通过 PHP 调用它来建立连接吗?如果没有,我真的很感激任何关于如何避免我的这个小问题的建议。仅供参考,VPN 使用 PPTP。
Ok, let me first start off by saying that I've only ever dealt with VPN access through windows by setting up a connection through the control panel. It's pretty simple since everything is pretty much a point-and-click setup.
I'm now working on a project where I need to access a computer cloud on a private network (there is no public IP directly to the cloud so it can only be accessed when I'm on the network). My project involves a website that needs to access that cloud "somehow". Because of my lack of experience/knowledge with VPN's through the command line and how to programmatically connect to a VPN, I've hit a mild obstacle that I'm hoping someone here can help me with.
What kind of server side scripting would I do to get a VPN connection up and running? The website is being hosted on a linux machine. Is their a "default" VPN utility under linux that I can call through PHP to establish a connection? If not, I would really appreciate any and all suggestions on how to circumvent this little problem of mine. FYI the VPN uses PPTP.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来从 shell 而不是 GUI 进行设置需要一些时间,但这里有一些参考资料,希望能对您有所帮助。
如果您设置连接并连接它,当您的 PHP 脚本尝试与连接远程端的 IP 地址进行通信时,它将通过 PPTP 连接。让连接始终打开可能比 PHP 脚本每次需要执行某些操作时都进行连接要好。
http://ubuntuforums.org/showthread.php?t=1443735 - 一个简单的 PPTP客户端设置
http://pptpclient.sourceforge.net/ - 您可以安装和配置的客户端
http://www.cyberciti.biz/tips /howto-configure-ubuntu-fedora-linux-pptp-client.html - 使用 Linux PPTP 网络管理器设置 PPTP 的演练
希望这些会对您有所帮助。第一个看起来可能值得先尝试。
Looks like there is a little bit to getting it set up from a shell rather than the GUI, but here are some references that will hopefully help you out.
If you set up the connection and connect it, when your PHP script attempts to communicate with an IP address on the remote side of the connection, it will go through the PPTP connection. Having the connection always open is probably better than having to your PHP script connect every time it needs to do something.
http://ubuntuforums.org/showthread.php?t=1443735 - An easy PPTP client setup
http://pptpclient.sourceforge.net/ - Client you can install and configure
http://www.cyberciti.biz/tips/howto-configure-ubuntu-fedora-linux-pptp-client.html - Walk through of setting up PPTP using the linux PPTP network manager
Hopefully those will help you out a bit. The first one looks like it may be worth trying first.