一 实验拓扑
二 实验需求
底层igp为ospf
要求R1和R3使用GRE over ipsec进行通信
第一阶段使用 加密算法3des,哈希算法是sha,认证密钥是ruijie
三 实验分析
IPsec是如今十分主流的分支机构互联VXN协议,其本身强大的加密与验证功能保障了在互联网传递时私网数据的安全,但是面对当前多元化的访问需求,Ipsec VXN并不能满足客户对私网网段之间复杂的互访要求;在实际环境中,分隔两地的机构要求通过VXN隧道建立私网之间的路由邻居关系,而Ipsec VXN本身并不具备传递路由的能力,所以GRE over IPSEC技术应运而生。
首先完成ospf基础配置
完成gre隧道的配置,使用ospf让R1和R3隧道口地址能通信
配置IP sec,包括第一阶段认证方式、认证密钥、第二阶段认证方式
四 实验配置
4.1配置两侧隧道口
R1:
R1(config)#int tunnel 0
R1(config-if-Tunnel 0)#tunnel source 12.1.1.1
R1(config-if-Tunnel 0)#tunnel destination 23.1.1.3
R1(config-if-Tunnel 0)#ip address 13.1.1.1 24
R3:
R3(config)#int tunnel 0
R3(config-if-Tunnel 0)#tunnel source 23.1.1.3
R3(config-if-Tunnel 0)#tunnel destination 12.1.1.1
R3(config-if-Tunnel 0)#ip address 13.1.1.3 24
4.2 使用ospf完成互通
R1(config)#router ospf 300
R1(config-router)#network 13.1.1.0 0.0.0.255 area 0
R3(config)#router ospf 300
R3(config-router)#network 13.1.1.0 0.0.0.255 area 0
测试:
4.3ip sec配置
4.3.1 配置感性其流(前后地址是隧道口的物理接口地址)
R1:
R1(config)#access-list 100 permit ip host 12.1.1.1 host 23.1.1.3
R3:
R3(config)#access-list 100 permit ip host 23.1.1.3 host 12.1.1.1
4.3.2 配置第一阶段认证策略,本次实验举例使用加密算法3des,哈希算法是sha
R1:
R1(config)#crypto isakmp policy 1
R1(isakmp-policy)#authentication pre-share
R1(isakmp-policy)#hash sha
R1(isakmp-policy)#encryption 3des
R2:
R2(config)#crypto isakmp policy 1
R2(isakmp-policy)#authentication pre-share
R2(isakmp-policy)#hash sha
R2(isakmp-policy)#encryption 3des
4.3.3配置预共享密钥给对端,注意此处为对端隧道接口ip地址,共享密钥ruijie,密钥两端要一致
R1:
R1(config)#crypto isakmp key 0 ruijie address 23.1.1.3
R3:
R3(config)#crypto isakmp key 0 ruijie address 12.1.1.1
4.3.4配置第二阶段协商认证
R1:
R1(config)#crypto ipsec transform-set ruijie esp-3des esp-md5-hmac
R3:
R3(config)#crypto ipsec transform-set ruijie esp-3des esp-md5-hmac
4.3.5 配置加密图并调用在接口
R1:
R1(config)#crypto map ruijie 5 ipsec-isakmp
R1(config-crypto-map)#set peer 23.1.1.3
R1(config-crypto-map)#set transform-set ruijie
R1(config-crypto-map)#match address 100
R1(config)#int g0/0
R1(config-if-GigabitEthernet 0/0)#crypto map ruijie
R3:
R3(config)#crypto map ruijie 4 ipsec-isakmp
R3(config-crypto-map)#set peer 12.1.1.1
R3(config-crypto-map)#match address 100
R3(config-crypto-map)#set transform-set ruijie
R3(config)#int g0/0
R3(config-if-GigabitEthernet 0/0)#crypto map ruijie
实验现象:
邻居断后又重新建立
测试:
实验成功
欢迎各位大佬在评论区或私信批评指正!!