Centos6+GNOME+NetworkManager配置VPN客户端

2012年09月21日

转载请注明出处:http://www.myzhenai.com/thread-15104-1-1.html http://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 http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
#rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#yum install pptp NetworkManager-pptp -y

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

#yum install pptp -y
#wget http://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源:http://pkgs.org/#centos-6-rhel-6

#wget http://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 http://mirrors.163.com/fedora/releases/17/Everything/i386/os/Packages/n/NetworkManager-vpnc-0.9.3.997-1.fc17.i686.rpm
#rpm -ivh http://mirrors.163.com/fedora/releases/17/Everything/i386/os/Packages/n/NetworkManager-pptp-0.9.3.997-1.fc17.i686.rpm
#rpm -ivh http://mirrors.163.com/fedora/releases/17/Everything/i386/os/Packages/n/NetworkManager-openvpn-0.9.3.997-1.fc17.i686.rpm

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

#rpm -ivh http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm
#wget http://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 ---------------------------------------------------------------------
Your current IP address is: 54.198.158.24
Your IP address location: 美国
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 海南仙岛海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://www.myzhenai.com.cn/post/767.html

1 评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注