Configure an PPTP Server on Debian

时间:2024-01-13 15:52:56
  1. 安装PPTP

    apt-get update

    apt-get upgrade

    apt-get install iptables pptpd vim

  2. 设置并修改配置文件
    vim /etc/pptpd.conf

    localip 10.0.0.1

    remoteip 10.0.0.100-200

    添加VPN账号密码
    vim /etc/ppp/chap-secrets

    添加DNS服务器IP
    vim /etc/ppp/pptpd-options
    ms-dns 8.8.8.8
    ms-dns 8.8.4.4

    修改/etc/sysctl.conf
    net.ipv4.ip_forward = 1
    sysctl –p
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save
    iptables –L
    iptables-save > /etc/iptables.up.rules (重启生效)

    vim /etc/network/interfaces
    auto lo
    iface lo inet loopback
    pre-up iptables-restore < /etc/iptables.up.rules

    重启pptpd服务
    service pptpd restart

    备注:提示安装不了pptpd
    vim /etc/apt/sources.list
    deb http://ftp.debian.org/debian/ squeeze main contrib non-free
    deb-src http://ftp.debian.org/debian/ squeeze main contrib non-free
    apt-get update

    PC端可以上网,手机无法上网
    往/etc/ppp/peers/testdb文件添加一行require-mppe-128

    参考链接:
    https://www.digitalocean.com/community/tutorials/how-to-setup-your-own-vpn-with-pptp