当前位置: 主页 > 服务器技术 > 安全防护 > 在Ubuntu上配置pptpd VPN

在Ubuntu上配置pptpd VPN

时间:2010-4-13来源:互联网 点击:
apt-get install pptpd

然后编辑置文件 /etc/ppp/pptpd-options 内容如下:
name pptpd
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
proxyarp
lock
nobsdcomp
novj
novjccomp
nologfd
ms-dns 8.8.8.8
ms-dns 8.8.4.4

编辑配置文件 /etc/pptpd.conf 内容如下:
option /etc/ppp/pptpd-options
logwtmp
localip 192.168.92.1
remoteip 192.168.92.11-15

编辑配置文件 /etc/ppp/chap-secrets,配置用户名为johndoe,密码为password,内容如下:

johndoe pptpd password *

ufw configuration

编辑配置文件 /etc/default/ufw

DEFAULT_FORWARD_POLICY="ACCEPT"

编辑配置文件 /etc/ufw/sysctl.conf

net.ipv4.ip_forward=1

编辑配置文件 /etc/ufw/before.rules

# nat Table rules
*nat
:POSTROUTING ACCEPT [0:0]

# Forward traffic from eth1 through eth0.
-A POSTROUTING -s 192.168.92.0/24 -o eth0 -j MASQUERADE

# don‘t delete the ‘COMMIT‘ line or these nat table rules won‘t be processed
COMMIT

编辑filter section.

-A ufw-before-input -i ppp+ -j ACCEPT
-A ufw-before-output -i ppp+ -j ACCEPT
-A ufw-before-forward -s 192.168.92.0/24 -j ACCEPT
-A ufw-before-forward -d 192.168.92.0/24 -j ACCEPT

重新启动ufw
sudo ufw disable && sudo ufw enable

客户端

* windows

建立连接

control pannel -> Network Connections -> create a new connect ->
next -> connect to the network at my working place -> next ->
virtual private network connection -> campany name (input: ) ->
Host name or IP address (input: ) -> finish

设置连接

duble click the connection created just now -> properties -> security ->
advanced(custom setting) ->optional encryption( connect even no encryption) ->
allow this protocal -> CHAP (only choose this) -> OK -> Yes

Reference: http://rashost.com/blog/debian5-pptpd-vpn
http://cviorel.easyblog.ro/2009/02/09/how-to-set-up-a-vpn-server-on-ubuntu/
http://blog.chinaitlab.com/html/30/104830-166896.html
站长资讯网
. TAG: ubuntu pptpd VPN 配置
推荐内容最近更新人气排行
关于我们 | 友情链接 | 网址推荐 | 常用资讯 | 网站地图 | RSS | 留言