Ubuntu 12.04安装PPTP

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
posted @ 2014-02-02 16:43  miosec  阅读(561)  评论(0编辑  收藏  举报