User-Profile-Image
hankin
  • 5
  • 首页
  • 分类
    • Windows
    • Web
    • VoIP
    • Virtualization
    • Trading
    • Smart Home
    • SEO
    • Security
    • Python
    • Program
    • PHP
    • OSX
    • OS
    • OpenSource
    • Nginx
    • MySQL
    • Mood
    • Linux
    • Life
    • Injection
    • Hosting
    • Finance
    • Exploits
    • CDN
  • 页面
    • About
  • 友链
    • 维酷科技
    • Tesra超算网络
Help?

Please contact us on our email for need any support

Support
  • 首页
    首页   ›   OS   ›   Linux   ›   正文
Linux

CentOS命令行终端安装VPN/PPTP客户端及连接使用

2013-04-04 18:52:44
3743  0 0

1.       使用yum安装ppp和pptp包

yum -y install ppp
yum -y install pptp
如果yum不具备pptp,可到 http://pptpclient.sourceforge.net 下载安装,这里建议选用rpm包。

http://sourceforge.net/projects/pptpclient/files/pptp/pptp-1.7.2/pptp-1.7.2-3.rhel5.i386.rpm/download

rpm -ivh ./pptp-1.7.2-3.rhel5.i386.rpm

2. 配置pptp
pptpsetup –create vpn连接名称(自定义) –server VPN服务器IP –username VPN用户名 –password VPN密码

执行完成以后会生成文件 /etc/ppp/peers/vpn连接名称(自定义)

编辑该文件:
vi /etc/ppp/peers/vpn连接名称(自定义)
将该文件修改并完善为如下:

# written by pptpsetup
pty “pptp VPN服务器IP –nolaunchpppd”
lock
#noauth
nobsdcomp
nodeflate
name VPN用户名
remotename vpn连接名称(自定义)
ipparam 服务器ip
require-mppe-128
refuse-pap
refuse-chap
refuse-eap
refuse-mschap

编辑文件 /etc/ppp/chap-secrets
vi /etc/ppp/chap-secrets
内容如下:

# Secrets for authentication using CHAP
# client server secret IP addresses

VPN用户名 vpn连接名称(自定义) “VPN密码” *

3. 复制命令

cp /usr/share/doc/ppp-2.4.4/scripts/pon /usr/sbin/
cp /usr/share/doc/ppp-2.4.4/scripts/poff /usr/sbin/
chmod +x /usr/sbin/pon /usr/sbin/poff

4.拨vpn
pon vpn连接名称(自定义)

5.查看是否连接
ifconfig
————————————————————————————————————-
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.5.5 P-t-P:192.168.5.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1396 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:80 (80.0 b) TX bytes:80 (80.0 b)

————————————————————————————————————-

再添加默认路由
route add -net 0.0.0.0 dev ppp0

6.断开连接
poff vpn连接名称(自定义)

至此,安装完成。

ProdigYu
180文章 77评论 4点赞 553985浏览
随机文章
卸载阿里云盾(安骑士)监控&屏蔽云盾IP
5年前
Mac终端(Terminal)使用快捷键
10年前
小米Aqara无线开关控制易微联WIFI智能开关
5年前
VestaCP小百科
9年前
CentOS7安装Gnome桌面及VNC远程方便挂机
9年前
Tags
Apache CentOS CMD DDOS Debian DNS Docker FastCGI Google IIS IP iptables Linux Mac MySQL Nginx Opensource PHP Python Skill SSH Ubuntu Vim VMware VPN web.py Windows 删除 命令 命令提示符 安装 开源 技巧 插件 漏洞 百度 系统 组件 终端 缓存 网络电话 脚本 自建 详解 错误
Meta
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright © 2025
主页
页面
  • About
博主
ProdigYu 管理员
Something about myself
180 文章 77 评论 553985 浏览
测试
测试