如何使用UbuntuVPN

出自Ubuntu中文

Ubuntu中文提供pptp vpn接入服务

服务器: ubuntu.org.cn
登录名: ubuntu
密码: ubuntuvpn
========================
分配的IP从: 192.168.0.2-192.168.0.250 网关: 192.168.0.1
允许vpn客户端之间的网络交换,不允许vpn到net的网络交换,也就是你无法使用vpn作为代理服务器使用。
========================
提醒:由于完全允许vpn客户端之间的访问,[color=red]所以接入到本vpn并不是安全的[/color],建议偶尔短暂使用。
用处:双方内网之间的访问/或者需要控制内网的电脑使用,例如远程桌面。

Linux下使用指南:
1 . 安装 network-manager-pptp 包

sudo apt-get install network-manager-pptp 
sudo apt-get install network-manager-vpnc

2. 点击电脑右上角网络图标的配置VPN菜单,如图:
Image:Ubuntuvpn1.png

3. 点击添加按钮,如图:

Image:Ubuntuvpn2.png

4. 如图创建 新的连接,网关填写 ubuntu.org.cn

Image:Ubuntuvpn3.png

5. 点击route,设置路由为192.168.0.0/24,同时勾选只对这些地址使用VPN连接。

Image:Ubuntuvpn4.png

6 . 点击 前进按钮后,再点击应用,如下图:

Image:Ubuntuvpn5.png

7. 再次点击网络图标,点击刚才设置的ubuntu的选项

Image:Ubuntuvpn6.png

8. 输入用户名 ubuntu ,密码 ubuntuvpn ,进行拨号。

Image:Ubuntuvpn7.png


9. 完成,可以正常使用了。

在终端,输入$ ifconfig 将会看到:

ppp0      Link encap:点对点协议  
          inet 地址:192.168.0.2  点对点:192.168.0.1  掩码:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1412  跃点数:1
          接收数据包:6 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:6 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:3 
          接收字节:78 (78.0 B)  发送字节:96 (96.0 B)

你的地址为192.168.0.2。



手工的方法建议动手能力强的人使用:

1 sudo apt-get install pptp-linux

2 sudo vim /etc/ppp/chap-secrets 在最後增加一行如下:

"ubuntu"    pptp    "ubuntuvpn"

3 sudo vim /etc/ppp/peers/ubuntu 增加如下内容:

pty "pptp ubuntu.org.cn --nolaunchpppd"
name ubuntu
remotename pptp
require-mppe-128
file /etc/ppp/options.pptp
ipparam vpn 

4 sudo pon ubuntu

5 查看是否拨号成功 ifconfig 已经拨号成功的 ppp* ,这里假设拨号成功为 ppp0 ,增加路由如下:

sudo route add -net 192.168.0.0 netmask 255.255.255.0 dev ppp0

大功告成