***各设备基本配置********************************************
site1pc
ena
conf t
hostname site1pc
int e0/0
ip add 192.168.1.2 255.255.255.0
no sh
exit
no ip routing
ip default-gateway 192.168.1.1
*******************************************
***************************************
site2pc
ena
conf t
hostname site2pc
int e0/0
ip add 192.168.2.2 255.255.255.0
no sh
exit
no ip routing
ip default-gateway 192.168.2.1
**************************************************************************
site1ckrouter
ena
conf t
hostname site1ck
int e0/0
ip add 192.168.1.1 255.255.255.0
no sh
exit
int e0/1
ip add <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />12.12.12.12 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 12.12.12.21
1--crypto isakmp enable
2--crypto isakmp policy 1
       encryption 3des
       authentication pre-share
       hash sha
       lifetime 3600
       group 2
       exit
3--crypto isakmp key 123456 address 23.23.23.32
4--access-list 110 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
5--crypto ipsec transform-set benet ah-sha-hmac esp-3des
       mode tunnel
       exit
6--crypto map mymap 1 ipsec-isakmp
       match address 110
       set peer 23.23.23.32
       set transform-set benet
7--int e0/1
       crypto map mymap
      
***************************************
interrouter
ena
conf t
hostname inter
int e0/0
ip add 12.12.12.21 255.255.255.0
no sh
exit
int e0/1
ip add 23.23.23.23 255.255.255.0
no sh
exit
***************************************
site2ckrouter
ena
conf t
hostname site2ck
int e0/0
ip add 23.23.23.32 255.255.255.0
no sh
exit
int e0/1
ip add 192.168.2.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 12.12.12.21(和当前路由器离的最近的路由器接口的ip地址
exit
1启用ike策略
2定义ike策略:定义使用预共享**,设置**交换时采用的加密及认证算法,此处设置的加密认证算法不对将来传输的数据生效
3定义预共享**的值,并设置和谁共享
4设置acl确定加密解密的数据对象
5设置传输模式集,引用ahesp算法,确定将来对传输的数据所采用的加密和认证算法
6定义映射图,引用acl、传输模式集等
7将映射图引用到路由器的出口完成***配置
ena
conf t
crypto isakmp enable
crypto isakmp policy 1
       encryption 3des
       authentication pre-share
       hash sha
       lifetime 3600
       group 2
       exit
crypto isakmp key 123456 address 12.12.12.12(对方站点出口路由器外网口的ip地址)
access-list 110 permit ip 192.168.2.0 0.0.0.255(本地站点局域网使用的网络id 192.168.1.0 0.0.0.255(对方站点局域网使用的网络id
crypto ipsec transform-set benet ah-sha-hmac esp-3des(同时引用了ahesp,也可之引用其中之一,注意二者的区别)
       mode tunnel
       exit
crypto map mymap 1 ipsec-isakmp
       match address 110(引用以上创建的acl
       set peer 12.12.12.12(设置***的终点)
       set transform-set benet(引用以上创建的传输模式集)
int e0/1
       crypto map mymap
***************************************

转载于:https://blog.51cto.com/ydsbenet/114655

相关文章: