1、安装软件
  1. sudo apt-get install pptpd ufw
2、编辑/etc/ppp/pptpd-options

找到

  1. refuse-pap
  2. refuse-chap
  3. refuse-mschap

注释掉这三行,即在前面加#

3、接着同样的文件,添加DNS
  1. ms-dns 8.8.8.8
  2. ms-dns 8.8.4.4
4、编辑/etc/pptpd.conf

增加或修改:

  1. localip 10.99.99.99
  2. remoteip 10.99.99.100-199
5、编辑/etc/ppp/chap-secrets

添加用户和密码,格式为:

  1. [Username] [Service] [Password] [Allowed IP Address]

如:

  1. sampleusername pptpd samplepassword *
6、重启pptpd
  1. sudo /etc/init.d/pptpd restart
7、编辑/etc/sysctl.conf

增加:

  1. net.ipv4.ip_forward=1

立即生效:

  1. sudo sysctl -p
8、编辑/etc/default/ufw

把所有的默认策略更改为ACCEPT:

  1. DEFAULT_FORWARD_POLICY由DROP更改为ACCEPT
  2. DEFAULT_INPUT_POLICY由DROP更改为ACCEPT
9、编辑/etc/ufw/before.rules

增加:

  1. # NAT table rules
  2. *nat
  3. :POSTROUTING ACCEPT [0:0]
  4. # Allow forward traffic to eth0
  5. -A POSTROUTING -s 10.99.99.0/24 -o eth0 -j MASQUERADE
  6. # Process the NAT table rules
  7. COMMIT
10、启动ufw
  1. sudo ufw enable

最新文章

  1. [Yii2.0] 以Yii 2.0风格加载自定义类或命名空间 [配置使用Yii2 autoloader]
  2. mongodb学习(一)
  3. mybatis3.2.3+spring3 控制台打印sql解决办法
  4. [转] "self = [super init]"的解释与潜藏bug
  5. IDLE快捷键
  6. MAC下 JDK环境配置、版本切换以及ADB环境配置
  7. iBatis面试题
  8. .NET 中的DateTime
  9. 设备文件的创建mknod
  10. .Net程序员学习Linux(三)
  11. php中curl、fsockopen的应用
  12. nfs:server 172.168.1.22 not responding,still trying问题解决方法 平台为RealARM 210平台
  13. 使用HttpURLConnection实现多线程下载
  14. android studio的lib和jniLibs
  15. 微信公众号开发笔记3-sdk接入(nodejs)
  16. 解决150%DPI下Photoshop不能显示成合适大小的问题
  17. Imcash平台测评报告
  18. Settings 参数记录
  19. asp.net core webapi 生成导出excel
  20. 开源的许可证GPL、LGPL、BSD、Apache 2.0

热门文章

  1. 多线程模式之MasterWorker模式
  2. [POJ1477]Box of Bricks
  3. 【HTML】Intermediate5:Definition Lists
  4. codeforce 621A Wet Shark and Odd and Even
  5. 微软Build2014大会干货总结-2
  6. POJ1423 - Big Number(Stirling公式)
  7. php学习小记1
  8. Python队列服务 Python RQ Functions from the __main__ module cannot be processed by workers.
  9. jQuery事件绑定的最佳实践
  10. 用Ajax调用web api,解决URL太长的问题;