zoukankan      html  css  js  c++  java
  • ubuntu 安装pptp

    1、安装PPTP服务器

    更新软件

    apt-get update

    安装pptpd
    apt-get install pptpd

    2、配置PPTP服务器

    用 vi 编辑/etc/pptpd.conf
    查找如下内容:

    #localip 192.168.0.1
    #remoteip 192.168.0.234-238,192.168.0.245

    把#去掉,

    上面的两行为VPN服务器的IP和VPN客户端连接后获取到的IP范围。保存退出

    添加PPTP VPN用户

    添加服用名。服务。密码

    编辑/etc/ppp/chap-secrets 添加如下内容:

    username pptpd password *

    其中username为你要添加的VPN帐号的用户名,password为你VPN帐号的密码。

    修改DNS服务器

    编辑/etc/ppp/options,添加如下内容:

    ms-dns 8.8.8.8
    ms-dns 8.8.4.4

    开启IPv4转发

    编辑/etc/sysctl.conf文件,去掉net.ipv4.ip_forward=1前的注释
    运行如下命令,使配置修改生效

    sysctl -p

    重启pptpd服务

    /etc/init.d/pptpd restart

    安装iptables
    2.
    apt-get install iptables

    开启iptables转发

    iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
    iptables-save > /etc/iptables.pptp

    在/etc/network/if-up.d/目录下创建iptables文件,内容如下:

    #!/bin/sh
    iptables-restore < /etc/iptables.pptp

    给脚本添加执行权限:

    chmod +x /etc/network/if-up.d/iptables

    至此PPTP VPN服务器端的设置就完成了。

  • 相关阅读:
    当Django模型迁移时,报No migrations to apply 问题时
    django--各个文件的含义
    django--创建项目
    1013. Battle Over Cities (25)
    1011. World Cup Betting (20)
    1009. Product of Polynomials (25)
    1007. Maximum Subsequence Sum (25)
    1006. Sign In and Sign Out (25)
    1008. Elevator (20)
    1004. Counting Leaves (30)
  • 原文地址:https://www.cnblogs.com/exayong/p/6594183.html
Copyright © 2011-2022 走看看