位置: 编程技术 - 正文

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

  • 递延所得税资产和负债怎么理解
  • 小微企业所得税优惠政策
  • 企业的承兑汇票贴息很高说明什么
  • 签三方协议需要什么资料
  • 水利建设基金一定要交吗
  • 什么时候库存商品什么时候主营业务收入
  • 当月有进项无销项月末怎么处理
  • 分期收款销售商品
  • 去国外参加展览的英文
  • 企业报销发票都需要什么
  • 税务局查到发票有问题
  • 材料采购费用的是
  • 工程分配协议书范本
  • 员工可以一起辞职吗
  • 苹果客服人工24小时
  • mac只能读不能写
  • 年度成本费用利润率多少合适
  • window10下载cad2014
  • 当前页面的脚本发生错误代码0没有注册类
  • .inc是什么文件
  • powershell.exe什么意思
  • rnbrcache.exe是什么意思
  • php编程中的_横线表示什么
  • 公转私备注用途
  • 盈余公积金可以用来扩大公司生产经营
  • 营改增前建筑工程需交哪些税种
  • php常用加密技术
  • 企业待报解预算收入的分录
  • 借方贷方有哪些
  • 短期投资理财是
  • 付国外专利费用需办什么手续
  • 金蝶怎么增加职员
  • 现代服务行业有哪些
  • 什么情况下核定应纳税额
  • 房地产企业拆迁还房会计处理
  • 金税四期怎么监控个人账号
  • 费用报销的程序是什么
  • 短期借款有哪几种类型
  • 房东减免部分房租
  • 出库销售会计分录
  • 资产损失根据发票核算
  • 外币报表折算差额会计分录
  • 其他综合收益属于什么科目借贷方向
  • 红字冲销发票的作用
  • sql中存储过程的用法
  • centos7如何安装yum命令
  • win7使用率
  • 微软windows8.1
  • window10注册表
  • freebsd中文手册
  • vc6_cn_full.exe
  • cf游戏截图在哪个文件夹
  • win1020h2正式版
  • windows10周年更新
  • window10邮件
  • windows7如何调节屏幕色彩
  • windows7文件操作步骤
  • linux 常见
  • win8丢失msvcp140.dll的解决办法
  • win8.1激活方法
  • win10系统如何创建新用户
  • unity获取mesh网格数据
  • python批量下载文件
  • javascript HTML5文件上传FileReader API
  • python 遍历字符串修改
  • android使用so
  • 用python编写
  • python并发原理
  • jquery 遍历
  • jquery常用插件有哪些
  • jquery attr和prop
  • 湖南税务发票查验平台官网
  • 如何查询纳税信用等级证明
  • 浙江国税咨询电话12306
  • 企业年报通怎么注销
  • 补缴印花税分录
  • 航信开的电子发票怎么导出来
  • 广西教师初级职称申报时间
  • 国家税务总局对税务助征员
  • 小规模纳税人租赁费税率
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设