在Ubuntu上配置pptpd VPN [ 网站地图 ]

发表于:2010-4-13 浏览:691 作者: 来源:互联网

关键字:ubuntu,pptpd VPN,配置

描述:apt-getinstallpptpd然后编辑置文件/etc/ppp/pptpd-options内容如下:namepptpdrefuse-paprefuse-chaprefuse-mschaprequire-mschap-v2require-mppe-128proxyarplocknobsdcompnovjnovjccompnologfdms-dns8.

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

站长资讯网 做中国最丰富的资讯网站 沪ICP备05004089号