Centos6+GNOME+NetworkManager配置VPN客户端

2012年09月21日

转载请注明出处:https://www.myzhenai.com/thread-15104-1-1.html https://www.myzhenai.com.cn/post/767.html
我的系统配置是Centos6+GNOME+NetworkManager,为了一个VPN终端,我是折腾了好久了,命令行下的折腾好了,却发现NetworkManager却始终无法正常使用.可以新建VPN链接,但无法使用,无法新建pptp通道协议VPN.原来是NetworkManager-vpnc,NetworkManager-pptp,NetworkManager-openvpn这三个插件无法安装,Centos的依赖太严格了,提示少了libnm-util.so.2,libgdk-3.so.0,libnm-glib.so.4,libnm_glib_vpn.so.0,libnm_glib.so.0,libnm-util.so.2,libgdk-3.so.0,libgtk-3.so.0等依赖包.折腾了好久才折腾好,不过是换了个方式解决的.
执行终端程序,输入以下代码.

#su root #切换到超级管理员权限帐户
#yum -y install ppp
#yum -y install pptp
#yum -y install vpnc
#yum -y install openvpn

 
配置文件

#vi /etc/ppp/chap-secrets
——————————————
# Secrets for authentication using CHAP
# client    server    secret            IP addresses

username myvpn “password” *
——————————————

 
#注释,IP addresses替换成你的VPNIP地址,myvpn替换成你的VPN用户名(不是帐号用户名),password替换成你的VPN密码.

#vi /etc/ppp/peers/myvpn
——————————————
# written by pptpsetup
pty “pptp  vpnserverip –nolaunchpppd”
lock
#noauth
nobsdcomp
nodeflate
name username
remotename myvpn
ipparam myvpn
require-mppe-128
refuse-pap
refuse-chap
refuse-eap
refuse-mschap
——————————————
#pptpsetup --create CentosVPN --server VPNIP --username VPNname --password VPNpassword

 
#注释,vpnserverip和VPNIP替换成你的VPNIP,username和VPNname替换成你的VPN用户名,myvpn替换成上边你的VPN用户名.VPNpassword替换成你的VPN密码

#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

 

启动VPN

#pon myvpn
#pppd call CentosVPN

 
断开VPN

#poff myvpn
#killall pppd

 

#注释,如果以上安装不能进行的话,请执行以下这两步再返回重复进行一遍操作.

#rpm -ivh https://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
#rpm -ivh https://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#yum install pptp NetworkManager-pptp -y

 
#如果上条命令无效,可以尝试下边的命令

#yum install pptp -y
#wget https://dl.fedoraproject.org/pub/epel/6/i386/NetworkManager-pptp-0.8.0-1.git20100411.el6.i686.rpm
#yum install NetworkManager-pptp-0.8.0-1.git20100411.el6.i686.rpm

 
Centos6安装epel源:https://pkgs.org/#centos-6-rhel-6

#wget https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
#rpm -Uvh epel-release-6-7.noarch.rpm
#/etc/init.d/network-manager restart

 
如果是GNOME桌面环境并使用NetworkManager网络链接程序的话,可以下载安装以下几个NetworkManager插件,这个也可以做到以图形界面使用VPN链接.

#yum install NetworkManager-vpnc NetworkManager-pptp NetworkManager-openvpn
#rpm -ivh https://mirrors.163.com/fedora/releases/17/Everything/i386/os/Packages/n/NetworkManager-vpnc-0.9.3.997-1.fc17.i686.rpm
#rpm -ivh https://mirrors.163.com/fedora/releases/17/Everything/i386/os/Packages/n/NetworkManager-pptp-0.9.3.997-1.fc17.i686.rpm
#rpm -ivh https://mirrors.163.com/fedora/releases/17/Everything/i386/os/Packages/n/NetworkManager-openvpn-0.9.3.997-1.fc17.i686.rpm

 
最主要的是之前安装Epel更新源
https://rpmfusion.org/Configuration

#rpm -ivh https://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
#wget https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
#rpm -Uvh epel-release-6-7.noarch.rpm
#/etc/init.d/network-manager restart

 
然后在执行安装命令的时候在后边加上一个米号*会自动安装系统里缺少的依赖包.
例如

#yum -y install ppp*
#yum -y install pptp*
#yum -y install vpnc*
#yum -y install openvpn*
#yum install pptp NetworkManager-pptp* -y
#yum install pptp NetworkManager-vpnc* -y
#yum install pptp NetworkManager-openvpn* -y
#yum install NetworkManager-vpnc NetworkManager-pptp NetworkManager-openvpn

 


sicnature ---------------------------------------------------------------------
I P 地 址: 3.138.174.45
区 域 位 置: 美国
系 统 信 息: 美国
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://myzhenai.com/post/767.html

1 评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注