位置: 编程技术 - 正文

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断电系统崩溃)

  • 纳税人离线开票时间的文件
  • 公司食堂辅助账怎么记账
  • 利润表的税金及附加是计提数还是实缴数
  • 建筑公司租赁费会计分录
  • 一般纳税人销售自己使用过的汽车
  • 新换财务软件如何登录
  • 测距仪计入什么科目
  • 合并报表成本法调整为权益法
  • 系统集成 税点
  • 职工发放福利的会计处理
  • 软件出口税收政策
  • 城市规划部门收取的市政建设配套费是否作为契税的征税基数
  • 专票只有抵扣联发票联丢失怎么办
  • 水利建设工程
  • 企业购买固定资产的价款超过正常信用条件
  • 固定资产怎么盘点
  • 收到国债本金和利息会计分录
  • 通讯费要计入应付账款吗
  • 什么时候需要计提税金及附加
  • 生产企业出口退税的会计分录
  • 增值税普通电子发票
  • 果蔬免征增值税有哪些
  • 免税个体户发票税率多少
  • 技术开发加计扣除
  • 开通分期付款
  • 总分机构类型怎么选
  • 红字冲回怎么做账
  • 原材料损失计入
  • 收到采购折扣的账务处理
  • 1697509200
  • 出口退税免退税办法
  • 出口免税金额
  • 用盈余公积弥补亏损会影响所有者权益总额吗
  • 设置按住键盘重启怎么弄
  • 法人治理包括哪些方面
  • 公司网银付款和付款区别
  • neotrace.exe - neotrace是什么进程 有什么用
  • 原材料运费可以计入制造费用吗
  • 克拉克湖国家公园
  • phprestfulapi框架
  • 一文教会你何为重绘、回流?
  • yolov3 pytorch详解
  • 冲减多计提的工资摘要怎么写
  • 存货出入库需要什么凭证
  • 餐饮服务需要卫生许可证吗
  • 发票金额是含税价还是不含税价
  • mysql中文乱码解决
  • 在建工程账务处理会计分录
  • 企业固定资产对应哪个科目
  • 为什么说运输是实现物流合理化的关键
  • 企业所得税如何规避
  • 红冲去年费用会计分录
  • 关于发票冲账应该怎么写
  • 税种分类及其税率
  • 跨年度暂估成本高了怎么办
  • 有利息费用这个科目吗
  • 小规模纳税人采用简易计税方法征收增值税
  • 退货开负数发票的情况该如何做会计处理?
  • 政府无偿划拨土地如何摊销
  • 应交税费应交增值税已交税金怎么用
  • 其他应收款如何做坏账处理
  • 什么是大病医疗救助
  • 固定资产一旦处于什么状态
  • Windows Server 2016第三技术预览版新特性详解:容器是亮点
  • 通过修改注册表激活win7
  • linux快速清空大日志文件
  • mac怎么连接打印机设备
  • win8页面
  • win7怎么在桌面添加时钟
  • w10cmd命令高级命令
  • vuejs单页面
  • viewpager2 bug
  • android上吹一吹功能的实现代码
  • python如何通过键找对应值
  • jquery示例
  • 全电子发票开具怎么扫脸认证?
  • 税务局的章
  • 苏州税务实名认证流程小程序
  • 税务怎么在外网申报
  • 长途汽车车次号
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设