位置: 编程技术 - 正文

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

  • 收到汇算清缴退回企业所得税分录
  • 实收资本多长时间缴纳完?
  • 个体户单位性质是什么
  • 营业账簿指什么
  • 软件工程质保金
  • 本月缴纳增值税和上个月账本金额不对
  • 银行回单可以做收入吗
  • 补交的增值税可以从留抵里面扣嘛
  • 通用机打发票没有税率
  • 新领的发票怎么导入uk开票系统
  • 去年多计提了费用今年怎么办
  • 购买固定资产没付款怎么入账
  • 非货币性资产交换损益计算
  • 企业怎么办税
  • 代开专用发票的数量单价单位怎么写?
  • 税盘被锁应该怎么办?
  • 企业发给职工的全年一次性奖金不缴纳个人所得税对吗
  • 未到期责任准备金属于什么科目
  • 机票抵扣增值税需要什么凭证
  • 商业企业做设备维修收入会计分录
  • 资产计税基础是怎么填
  • 六大会计科目的关系
  • 车辆购置税计入固定资产一起折旧吗
  • 利润分配在利润表中如何列示
  • 挂靠别人的资质进行房屋建筑会计怎样做账?
  • 跨年度暂估未取得发票如何处理
  • 新会计准则下企业合并财务报表问题研究
  • 事业单位财政拨款是编制吗
  • 花卉盆景苗木
  • 鼠标怎么设置为右键功能
  • 当月费用下月付款怎么做账
  • 若依框架自动生成代码
  • Javascript Object和Map之间的转换
  • 孕妇不能吃哪些水果?
  • 公司每年都有什么费用
  • php代码扫描
  • 公证处会计分录
  • 怎么用云服务
  • 怎么缴销空白发票
  • 卡格拉河
  • 增值税发票申报单怎么填
  • 小规模纳税人开专票需要交税吗
  • ChatGPT会取代你的岗位吗?
  • 比特币形式投资是否诈骗
  • 微软和梅赛德斯奔驰宣布合作
  • linux mput命令
  • 收购企业如何看报表
  • java泛型类和泛型方法
  • python中datetime用法
  • java中同步
  • phpcms v9安装教程
  • 绩效奖个人所得税是多少
  • 签三方协议需要法人本人去吗
  • 政府补贴需要还吗
  • 进项税通俗易懂
  • 收据十万大写金额填写样本
  • sqlserver存储过程加密
  • 建筑劳务公司的进项票有哪些
  • 银行汇票背书
  • 公司增资的法条
  • 商业汇票怎么算到期日
  • 预付账款跨年处理分录
  • 建设工程施工管理
  • 财务费用包括哪几项
  • 项目毛利润怎么算
  • sql合并多条记录某一个字段
  • freebsd查看硬盘信息
  • ssh -i命令
  • linux tomcat怎么启动服务
  • 开机需要两次
  • linux ssh key登录
  • shell脚本-lt
  • js中...用法
  • unity3d物体移动代码
  • 执行shell脚本方式
  • unity提高渲染画质
  • js闭包的使用
  • 蚌埠城乡医保缴费查询
  • 汽车票用什么查
  • 车船税为什么有时候不用交
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设