远程访问VPN之PPTP

Internet配置:

1
2
3
4
5
6
7
8
!
interface Ethernet0/0
ip address 100.100.100.80 255.255.255.0
half-duplex
!
router ospf 1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0

 

ISP配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
!
interface Ethernet0/0
ip address 200.200.200.1 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 10.10.10.1 255.255.255.0
half-duplex
!
interface Ethernet0/2
ip address 100.100.100.1 255.255.255.0
half-duplex
!
router ospf 1
log-adjacency-changes
passive-interface Ethernet0/0
passive-interface Ethernet0/1
network 0.0.0.0 255.255.255.255 area 0

注:其中应用到本实验中

passive-interface Ethernet0/0
passive-interface Ethernet0/1

可是用另一种写法:

passive-interface default
no passive-interface Ethernet0/2

GW配置:

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
40
41
42
43
44
45
46
47
!
vpdn enable //开启vpdn功能
vpdn authen-before-forward //vpdn必须验证后才能转发数据
vpdn session-limit 10 //限制vpdn拨入用户最大限制为10个
!
vpdn-group PPTP //创建vpdn组PPTP
! Default PPTP VPDN group
accept-dialin //设置PPTP允许拨入
protocol pptp //PPTP运行的是pptp协议
virtual-template 1 //把虚拟接口1加入到PPTP组
!
username user1 password 0 test123456 //创建拨入用户
!
interface Loopback1
ip address 172.168.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0
half-duplex
!
interface Ethernet0/1
ip address 200.200.200.200 255.255.255.0
ip nat outside
ip virtual-reassembly
half-duplex
!
interface Virtual-Template1
ip unnumbered Loopback1 //设置虚拟接口1绑定到Loopback1
ip mtu 1492 //调整MTU
ip nat inside
ip virtual-reassembly
peer default ip address pool PPTP-POOL //虚拟接口验证成功后分配给PPTP拨入用户的地址池
no keepalive //不保活,既无流量时,PPTP用户断开连接
ppp mtu adaptive //ppp协商mtu
ppp encrypt mppe auto //加密位数自动,有的路由器没有这条命令可省略
ppp authentication ms-chap ms-chap-v2 ppp //虚拟接口的验证方式使用ms-chap,ms-chap-v2
ppp ipcp dns 8.8.8.8 4.4.4.4 //虚拟接口验证成功后分配给PPTP拨入用户的DNS地址
!
ip local pool PPTP-POOL 172.168.1.100 172.168.1.150 //定义PPTP用户拨入后可以获得的地址池
no ip http server
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 200.200.200.1
!
ip nat inside source list 1 interface Ethernet0/1 overload //配置NAT
!
access-list 1 permit 192.168.1.0 0.0.0.255 //标记可以进行NAT的内部流量
access-list 1 permit 172.168.1.0 0.0.0.255 //标记可以进行NAT的PPTP VPN流量

 

GNS3中的VPCS只能完成一些简单的连通性测试,如ping、trace、ip等等。更复杂的交互如消息传递、数据传输等等都要依靠虚拟机或者本机的网卡来实现。本例中“Cloud-1”为添加本地虚拟回环网卡来实现实验,并在本地拨号PPTP。

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
C:\Users\wudaipeng>ipconfig /all

Windows IP 配置

主机名 . . . . . . . . . . . . . : Adex-PC
主 DNS 后缀 . . . . . . . . . . . :
节点类型 . . . . . . . . . . . . : 混合
IP 路由已启用 . . . . . . . . . . : 否
WINS 代理已启用 . . . . . . . . . : 否

PPP 适配器 PPTP VPN LINK:

连接特定的 DNS 后缀 . . . . . . . :
描述. . . . . . . . . . . . . . . : PPTP VPN LINK
物理地址. . . . . . . . . . . . . :
DHCP 已启用 . . . . . . . . . . . : 否
自动配置已启用. . . . . . . . . . : 是
IPv4 地址 . . . . . . . . . . . . : 172.168.1.100(首选)
子网掩码 . . . . . . . . . . . . : 255.255.255.255
默认网关. . . . . . . . . . . . . : 0.0.0.0
DNS 服务器 . . . . . . . . . . . : 8.8.8.8
4.4.4.4
TCPIP 上的 NetBIOS . . . . . . . : 已启用

C:\Users\wudaipeng>ping 172.168.1.1

正在 Ping 172.168.1.1 具有 32 字节的数据:
来自 172.168.1.1 的回复: 字节=32 时间=24ms TTL=255
来自 172.168.1.1 的回复: 字节=32 时间=29ms TTL=255
来自 172.168.1.1 的回复: 字节=32 时间=29ms TTL=255
来自 172.168.1.1 的回复: 字节=32 时间=29ms TTL=255

172.168.1.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 24ms,最长 = 29ms,平均 = 27ms

C:\Users\wudaipeng>ping 192.168.1.10

正在 Ping 192.168.1.10 具有 32 字节的数据:
来自 192.168.1.10 的回复: 字节=32 时间=3082ms TTL=63
来自 192.168.1.10 的回复: 字节=32 时间=67ms TTL=63
来自 192.168.1.10 的回复: 字节=32 时间=71ms TTL=63
来自 192.168.1.10 的回复: 字节=32 时间=65ms TTL=63

192.168.1.10 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 65ms,最长 = 3082ms,平均 = 821ms

C:\Users\wudaipeng>ping 100.100.100.80

正在 Ping 100.100.100.80 具有 32 字节的数据:
来自 100.100.100.80 的回复: 字节=32 时间=75ms TTL=253
来自 100.100.100.80 的回复: 字节=32 时间=63ms TTL=253
来自 100.100.100.80 的回复: 字节=32 时间=47ms TTL=253
来自 100.100.100.80 的回复: 字节=32 时间=60ms TTL=253

100.100.100.80 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 47ms,最长 = 75ms,平均 = 61ms