本文介绍一下命令配置PPTP客户端的过程。
A.安装pptp客户端软件
1
|
sudo
apt-get
install
pptp-linux
|
B.查看网络配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
root@localhost:~
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:19:a7:0c
inet addr:192.168.1.113 Bcast:255.255.255.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe19:a70c
/64
Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:255926 errors:0 dropped:0 overruns:0 frame:0
TX packets:28779 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16821541 (16.8 MB) TX bytes:3126300 (3.1 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1
/128
Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1123 errors:0 dropped:0 overruns:0 frame:0
TX packets:1123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:125046 (125.0 KB) TX bytes:125046 (125.0 KB)
root@localhost:~
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
|
C.初始化一个VPN的连接通道:my
1
2
3
4
5
6
7
8
|
sudo
pptpsetup --create my --server xxx.xxx.xxx.xxx --username xx1 --password xx2 --encrypt --start
Using interface ppp0
Connect: ppp0 <-->
/dev/pts/3
CHAP authentication succeeded
MPPE 128-bit stateless compression enabled
local
IP address 172.31.26.100
remote IP address 172.31.26.143
|
成功连接到远程VPN服务器
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
root@localhost:~
# ip addr show
1: lo:
link
/loopback
00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1
/8
scope host lo
valid_lft forever preferred_lft forever
inet6 ::1
/128
scope host
valid_lft forever preferred_lft forever
2: eth0:
link
/ether
00:0c:29:19:a7:0c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.113
/24
brd 255.255.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe19:a70c
/64
scope link
valid_lft forever preferred_lft forever
10: ppp0:
link
/ppp
inet 172.31.26.100 peer 172.31.26.143
/32
scope global ppp0
valid_lft forever preferred_lft forever
root@localhost:~
# ip addr show
1: lo:
link
/loopback
00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1
/8
scope host lo
valid_lft forever preferred_lft forever
inet6 ::1
/128
scope host
valid_lft forever preferred_lft forever
2: eth0:
link
/ether
00:0c:29:19:a7:0c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.113
/24
brd 255.255.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe19:a70c
/64
scope link
valid_lft forever preferred_lft forever
10: ppp0:
link
/ppp
inet 172.31.26.100 peer 172.31.26.143
/32
scope global ppp0
valid_lft forever preferred_lft forever
root@localhost:~
# ping www.google.com
PING www.google.com (216.58.221.132) 56(84) bytes of data.
64 bytes from hkg07s02-
in
-f132.1e100.net (216.58.221.132): icmp_seq=1 ttl=53
time
=310 ms
64 bytes from hkg07s02-
in
-f132.1e100.net (216.58.221.132): icmp_seq=2 ttl=53
time
=323 ms
|
D.1.断开VPN连接
1
|
poff my
|
2.重新连接VPN
1
|
pon my
|
3.读取配置文件重新连接VPN
1
|
sudo
pppd call my updetach
|
4.处理错误
LCP: timeout sending Config-Requests
处理方案:sudo modprobe nf_conntrack_pptp
转自:http://www.cnblogs.com/multi-task/p/5176073.html