1、安装软件
sudo apt-get install pptpd ufw
2、编辑/etc/ppp/pptpd-options
找到
refuse-pap refuse-chap refuse-mschap
注释掉这三行,即在前面加#
3、接着同样的文件,添加DNS
ms-dns 8.8.8.8 ms-dns 8.8.4.4
4、编辑/etc/pptpd.conf
增加或修改:
localip 10.99.99.99 remoteip 10.99.99.100-199
5、编辑/etc/ppp/chap-secrets
添加用户和密码,格式为:
[Username] [Service] [Password] [Allowed IP Address]
如:
sampleusername pptpd samplepassword *
6、重启pptpd
sudo /etc/init.d/pptpd restart
7、编辑/etc/sysctl.conf
增加:
net.ipv4.ip_forward=1
立即生效:
sudo sysctl -p
8、编辑/etc/default/ufw
把所有的默认策略更改为ACCEPT:
DEFAULT_FORWARD_POLICY由DROP更改为ACCEPT DEFAULT_INPUT_POLICY由DROP更改为ACCEPT
9、编辑/etc/ufw/before.rules
增加:
# NAT table rules *nat :POSTROUTING ACCEPT [0:0] # Allow forward traffic to eth0 -A POSTROUTING -s 10.99.99.0/24 -o eth0 -j MASQUERADE # Process the NAT table rules COMMIT
10、启动ufw
sudo ufw enable
11、使用客户端进行测试
如windows7,打开控制面板->网络和internet->网络和共享中心同,点击“设置新的连接和网络”,选择连接到工作区,接下来就按提示操作就好。
文章来源:http://www.centos.bz/2013/06/ubuntu-12-04-pptp/
暂无评论
写评论