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
.
然后编辑置文件 /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
- 上一篇:H3C交换机密码破解方法
- 下一篇:常见DDos攻击攻防