位置: 编程技术 - 正文

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

  • 增值税纳税申报表在哪里查询
  • 销售货物的运费计入成本吗
  • 国有划拔土地房整体可以买卖吗
  • 当月销售次月开票怎么申报
  • 高温费国家有规定,一定要支付吗?
  • 一次性就业补助金的领取条件
  • 个人独资企业转个体户怎么办理
  • 季度申报残保金怎么填写
  • 技术推广服务包含什么 奇瑞汽车
  • 处置无形资产取得的收入计入
  • 营业成本增加会导致
  • 库存商品的进销存怎么做账
  • 企业缴纳增值税会计目录
  • 产品报废怎么做账
  • 财务费用期末结转后有余额吗
  • 收购企业账务处理
  • 分支机构企业所得税计提和缴纳数额不一致怎么办?
  • 支票付款提示
  • 个人独资的企业性质是什么
  • 购买办公家具合同
  • 企业所得税怎么做
  • 二手房增值税税率表2023年最新
  • 企业不合规发票责令补开处理
  • 股东私人垫支公司支付零星材料的会计分录
  • 我的初级备考日记--你都没坚持,还谈什么未来
  • 小规模税局代增值税专用发票怎么交税
  • 以前年度进项税少记了如何调整
  • 境外投资企业如何交税
  • 取得交易性金融资产发生的交易费用
  • 会计变更
  • 会计谨慎性原则是指
  • 二手固定资产使用年限
  • win7如何调出浏览器
  • 对公账户转到私人账户要手续费吗
  • pos机刷卡怎么做账务处理
  • php中的require
  • 委托代销商品的代销费用
  • win11怎么桌面快捷方式
  • mksysb命令
  • 邮电费什么意思
  • 空调维修费进什么会计科目
  • 专家坐诊信息
  • php array_walk_recursive 使用自定的函数处理数组中的每一个元素
  • 产成品和库存商品两个一级科目怎么填
  • 为什么会有不同的人种
  • 帝国cms安装教程
  • 红字写信是什么意思
  • opengl 图形
  • 自行研发非专利技术入账金额包括增值税吗
  • mysql使用指南
  • 资产负债表的固定资产怎么算出来的
  • 财务费用应付利息
  • 志愿者服务活动有哪些内容
  • 冲销未开票收入还需要申报吗
  • 车辆买的商业险全险,车辆出了事故,保险公司怎么赔
  • 一年以上的借款是长期借款吗
  • 销项税额减去进项税额就是该交的税吗
  • 融资租赁本金和租金的区别
  • 关闭windowsxp窗口的方法有
  • win2003和xp一样吗
  • solaris syslog配置
  • win8怎么玩帝国时代2
  • win10快速隐藏窗口
  • windows xp.exe
  • nicconfigsvc.exe - nicconfigsvc是什么进程 有什么用
  • win8笔记本无法更新正在撤销更改
  • win7系统怎么启用本地连接
  • win8 应用商店
  • cocos2dx视频教程
  • 列宽自适应
  • js对话框确定事件
  • node·js
  • 批处理应用实例
  • node 调用c
  • vue分页查询
  • 电子发票怎么汇总清卡
  • 长途客运手撕票能不能报销
  • 加油河南app怎么注销
  • 税务违法怎么处理
  • 契税的征收机关是哪里
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设