centos 6.8命令行下使用pptpsetup进行pptp拨号的实现方法
centos 6.8 命令行下可使用pptpsetup进行pptp拨号
1.先安装ppp,pptp和pptp-setup三个包
yum install -y ppp pptp pptp-setup
2.使用pptpsetup进行连接
pptpsetup --create VPN名字 --server 服务器IP --username 用户名 --password 密码 --encrypt --start [root@centos6-8-1 ~]# pptpsetup --create vpn --server 192.168.127.128 --username user --password passw d --encrypt --start Using interface ppp0 Connect: ppp0 <--> /dev/pts/2 CHAP authentication succeeded MPPE 128-bit stateless compression enabled local IP address 192.168.0.235 remote IP address 192.168.0.1
使用ip addr可以看到多了一个接口ppp0:
[root@centos6-8-1 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:27:eb:e7 brd ff:ff:ff:ff:ff:ff inet 192.168.127.129/24 brd 192.168.127.255 scope global eth0 inet6 fe80::20c:29ff:fe27:ebe7/64 scope link valid_lft forever preferred_lft forever 4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3 link/ppp inet 192.168.0.235 peer 192.168.0.1/32 scope global ppp0
3.添加默认路由
route add default dev ppp0
此时已经可以正常使用VPN。
如果想断开pptp连接,那就直接结束pptp进程
pkill pptp
相关推荐
onlykg 2015-02-06
wangkeIDC 2007-10-14
小灯光环 2011-08-02
hmslucky 2011-06-18
85407718 2010-04-29
Linux 2009-02-13
周海汉的开发 2008-09-12
boante 2015-02-06
哥哥的CSDN集 2011-09-12
89421950 2011-07-15
wangfengqingyang 2011-03-08
89421950 2011-03-05
88971730 2010-01-14
hongsheyoumo 2019-06-21
86530290 2014-02-05
蜗牛Running 2013-05-23
梦想天空分外蓝 2012-07-31
violinlin 2012-05-09