为了能在外网玩上内网的MC服,朱总和我在腾讯云的学生优惠服务器上部署了一个VPN,想通过让内网MC服务器和客户端同时登录一个外网VPN的方式,曲线实现MC服务器和客户端处在同一局域网。
这样就涉及到让ubuntu server连接VPN的问题。
需要连接VPN的服务器是一台Ubuntu 14.04.3 LTS,使用pptp-linux软件连接VPN。
首先是安装软件包
1 2 3 |
sudo apt-get update sudo apt-get install pptp-linux pptpsetup --help |
确认已经安装好后,根据帮助使用pptpsetup建立VPN连接。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
pptpsetup --create --server [--domain ] --username [--password ] [--encrypt] [--start] pptpsetup --delete Options: * the name you wish to use to refer to the tunnel (you choose it), * the IP address or host name of the server, * the authentication domain name (optional), * the username you are to use, * the password you are to use, * whether encryption is required, * whether to start the connection after configuration. pptpsetup - Point-to-Point Tunneling Protocol setup Copyright (C) 2006 Nelson Ferraz |
例如:
1 |
sudo pptpsetup --create VPN --server 115.159.**.** --username user --password userpass --encrypt --start |
看到如下提示,表明连接成功。
1 2 3 4 5 6 |
Using interface ppp0 Connect: ppp0 <--> /dev/pts/1 CHAP authentication succeeded MPPE 128-bit stateless compression enabled local IP address 10.0.0.100 remote IP address 10.0.0.1 |