linux VPN客户端设置
?
linux
VPN客户端设置
下载pptp-1.7.2.tar.gz
http://pptpclient.sourceforge.net/
root用户上传至linux主机/tmp目录
解压安装:
cd
/tmp
tar
xzf pptp-1.7.2.tar.gz
cd
pptp-1.7.2
make
&& make install
更改配置:
1、更改拨号用户信息文件
cd
/etc/ppp
vi?chap-secrets
#
Secrets for authentication using CHAP
# client??????? server?
secret????????????????? IP addresses
####### redhat-config-network will
overwrite this part!!! (begin) ##########
####### redhat-config-network will
overwrite this part!!! (end) ############
username ? ? connectvpn?????
"password"?????????????? *
#注意:增加了zhangsan ? ? ?connectvpn????? "password"??????????????
*,其中username为VPN账户名,"password"为VPN账户密码,
#connectvpn为VPN标识,用户区分不同的VPN连接。
2、创建拨号配置文件connectvpn(上述的VPN标识)
cd
/etc/ppp/peers
vi
connectvpn
增加如下内容:
pty
"pptp 166.123.10.210 ?--nolaunchpppd"
noauth
refuse-eap
require-mppe-128?
name
username
remotename connectvpn
file /etc/ppp/options.pptp
?
#其中
166.123.10.210??为VPN服务器IP,name字段后跟的是/etc/ppp/chap-secrets中的username(VPN账户名),
#remotename为VPN标识,其他保持默认
3、启动VPN客户端
root执行如下命令
pppd call connectvpn
4、检查拨号结果,稍等10秒左右后,执行
如下命令检查:
[root@nms peers]# ps -ef|grep pppd
root????? 3617???? 1? 0 06:40
???????? 00:00:00 pppd call connectvpn
root????? 3618? 3617? 0 06:40 ????????
00:00:00 pptp?
166.123.10.210??--nolaunchpppd
root????? 3625???? 1? 0 06:40
???????? 00:00:00 pptp?
166.123.10.210??--nolaunchpppd
root????? 3692? 3514? 0
06:58 pts/3??? 00:00:00 grep pppd
?
5、检查获取的vpn客户端IP
[root@nms peers]# ifconfig ppp0
ppp0????? Link encap:Point-to-Point
Protocol??
????????? inet addr:162.11.0.5? P-t-P:162.11.0.1?
Mask:255.255.255.255
????????? UP POINTOPOINT RUNNING NOARP MULTICAST?
MTU: