Router
1
配置:
Ø
配置
IKE
(密钥管理协议)
1. R1(
config)#crypto isakmp policy 1建立IKE协商策略(策略号为1)
2. R1(config-isakmp)#authentication pre-share使用共享密钥
3. R1(config-isakmp)#hash md5 使用md5认证
4. R1(config-isakmp)#encryption aes设置加密的算法
5. R1(config-isakmp)#lifetime 86400协商的生存时间
6. R1(config)#crypto isakmp key 0 cisco address 192.168.2.2设置共享密钥和对端地址
Ø
配置
Ipsec
(
ip
安全协议)
1. R1(config)#access-list 101 permit ip host 192.168.1.100 host 192.168.3.100 定义加密的流量
2. R1 (config)#crypto ipsec transform-set benet ah-md5-hmac esp-aes 配置传输模式以及指定模式名称
Ø
配置端口的应用
1. R1(config)#crypto map map1 1 ipsec-isakmp 设置crypto map
2. R1(config-crypto-map)#set peer 192.168.2.2 指定对端地ip地址
3. R1(config-crypto-map)#set transform-set benet 指定此crypto map所使用的传输模式
4. R1(config-crypto-map)#match address 101 指定此crypto map所使用的ACL
5. R1(config)#interface s0/0
6. R1(config-if)#crypto map map1 应用crypto map到端口
查看命令: show crypto isakmp sa
********************************************************************
Router 2配置:
Ø
配置
IKE
(密钥管理协议)
1. R2(config)#crypto isakmp policy 2
2. R2(config-isakmp)#authentication pre-share
3. R2(config-isakmp)#hash md5
4. R2(config-isakmp)#encryption aes
5. R2(config-isakmp)#lifetime 86400
6. R2(config)#crypto isakmp key 0 cisco address 192.168.2.1
配置
Ipsec
(
ip
安全协议)
1. R2(config)#crypto ipsec transform-set benet ah-md5-hmac esp-aes
2. R2(config)#access-list 101 permit ip host 192.168.3.100 host 192.168.1.100
配置端口的应用
1. R2(config)#crypto map map1 1 ipsec-isakmp
2. R2(config-crypto-map)#set peer 192.168.2.1
3. R2(config-crypto-map)#set transform-set benet
4. R2(config-crypto-map)#match address 101
5. R2 (config)#interface s0/0
6. R2(config-if)#crypto map map1
配置完成!
PS:
钥管理协议
ISAKMP internet security association and key management protocol internet 安全协定和密钥管理协议
参见:IPsec ×××配置注解
转载于:https://blog.51cto.com/acadia627/836207