实验拓扑:
实验步骤:
1. 首先配置EzVPN:
EzVPNServer:
R4(config)#cryptoisakmp policy 10
R4(config-isakmp)#authenticationpre-share
R4(config-isakmp)#encryption3des
R4(config-isakmp)#group2
R4(config-isakmp)#hashmd5
R4(config-isakmp)#ex
R4(config)#
R4(config)#cryptoisakmp client configuration group ipsecgroup
R4(config-isakmp-group)#keycisco
R4(config-isakmp-group)#ex
R4(config)#
R4(config)#aaanew-model
R4(config)#aaaauthentication login noacs none
R4(config)#linecon 0
R4(config-line)#loginauthentication noacs
R4(config-line)#exit
R4(config)#lineaux 0
R4(config-line)#loginauthentication noacs
R4(config-line)#exit
R4(config)#
R4(config)#aaaauthentication login remote local
R4(config)#usernameipsecuser password cisco
R4(config)#aaaauthorization network remote local
R4(config)#iplocal pool pool 192.168.45.100 192.168.45.200
R4(config)#ipaccess-list extended acl
R4(config-ext-nacl)#permitip host 4.4.4.4 any
R4(config-ext-nacl)#ex
R4(config)#cryptoisakmp client configuration group ipsecgroup
R4(config-isakmp-group)#poolpool
R4(config-isakmp-group)#save-password
R4(config-isakmp-group)#aclacl
R4(config-isakmp-group)#ex
R4(config)#cryptoisakmp profile pro
% Aprofile is deemed incomplete until it has match identity statements
R4(conf-isa-prof)#matchidentity group ipsecgroup
R4(conf-isa-prof)#clientconfig address respond
R4(conf-isa-prof)#clientauthentication list remote
R4(conf-isa-prof)#isakmpauthorization list remote
R4(conf-isa-prof)#ex
R4(config)#
R4(config)#cryptoipsec transform-set cisco esp-des esp-md5-hmac
R4(cfg-crypto-trans)#ex
R4(config)#cryptodynamic dy-cisco 10
R4(config-crypto-map)#settransform-set cisco
R4(config-crypto-map)#setisakmp-profile pro
R4(config-crypto-map)#reverse-route
R4(config-crypto-map)#ex
R4(config)#cryptomap cisco 10 ipsec-isakmp dynamic dy-cisco
R4(config)#
R4(config)#interfaceserial 1/0
R4(config-if)#cryptomap cisco
R4(config-if)#ex
*Mar 1 00:10:43.719: %CRYPTO-6-ISAKMP_ON_OFF:ISAKMP is ON
R4(config-if)#ex
R4(config)#
EzVPN Client:
R2(config)#cryptoipsec client ezvpn ezvpn
R2(config-crypto-ezvpn)#peer 34.1.1.4 //EzVPN的最大特点就是不仅可以配置IP地址,还可以配置域名,中心可以使用动态域名技术,客户端动态获取IP地址,并且通过Peer指定中心的动态域名实现中心和分支节点地址的双动态;
R2(config-crypto-ezvpn)#connect auto //EzVPN的自动连接也是一个重要的特点,不需要感兴趣流的触发,只需要设备开机或者有互联网连接即可发起VPN连接;
R2(config-crypto-ezvpn)#groupipsecgroup key cisco
R2(config-crypto-ezvpn)#usernameipsecuser password cisco
R2(config-crypto-ezvpn)#modenetwork-extension
R2(config-crypto-ezvpn)#ex
R2(config)#
R2(config)#intloopback 0
R2(config-if)#cryptoipsec client ezvpn ezvpn inside
R2(config-if)#ex
R2(config)#ints 1/1
R2(config-if)#cryptoipsec client ezvpn ezvpn outside
R2(config-if)#ex
2. 配置GRE 隧道
EzVPNServer:
R4(config)#interfacetunnel 0
R4(config-if)#ipadd 24.1.1.4 255.255.255.0
R4(config-if)#tunnelsource 4.4.4.4
R4(config-if)#tunneldestination 2.2.2.2
R4(config-if)#ex
R4(config)#
EzVPNClient:
R2(config)#interfacetunnel 0
R2(config-if)#ipaddress 24.1.1.2 255.255.255.0
R2(config-if)#tunnelsource 2.2.2.2
R2(config-if)#tunneldestination 4.4.4.4
R2(config-if)#exit
3. 配置动态路由协议:
R1:
R1(config)#routerospf 1
R1(config-router)#router-id1.1.1.1
R1(config-router)#network192.168.12.1 0.0.0.0 area 0
R1(config-router)#ex
R1(config)#
R2:
R2(config)#routerospf 1
R2(config-router)#router-id2.2.2.2
R2(config-router)#network192.168.12.2 0.0.0.0 area 0
R2(config-router)#network24.1.1.2 0.0.0.0 area 0
R2(config-router)#ex
R2(config)#
R4:
R4(config)#routerospf 1
R4(config-router)#router-id4.4.4.4
R4(config-router)#network192.168.45.4 0.0.0.0 area 0
R4(config-router)#network24.1.1.4 0.0.0.0 area 0
R4(config-router)#exit
R5:
R5(config)#routerospf 1
R5(config-router)#router-id5.5.5.5
R5(config-router)#network192.168.45.5 0.0.0.0 area 0
R5(config-router)#ex
4. 测试
R5(config)#doping 192.168.12.1
Typeescape sequence to abort.
Sending5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!
Successrate is 100 percent (5/5), round-trip min/avg/max = 44/76/120 ms
|