#!/bin/bash
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
####################################################
# #
# This is a Shell-Based tool of pptp installation #
# Version: 1.0 #
# Author: lyt #
# For Debian/Ubuntu 32bit and 64bit #
# #
####################################################
"
vpsip=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'`
apt-get update
apt-get --purge remove pptpd ppp
rm -rf /etc/pptpd.conf
rm -rf /etc/ppp
apt-get install -y ppp
apt-get install -y pptpd
apt-get install -y iptables logrotate tar cpio perl
rm -r /dev/ppp
mknod /dev/ppp c 108 0
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "mknod /dev/ppp c 108 0" >> /etc/rc.local
echo "echo 1 > /proc/sys/net/ipv4/ip_forward" >> /etc/rc.local
echo "localip 172.16.36.1" >> /etc/pptpd.conf
echo "remoteip 172.16.36.2-254" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options
echo "ms-dns 8.8.4.4" >> /etc/ppp/options
echo "vpn pptpd 123456 *" >> /etc/ppp/chap-secrets
iptables -t nat -A POSTROUTING -s 172.16.36.0/24 -j SNAT --to-source `ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'`
iptables -A FORWARD -p tcp --syn -s 172.16.36.0/24 -j TCPMSS --set-mss 1356
iptables -t nat -A POSTROUTING -s 172.16.36.0/24 -j SNAT --to-source "$vpsip"
iptables-save > /etc/iptables-rules
printf "
####################################################
add my Yu
####################################################
"
echo "pre-up iptables-restore < /etc/iptables-rules" >> /etc/network/interfaces
printf "
####################################################
add my Yu
####################################################
"
/etc/init.d/pptpd restart
printf "
####################################################
# #
# This is a Shell-Based tool of pptp installation #
# Version: 1.0 #
# Author: lyt #
# For Debian/Ubuntu 32bit and 64bit #
# #
####################################################
ServerIP:$vpsip
username:vpn
password:123321

vpn pptpd 123456 *
dengruchao pptpd 123456 *
000 pptpd 123456 *
luoyinjie pptpd 123456 *
luoyinjie1 pptpd 123456 *
luojingjing pptpd 123456 *
jerry pptpd 123456 *

nignx 正向代理

https://blog.csdn.net/medwardm/article/details/71455212

ubuntu 一键搭建VNN的更多相关文章

  1. 在ubuntu上搭建开发环境3---解决Y470一键系统重装之后恢复ubuntu引导启动的方法

    2015/08/18 将知识.常用的操作整理出来一定要完整,注意细节. 就像下面是再2015.04.27时候整理的,当时确实实验成功了,但是可能忘记记下具体的细节,尤其是3.4.5.6步骤中的关于盘符 ...

  2. 转:CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP)环境

    CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP) 今天遇到一个网友提到需要在Linux VPS服务器中安装LAMP(Apache/MySQL/PHP)网站环 ...

  3. Centos6一键搭建L2TP VPN服务器

    用VPS在墙上打洞还有一种叫L2TP,也是常见的一种方式.本脚本结合了L2TP(Layer Tunneling Protocol)和IPSec(Internet Protocol Security), ...

  4. 免费AWS云服务器一键搭建Trojan详细教程

    前言 想要撸AWS服务器的可以看我上一篇博客,这里就不介绍了,以下步骤有问题的朋友可以私信或者评论区留言. 配置AWS云服务器 选择语言,博主写了博客后才看到,前面都是使用谷歌翻译. 选择地区 创建虚 ...

  5. 在Ubuntu下搭建ASP.NET 5开发环境

    在Ubuntu下搭建ASP.NET 5开发环境 0x00 写在前面的废话 年底这段时间实在太忙了,各种事情都凑在这个时候,没时间去学习自己感兴趣的东西,所以博客也好就没写了.最近工作上有个小功能要做成 ...

  6. Ubuntu环境搭建系列—JavaEE篇

    恩,其实我是一时兴起,所以就写了目前这几篇环境的博文,希望能给自己做一个笔记,同时也能够给一些新手带来一些帮助,不会在配置方面那么迷茫.本篇文章主要就是针对Java web开发进行环境搭建. 一.To ...

  7. 在Linux(Ubuntu)下搭建ASP.NET Core环境并运行 继续跨平台

    最新教程:http://www.cnblogs.com/linezero/p/aspnetcoreubuntu.html 无需安装mono,在Linux(Ubuntu)下搭建ASP.NET Core环 ...

  8. 一键搭建vpn服务器

    今天花了很多时间搭建vpn服务器,后来找到一篇一键搭建服务器的文章,那叫一个爽,附上链接收藏~~~看开以后要写脚本了 http://www.centoscn.com/image-text/instal ...

  9. Ubuntu server 搭建Git server

    Ubuntu server 搭建Git server,git相比svn,最主要就是分布式了,每个客户端用户的本地都是一个版本管理控制器. Ubuntu server 版本为12.04 搭建步骤如下: ...

随机推荐

  1. Python 基础学习的几个小例子

    最近在研究动态脚本语言 Python , 出于对其语言精简度的喜欢及大学时期对 matlab 这样的数学领域语言的怀念, 再加上笔者是C++起家,Python中所涉及的del机制与特殊方法重载(类比于 ...

  2. x86架构64位模式下的寄存器列表

    在此列出x86架构处理器在64位模式下的可用寄存器列表,方便查阅- 这里要注意的是,在64位模式下,所有通用寄存器都能访问第8位部分,低16位部分以及低32位部分. 以下是64位模式下AMD64 AB ...

  3. python 获取昨天的日期

    from datetime import timedelta, datetime yesterday = datetime.today()+timedelta(-1) yesterday_format ...

  4. Git Command之Code Review

    原文链接 准备 Step 1. Create a team and add a teammate Step 2. Create a repository with some content 应用 Cl ...

  5. mfc移动文件夹

    SHFILEOPSTRUCT FileOp; ZeroMemory((void*)&FileOp,sizeof(SHFILEOPSTRUCT)); FileOp.fFlags = FOF_NO ...

  6. 通过id获取指定元素内容(标签里面的 标签内容获取)

    html页面如下 <tr style="background-color:#fff;"> <td colspan="2" align=left ...

  7. 目标检测 - TridentNet

    转载: https://zhuanlan.zhihu.com/p/54334986 http://haha-strong.com/2019/07/25/20190725-TridentNet/ 开源代 ...

  8. 字典和Model的互转

    LHModel的简单使用: LHModel是一个JSON转model,model转JSON的工具类. 使用很多runtime的API.调用简单,真正能用到的只有两个方法. Model* model = ...

  9. Windows下Tesseract-OCR的安装

    可以去Github查看tesseract-ocr的信息:https://github.com/tesseract-ocr/tesseract 在写这篇随笔的时候(2018年8月21日)最新版本是3.0 ...

  10. The request was rejected because the URL contained a potentially malicious String ";"报错解决

    报错信息 浏览器中看到的报错 错误摘要: The request was rejected because the URL contained a potentially malicious Stri ...