|
|
|
VPN实验小结-site to site vpn的配置(采用pre-share)
|
|
作者: http://cisco.ccxx.net |
|
|
|
|
|
|
(四)site to site vpn的配置(采用pre-share) 实验网络拓扑: router3662---switch---router1720 3662接口ip: f0/0:10.130.23.244/28 f0/1:172.16.2.1/24 1720接口ip: f0:10.130.23.246/28 lo0:172.16.1.1/24 1720的ios为c1700-k93sy7-mz.122-8.T5.bin 3662的ios为c3660-jk9o3s-mz.123-1a.bin 步骤: 以1720为例进行配置 (1)配置静态路由 ####在配置vpn之前,需要保证两方的网络可以互相访问。 ip route 172.16.2.0 255.255.255.0 10.130.23.244 (2)定义加密数据的acl access 144 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255 (3)定义isakmp policy cry isa policy 1 authentication pre-share ####采用pre-share key进行验证 ####authentication参数必须配置,其他参数如group、hash、encr、lifetime等,如果进行配置,需要注意两个路由器上的对应参数配置必须相同。 (4)定义pre-share key cry isa key pre-share-key address 10.130.23.244 ####其中pre-share-key 为key,两个路由器上要一样 ####其中10.130.23.244为peer路由器的ip地址。 (5)定义transform-set cry ipsec transform-set vpn-tfs esp-3des esp-sha-hmac ####其中vpn-tfs为transform-set name,后面两项为加密传输的算法 mode transport/tunnel #####tunnel为默认值,此配置可选 (6)定义crypto map entry cry map vpn-map 10 ipsec-isakmp ####其中vpn-map为map name,10 是entry 号码,ipsec-isakmp表示采用isakmp进行密钥管理 match address 144 ####定义进行加密传输的数据,与第二步对应 set peer 10.130.23.244 ####定义peer路由器的ip set transform-set vpn-tfs ####与第五步对应 ####如果一个接口上要对应多个vpn peer,可以定义多个entry,每个entry对应一个peer (7)将crypto map应用到接口上 inter f0 #####vpn通道入口 cry map vpn-map (8)同样方法配置3662路由器。 1720的完整配置: VPN1720#sh run Building configuration... Current configuration : 1217 bytes ! version 12.2 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname VPN1720 ! logging buffered 4096 debugging no logging rate-limit enable password CISCO ! username vclient1 password 0 vclient1 mmi polling-interval 60 no mmi auto-configure no mmi pvc mmi snmp-timeout 180 ip subnet-zero ! ! ip domain-name fjbf.com ! ip audit notify log ip audit po max-events 100 ! crypto isakmp policy 1 encr 3des authentication pre-share group 2 crypto isakmp key pre-share-key address 10.130.23.244 ! ! crypto ipsec transform-set vpn-tfs esp-3des esp-sha-hmac ! crypto map vpn-map 10 ipsec-isakmp set peer 10.130.23.244 set transform-set vpn-tfs match address 144 ! ! ! ! interface Loopback0 ip address 172.16.1.1 255.255.255.0 ! interface FastEthernet0 ip address 10.130.23.246 255.255.255.240 speed auto crypto map vpn-map ! interface Serial0 no ip address encapsulation ppp no keepalive no fair-queue ! ip classless ip route 172.16.2.0 255.255.255.0 10.130.23.244 no ip http server ip pim bidir-enable ! ! access-list 144 permit ip 172.16.1.0 0.0.0.255 172.16.2.0 0.0.0.255 ! ! line con 0 exec-timeout 0 0 speed 115200 line aux 0 line vty 0 4 login ! end 测试: (1)未将map应用到接口之前,在1720,扩展ping,source 10.130.23.246 destination 172.16.2.1,通过。扩展ping,source 172.16.1.1 destination 172.16.2.1,通过。 (2)map应用到接口之后,在1720,扩展ping,source 10.130.23.246 destination 172.16.2.1,通过。 查看show cry ip sa,可以看到数据没有通过vpn 通道进行传输,因为不符合acl 144。 (3)map应用到接口之后,在1720,扩展ping,source 172.16.1.1 destination 172.16.2.1,通过。查看show cry ip sa,可以看到数据通过vpn 通道进行传输。 (4)在3662上同样进行测试。 说明: (1)采用pre-share方式加密数据,配置简单,数据传输效率较高,但是安全性不高。 (2)加密数据前后,通过ping大包的方式测试,可以发现这种利用软件进行数据加密的方式,延时较大。如果需要开展voip、ip 视讯会议等业务,建议选配vpn模块进行硬件加密。 常用调试命令: show cry isa sa show cry ip sa show cry engine configuration show cry engine connections active show cry engine connections flow deb cry isa deb cry ip
|
|
|
|
|
|
|
|
|
|