详细讲述VPN设置和帧中继配置

企业动态
详细讲述VPN设置和帧中继配置。
帧中继配置
TTOM: #aaaaaa 1px solid; BACKGROUND-COLOR: #f5f5f5">
FRSW(config)#frame-relay switching
FRSW(config)#int s1/0
FRSW(config-if)#encapsulation frame-relay IETF
FRSW(config-if)#clock rate 2016000
FRSW(config-if)#frame-relay lmi-type cisco
FRSW(config-if)#frame-relay intf-type dce
FRSW(config-if)#frame-relay route 102 interface s1/1 201
FRSW(config-if)#no sh
FRSW(config-if)#exit
FRSW(config)#int s1/1
FRSW(config-if)#encapsulation frame-relay IETF
FRSW(config-if)#clock rate 2016000
FRSW(config-if)#frame-relay lmi-type cisco
FRSW(config-if)#frame-relay intf-type dce
FRSW(config-if)#frame-relay route 201 interface s1/0 102
FRSW(config-if)#no sh
FRSW(config-if)#exit

首先说明一下,帧中继一般都租用ISP的,以上的配置都是电信给你配置好的.你得到的就是蓝色字体的两个DLCI值,用于识别帧中继的线路.如果真的要自己去搞的话,就好像我写的那样红色字体一定不能缺,也必须在前面.然后蓝色部分也必须要按顺序来!因为后一句的输入前提是要在DCE上输入,而不能在DTE上.前一句也定义了DCE端,因为我的环境是模拟互联网的环境.
 

在未做site to site vpn前必须配置好基本的网络环境,即全网互通信息.
#BJ
BJ(config)#interface f0/0
BJ(config-if)#ip add 10.1.1.254 255.255.255.0
BJ(config-if)#no sh
BJ(config-if)#exit
BJ(config)#int s1/0
BJ(config-if)#ip add 172.161.1.1 255.255.255.0
BJ(config-if)#encapsulation frame-relay IETF
BJ(config-if)#frame-relay map ip 172.161.1.2 102 broadcast
BJ(config-if)#no sh
BJ(config-if)#exit
BJ(config)#ip route 0.0.0.0 0.0.0.0 172.161.1.2

#GZ
GZ(config)#interface f0/0
GZ(config-if)#ip add 10.2.2.254 255.255.255.0
GZ(config-if)#no sh
GZ(config-if)#exit
GZ(config)#int s1/1
GZ(config-if)#ip add 172.161.1.2 255.255.255.0
GZ(config-if)#encapsulation frame-relay IETF
GZ(config-if)#frame-relay map ip 172.161.1.1 201 broadcast
GZ(config-if)#no sh
GZ(config-if)#exit
GZ(config)#ip route 0.0.0.0 0.0.0.0 172.161.1.1

这样我们就可以在BJ上ping 通GZ上的内网IP
BJ#ping 10.2.2.254
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/90/184 ms

接下来就到了真正我们要关注的地方了.那就是VPN的其中一种配置.这次我只介绍一种,因为VPN的建立有很多种,时间的关系,我只建立其中的一种.如果有需要的话,我会在将来陆续的把其他几种VPN配置也做出来.
BJ(config)#crypto isakmp enable
BJ(config)#crypto isakmp policy 10
BJ(config-isakmp)#hash md5
BJ(config-isakmp)#authentication pre-share
BJ(config-isakmp)#encryption 3des
GZ(config-isakmp)#exit
BJ(config)#crypto isakmp key cisco address 172.161.1.2
BJ(config)#crypto ipsec transform-set trset esp-des esp-md5-hmac
BJ(cfg-crypto-trans)#exit
BJ(config)#access-list 101 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255
BJ(config)#crypto map eric86 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
        and a valid access list have been configured.
BJ(config-crypto-map)#set peer 172.161.1.2
BJ(config-crypto-map)#set transform-set trset
BJ(config-crypto-map)#match address 101
BJ(config-crypto-map)#exit
BJ(config)#interface Serial1/0
BJ(config-if)#crypto map eric86
BJ(config-if)#
*Oct 14 23:06:25.863: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON

红色部分:IKE协商策略配置
蓝色部分:设置预共享密钥和对端地址
绿色部分:配置IPSEC传输模式与CRYPTO访问列表
橙色部分:创建CRYPTO并自动协商与设置参数
黑底白字部分:为应用CRYPTO MAP到接口!
GZ(config)#crypto isakmp enable
GZ(config)#crypto isakmp policy 10
GZ(config-isakmp)#hash md5
GZ(config-isakmp)#authentication pre-share
GZ(config-isakmp)#encryption 3des
GZ(config-isakmp)#exit
GZ(config)#crypto isakmp key cisco address 172.161.1.1
GZ(config)#crypto ipsec transform-set trset esp-des esp-md5-hmac
GZ(cfg-crypto-trans)#exit
GZ(config)#access-list 101 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255
GZ(config)#crypto map eric86 10 ipsec-isakmp
% NOTE: This new crypto map will remain disabled until a peer
        and a valid access list have been configured.
GZ(config-crypto-map)#set peer 172.161.1.1
GZ(config-crypto-map)#set transform-set trset
GZ(config-crypto-map)#match address 101
GZ(config-crypto-map)#exit
GZ(config)#interface Serial1/1
GZ(config-if)#crypto map eric86
GZ(config-if)#
*Oct 14 23:07:28.067: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON


到这里就已经配置完成了VPN.大家可能会问,路本来就通的,怎么去测试VPN到底有没有实现的问题.这里我的网络拓扑要测试就只有一个方法了.

本来我不是给大家ping过一次,即使没有配置VPN就可以通讯的吗?配置了VPN也是可以通讯的,大家就觉的不知道怎么检验是否做成功了.我教大家要么把其中一端的crypto map不应用到接口,把它给NO掉,再去ping 一下看通不通.另外一种就比较麻烦,但可以比较全面的测试VPN通道.那就是利用抓包工具.TELNET协议大家都知道吧?在里面连接的发送的密码是明文方式的,未做VPN是可以抓到明文的,在做了VPN以后抓下来的只能够是乱码!!

问题存在于在未做VPN之前,内网与内网是不应该可以通讯的!这里是我在做的时候感觉奇怪的一点.因为在看书的时候,都是两个路由器,再用三个网段,并且都做上了默认路由.我在没有配置VPN的时候就已经可以PING通所有的网段,顾此我就一直以为site to site的VPN就必需要这么去做.
我在这里给大家补上一个配置文件,新的配置文件是把帧中继改为了前面我写到的路由协议EIGRP.在做到前面部分的时候大家只会说ping通公网而ping不通内网.

做完VPN以后大家的ping必须要用扩展模式去ping

BJ#ping
Protocol [ip]:
Target IP address: 10.2.2.254
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 10.1.1.254
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.254, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.254
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/164/240 ms

【编辑推荐】

  1. VPN访问外网不畅 深度剖析破解故障根源
  2. 柳州老邻居连锁超市侠诺VPN应用案例
  3. 如何让VPN走上移动之路
责任编辑:夏雨 来源: 56CTO
相关推荐

2010-09-25 17:00:47

dhcp中继配置

2010-09-25 16:43:24

DHCP中继配置

2011-08-16 11:37:22

帧中继

2012-11-26 13:46:17

路由器交换机

2011-08-16 11:06:12

帧中继

2010-09-06 12:09:37

2011-09-22 10:10:01

WANMPLS WAN

2010-09-07 14:54:01

PPP帧中继

2009-12-31 10:28:20

VPN配置实例

2010-01-05 15:45:42

配置帧中继交换机

2009-09-27 11:14:09

C#数组

2009-05-08 10:53:53

2009-09-25 15:03:21

Hibernate绑定

2009-12-28 13:09:36

MPLS VPN技术

2009-12-21 14:48:20

2010-08-30 17:22:35

DHCP中继

2009-12-30 10:19:42

2012-02-14 09:21:53

云接入互联网云计算

2009-12-10 16:37:02

D-link路由器VP

2011-11-29 12:13:21

VPN
点赞
收藏

51CTO技术栈公众号