思科cisoc 路由器配置 IKEv1

本文详细介绍了一个包含多个路由器的网络环境中IPSec的配置步骤。从R1到R5的接口配置、路由配置,再到R2和R4上的IPSec配置,包括预共享密钥设置、加密套件选择、感兴趣流定义等关键环节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境拓扑

R1配置

接口配置

R1#configure terminal
R1(config)#interface e1/0
R1(config-if)#ip address 40.1.1.2 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

路由配置

R1(config)#ip route 0.0.0.0 0.0.0.0 40.1.1.1
R1(config)#end

R2配置

接口配置

R2#configure terminal
R2(config)#interface e1/0
R2(config-if)#no shutdown
R2(config-if)#ip address 40.1.1.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface e1/1
R2(config-if)#no shutdown
R2(config-if)#ip address 30.1.1.2 255.255.255.0
R2(config-if)#exit

IPSec配置

# 配置预共享密钥
R2(config)#crypto isakmp key 123456 address 20.1.1.1 255.255.255.255
# 配置ike一阶段加密套件
R2(config)#crypto isakmp policy 1
R2(config-isakmp)#encryption 3des
R2(config-isakmp)#hash sha
R2(config-isakmp)#authentication pre-share
R2(config-isakmp)#group 2
R2(config-isakmp)#lifetime 86400
R2(config-isakmp)#exit
# 配置ike策略,引用加密套件
R2(config)#crypto isakmp profile ike_pro
R2(conf-isa-prof)#keyring default
R2(conf-isa-prof)#match identity address 20.1.1.1 255.255.255.255
R2(conf-isa-prof)#exit
# 配置感兴趣流
R2(config)#access-list 100 permit ip 40.1.1.0 0.0.0.255 10.1.1.0 0.0.0.255
# 配置ike二阶段算法,以及ike二阶段协商模式
R2(config)#crypto ipsec transform-set ipsec_tra esp-des esp-md5-hmac
R2(cfg-crypto-trans)#mode tunnel
R2(cfg-crypto-trans)#exit
# 配置map信息,引用ike一阶段和二阶段以及感兴趣流
R2(config)#crypto map ipsec_map 1 ipsec-isakmp
R2(config-crypto-map)#set peer 20.1.1.1
R2(config-crypto-map)#set transform-set ipsec_tra
R2(config-crypto-map)#set isakmp-profile ike_pro
R2(config-crypto-map)#match add 100
R2(config-crypto-map)#exit
# 接口引用map
R2(config)#interface e1/1
R2(config-if)#crypto map ipsec_map
R2(config-if)#exit

路由配置

R2(config)#ip route 20.1.1.0 255.255.255.0 30.1.1.1
R2(config)#ip route 10.1.1.0 255.255.255.0 30.1.1.1
R2(config)#end

R3配置

接口配置

R3#configure terminal
R3(config)#interface e1/2
R3(config-if)#ip address 20.1.1.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#interface e1/1
R3(config-if)#ip address 30.1.1.1 255.255.255.0
R3(config-if)#no shutdown
R3(config)#end

R4配置

接口配置

R4#configure terminal
R4(config)#interface e1/3
R4(config-if)#ip address 10.1.1.2 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#interf e1/2
R4(config-if)#no shutdown
R4(config-if)#ip address 20.1.1.1 255.255.255.0
R4(config-if)#exit

IPSec配置

R4(config)#crypto isakmp key 123456 address 30.1.1.2 255.255.255.255  # 设置ike预共享密钥及对端IP
# 设置加密套件
R4(config)#crypto isakmp policy 1
R4(config-isakmp)#encryption 3des
R4(config-isakmp)#hash sha
R4(config-isakmp)#authentication pre-share
R4(config-isakmp)#group 2
R4(config-isakmp)#lifetime 86400
R4(config-isakmp)#exit
# 配置ike策略,引用加密套件
R4(config)#crypto isakmp profile ike_pro
R4(conf-isa-prof)#keyring default
R4(conf-isa-prof)#match identity address 30.1.1.2 255.255.255.255
R2(conf-isa-prof)#exit
# 配置感兴趣流
R4(config)#access-list 100 permit ip 10.1.1.0 0.0.0.255 40.1.1.0 0.0.0.255
# 配置ike二阶段算法,以及ike二阶段协商模式
R4(config)#crypto ipsec transform-set ipsec_tra esp-des esp-md5-hmac
R4(cfg-crypto-trans)#mode tunnel
R4(cfg-crypto-trans)#exit
# 配置map信息,引用ike一阶段和二阶段以及感兴趣流
R4(config)#crypto map ipsec_map 1 ipsec-isakmp
R4(config-crypto-map)#set peer 30.1.1.2
R4(config-crypto-map)#set transform-set ipsec_tra
R4(config-crypto-map)#set isakmp-profile ike_pro
R4(config-crypto-map)#match address 100
R4(config-crypto-map)#exit
# 接口引用map
R4(config)#interface e1/2
R4(config-if)#crypto map ipsec_map
R4(config-if)#exit

路由配置

R4(config)#ip route 40.1.1.0 255.255.255.0 20.1.1.2
R4(config)#ip route 30.1.1.0 255.255.255.0 20.1.1.2

R5配置

接口配置

R5#configure terminal
R5(config)#interface e1/3
R5(config-if)#no shutdown
R5(config-if)#ip address 10.1.1.1 255.255.255.0
R5(config-if)#exit

路由配置

R5(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2

调试命令


查看IKEv1协商过程
        debug crypto isakmp
查看IPSec转发过程
        debug crypto ipsec
查看IPSec配置
        show running-config | section crypto
查看IPSec sa
        show crypto ipsec sa
查看map 信息
show crypto map

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值