位置: 编程技术 - 正文

Linux上PPTP VPN的一键安装以及设置开机启动的方法

编辑:rootadmin

推荐整理分享Linux上PPTP VPN的一键安装以及设置开机启动的方法,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

设置pptp vpn 开机启动

有的人懒的重启后手动开启服务,所以下面我再补上开机自动启动pptp vpn 和 iptables的命令

Linux上PPTP VPN的一键安装以及设置开机启动的方法

复制代码代码如下:#chkconfig pptpd on //开机启动pptp vpn服务</p><p>#chkconfig iptables on //开机启动iptables

贴个openvz的pptp vpn 一件安装包吧:centos,fedora,redhat 6.x 使用的脚本(vps上从没安装过的可以试试这个脚本): 点击下载复制代码代码如下:#!/bin/bash# Interactive pptp vpn install script for an OpenVZ VPS# surport : Cenost ,Fedora 6.x # Augest , v1.#url : "######################################################"echo "Interactive PoPToP Install Script for an OpenVZ VPS"echoecho "Make sure to contact your provider and have them enable"echo "IPtables and ppp modules prior to setting up PoPToP."echo "PPP can also be enabled from SolusVM."echoecho "You need to set up the server before creating more users."echo "A separate user is required per connection or machine."echo "######################################################"echoechoecho "######################################################"echo "Select on option:"echo "1) Set up new PoPToP server AND create one user"echo "2) Create additional users"echo "######################################################"read xif test $x -eq 1; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p</p><p>## get the VPS IP#ip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://`</p><p>echoecho "######################################################"echo "Downloading and Installing ppp and pptpd "echo "######################################################"yum install ppp -yrpm -Uvh install pptpd -y</p><p>echoecho "######################################################"echo "Creating Server Config"echo "######################################################"cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.baksed -i 'a ms-dns 8.8.8.8' /etc/ppp/options.pptpd</p><p></p><p></p><p># setting up pptpd.confsed -i 'a localip ..9.1' /etc/pptpd.confsed -i 'a remoteip ..9.-' /etc/pptpd.conf</p><p># adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets</p><p>echoecho "######################################################"echo "Forwarding IPv4 and Enabling it on boot"echo "######################################################"cat >> /etc/sysctl.conf <<ENDnet.ipv4.ip_forward=1ENDsysctl -p</p><p>echoecho "######################################################"echo "Updating IPtables Routing and Enabling it on boot"echo "######################################################"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE# saves iptables routing rules and enables them on-bootiptables-save > /etc/iptables.conf</p><p>cat > /etc/network/if-pre-up.d/iptables <<END#!/bin/shiptables-restore < /etc/iptables.confEND</p><p>chmod +x /etc/network/if-pre-up.d/iptablescat >> /etc/ppp/ip-up <<ENDifconfig ppp0 mtu END</p><p>echoecho "######################################################"echo "Restarting PoPToP"echo "######################################################"sleep 5/etc/init.d/pptpd restart</p><p>echoecho "######################################################"echo "Server setup complete!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################"</p><p># runs this if option 2 is selectedelif test $x -eq 2; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p</p><p></p><p># adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets</p><p>echoecho "######################################################"echo "Addtional user added!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################"</p><p>elseecho "Invalid selection, quitting."exitfi #!/bin/bash# Interactive pptp vpn install script for an OpenVZ VPS# surport : Cenost ,Fedora 6.x # Augest , v1.#url : echo "######################################################"echo "Interactive PoPToP Install Script for an OpenVZ VPS"echoecho "Make sure to contact your provider and have them enable"echo "IPtables and ppp modules prior to setting up PoPToP."echo "PPP can also be enabled from SolusVM."echoecho "You need to set up the server before creating more users."echo "A separate user is required per connection or machine."echo "######################################################"echoechoecho "######################################################"echo "Select on option:"echo "1) Set up new PoPToP server AND create one user"echo "2) Create additional users"echo "######################################################"read xif test $x -eq 1; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p ## get the VPS IP#ip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://` echoecho "######################################################"echo "Downloading and Installing ppp and pptpd "echo "######################################################"yum install ppp -yrpm -Uvh install pptpd -y echoecho "######################################################"echo "Creating Server Config"echo "######################################################"cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.baksed -i 'a ms-dns 8.8.8.8' /etc/ppp/options.pptpd # setting up pptpd.confsed -i 'a localip ..9.1' /etc/pptpd.confsed -i 'a remoteip ..9.-' /etc/pptpd.conf # adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets echoecho "######################################################"echo "Forwarding IPv4 and Enabling it on boot"echo "######################################################"cat >> /etc/sysctl.conf <<ENDnet.ipv4.ip_forward=1ENDsysctl -p echoecho "######################################################"echo "Updating IPtables Routing and Enabling it on boot"echo "######################################################"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE# saves iptables routing rules and enables them on-bootiptables-save > /etc/iptables.conf cat > /etc/network/if-pre-up.d/iptables <<END#!/bin/shiptables-restore < /etc/iptables.confEND chmod +x /etc/network/if-pre-up.d/iptablescat >> /etc/ppp/ip-up <<ENDifconfig ppp0 mtu END echoecho "######################################################"echo "Restarting PoPToP"echo "######################################################"sleep 5/etc/init.d/pptpd restart echoecho "######################################################"echo "Server setup complete!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################" # runs this if option 2 is selectedelif test $x -eq 2; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p # adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets echoecho "######################################################"echo "Addtional user added!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################" elseecho "Invalid selection, quitting."exitfi</p><p>

复制下面代码到install.sh中,然后 sh isntall.sh。这个是只支持debian和ubuntu系列,centos不支持。

复制代码代码如下:#!/bin/bash# Interactive PoPToP install script for an OpenVZ VPS# Tested on Debian 5, 6, and Ubuntu .# April 2, v1.# "######################################################"echo "Interactive PoPToP Install Script for an OpenVZ VPS"echoecho "Make sure to contact your provider and have them enable"echo "IPtables and ppp modules prior to setting up PoPToP."echo "PPP can also be enabled from SolusVM."echoecho "You need to set up the server before creating more users."echo "A separate user is required per connection or machine."echo "######################################################"echoechoecho "######################################################"echo "Select on option:"echo "1) Set up new PoPToP server AND create one user"echo "2) Create additional users"echo "######################################################"read xif test $x -eq 1; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p</p><p># get the VPS IPip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://`</p><p>echoecho "######################################################"echo "Downloading and Installing PoPToP"echo "######################################################"apt-get updateapt-get -y install pptpd</p><p>echoecho "######################################################"echo "Creating Server Config"echo "######################################################"cat > /etc/ppp/pptpd-options <<ENDname pptpdrefuse-paprefuse-chaprefuse-mschaprequire-mschap-v2require-mppe-ms-dns 8.8.8.8ms-dns 8.8.4.4proxyarpnodefaultroutelocknobsdcompEND</p><p># setting up pptpd.confecho "option /etc/ppp/pptpd-options" > /etc/pptpd.confecho "logwtmp" >> /etc/pptpd.confecho "localip $ip" >> /etc/pptpd.confecho "remoteip .1.0.1-" >> /etc/pptpd.conf</p><p># adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets</p><p>echoecho "######################################################"echo "Forwarding IPv4 and Enabling it on boot"echo "######################################################"cat >> /etc/sysctl.conf <<ENDnet.ipv4.ip_forward=1ENDsysctl -p</p><p>echoecho "######################################################"echo "Updating IPtables Routing and Enabling it on boot"echo "######################################################"iptables -t nat -A POSTROUTING -j SNAT --to $ip# saves iptables routing rules and enables them on-bootiptables-save > /etc/iptables.conf</p><p>cat > /etc/network/if-pre-up.d/iptables <<END#!/bin/shiptables-restore < /etc/iptables.confEND</p><p>chmod +x /etc/network/if-pre-up.d/iptablescat >> /etc/ppp/ip-up <<ENDifconfig ppp0 mtu END</p><p>echoecho "######################################################"echo "Restarting PoPToP"echo "######################################################"sleep 5/etc/init.d/pptpd restart</p><p>echoecho "######################################################"echo "Server setup complete!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################"</p><p># runs this if option 2 is selectedelif test $x -eq 2; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p</p><p># get the VPS IPip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://`</p><p># adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets</p><p>echoecho "######################################################"echo "Addtional user added!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################"</p><p>elseecho "Invalid selection, quitting."exitfi #!/bin/bash# Interactive PoPToP install script for an OpenVZ VPS# Tested on Debian 5, 6, and Ubuntu .# April 2, v1.# echo "######################################################"echo "Interactive PoPToP Install Script for an OpenVZ VPS"echoecho "Make sure to contact your provider and have them enable"echo "IPtables and ppp modules prior to setting up PoPToP."echo "PPP can also be enabled from SolusVM."echoecho "You need to set up the server before creating more users."echo "A separate user is required per connection or machine."echo "######################################################"echoechoecho "######################################################"echo "Select on option:"echo "1) Set up new PoPToP server AND create one user"echo "2) Create additional users"echo "######################################################"read xif test $x -eq 1; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p # get the VPS IPip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://` echoecho "######################################################"echo "Downloading and Installing PoPToP"echo "######################################################"apt-get updateapt-get -y install pptpd echoecho "######################################################"echo "Creating Server Config"echo "######################################################"cat > /etc/ppp/pptpd-options <<ENDname pptpdrefuse-paprefuse-chaprefuse-mschaprequire-mschap-v2require-mppe-ms-dns 8.8.8.8ms-dns 8.8.4.4proxyarpnodefaultroutelocknobsdcompEND # setting up pptpd.confecho "option /etc/ppp/pptpd-options" > /etc/pptpd.confecho "logwtmp" >> /etc/pptpd.confecho "localip $ip" >> /etc/pptpd.confecho "remoteip .1.0.1-" >> /etc/pptpd.conf # adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets echoecho "######################################################"echo "Forwarding IPv4 and Enabling it on boot"echo "######################################################"cat >> /etc/sysctl.conf <<ENDnet.ipv4.ip_forward=1ENDsysctl -p echoecho "######################################################"echo "Updating IPtables Routing and Enabling it on boot"echo "######################################################"iptables -t nat -A POSTROUTING -j SNAT --to $ip# saves iptables routing rules and enables them on-bootiptables-save > /etc/iptables.conf cat > /etc/network/if-pre-up.d/iptables <<END#!/bin/shiptables-restore < /etc/iptables.confEND chmod +x /etc/network/if-pre-up.d/iptablescat >> /etc/ppp/ip-up <<ENDifconfig ppp0 mtu END echoecho "######################################################"echo "Restarting PoPToP"echo "######################################################"sleep 5/etc/init.d/pptpd restart echoecho "######################################################"echo "Server setup complete!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################" # runs this if option 2 is selectedelif test $x -eq 2; thenecho "Enter username that you want to create (eg. client1 or john):"read uecho "Specify password that you want the server to use:"read p # get the VPS IPip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://` # adding new userecho "$u * $p *" >> /etc/ppp/chap-secrets echoecho "######################################################"echo "Addtional user added!"echo "Connect to your VPS at $ip with these credentials:"echo "Username:$u ##### Password: $p"echo "######################################################" elseecho "Invalid selection, quitting."exitfi

防止Linux系统下的VPS用户更改IP地址的方法 作为XenVPS服务商,我们分配独立的IP地址给VPS,我们不希望VPS用户自己能随便修改IP地址,因为这样有可能和其他用户的IP地址造成冲突,而且造成管理

在Windows上访问Linux下的Samba服务器的方法 首先先记录下在linux客户端怎么用命令访问windows或者linux的共享文件夹第一步复制代码代码如下:smbclient-L//...5-Uwujie(smbclient是命令-L是列出服务器

Linux系统上Samba服务器的配置教程 第一步:进入/etc/samba目录,备份下smb.conf,然后删除这个文件,自己重新建立一个,输入如下内容复制代码代码如下:[global]workgroup=WORKGROUPnetbiosname=www.e2f

标签: Linux上PPTP VPN的一键安装以及设置开机启动的方法

本文链接地址:https://www.jiuchutong.com/biancheng/365445.html 转载请保留说明!

上一篇:Linux下php-cgi占内存100%电脑变的很卡的解决方法(php.ini linux)

下一篇:防止Linux系统下的VPS用户更改IP地址的方法(防止linux断电系统崩溃)

  • 个税汇算清缴系统找不到扣缴义务人
  • 不缴或少缴应纳税款的处罚措施
  • 进口关税怎么做分录
  • 一般纳税人开劳务专票多少个点
  • 工程附加税怎么计算
  • 百旺税控盘反写不了怎么回事
  • 预缴所得税的计税依据
  • 小规模建筑服务需要预缴增值税吗
  • 季度所得税申报表怎么申报
  • 政府补助收入计算有了新变化
  • 纳税评估滞纳金会计分录怎么处理?
  • 设备投入安装计入什么科目
  • 经营损失计入哪类费用
  • 公司付给职工的工资
  • 增值税税控系统的税务处理
  • 运输增值税专票含税价怎么算
  • 2018年出口退税税率
  • 分包与转包的区别 法院
  • 电器供应
  • 计提折旧计算公式是什么
  • 平均净资产计算公式是什么意思
  • 研发费用的归集范围
  • 商家说补发什么意思
  • linux命令top作用
  • thinkphp6验证器
  • php面向对象详解
  • linux操作系统有哪些版本
  • system占用cpu过高怎么解决
  • 个人独资所得税税率表最新
  • 销售需要安装的商品,只能在安装和检验完毕后确认收入
  • 资产购置融资
  • ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1
  • php fgets函数的用法
  • 企业所得税中的其他业务收入包括
  • 委托代销商品的会计分录怎么做
  • 服务器连接方式包括直接相连,间接连接
  • 知识图谱的构建方法有两种
  • 以小物件为话题写出背后的故事
  • 员工福利费会计分录 最新
  • python迭代器iterator
  • 限定性和非限定性资产的区别
  • 为什么盈余公积减少,未分配利润增加
  • 独立核算的分公司注销时账面怎么处理
  • 进项税额转出更正申报
  • sql 列转行
  • 税金及附加是什么科目编号
  • 高新技术企业如何计算企业所得税
  • 海关完税凭证如何取得
  • 微信验证收到的信息在哪
  • 税控盘全额抵减如何填写申报表
  • 专门从事研发的公司
  • 票据质押如何做账
  • 原材料的合理损耗计入入账成本吗
  • 合并报表编制方法有几种
  • 待认证进项税额期末怎么办
  • 金蝶软件采购订单
  • 计提应付职工薪酬在借方还是贷方
  • 什么是合法有效的继承证明
  • mysql sql语句性能调优
  • win7系统打开软件就停止工作
  • 桌面右边
  • linux中python命令
  • centos下安装windows
  • windows7没有桌面图标
  • linux如何绑定域名
  • linux k
  • js布尔类型用法
  • perl正则表达式
  • python结巴分词
  • vuejs环境搭建
  • angularjs2
  • 苹果多点触控
  • javascript详细介绍
  • jquery设计模式
  • javascript substring的用法
  • 广东省社保局打印参保缴费凭证
  • 中心组学习的意义?
  • 沈阳国税局局长是谁
  • 租了店面
  • 买车可以抵扣企业所得税多少
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设