IPSec配置

要求:

1、R5为ISP只能配置IP地址

2、R1,R2,R3建立MGRE环境,R1为中心站点

3、R1环回192.168.1.0/24,R2-R4类似

4、R1,R2,R3使用OSPF

5、R1--R4间建立IPSec VPN

 

R1

int s0/1

ip add 15.1.1.1 255.255.255.0

no shutdown

int lo0

ip add 192.168.1.1 255.255.255.0

int t0 

ip add 10.1.1.1 255.255.255.0

no shutdown

tunnel source s0/1

tunnel mode gre mu

ip nhrp map multicast dy

ip nhrp network-id 100

ip route 0.0.0.0 0.0.0.0 15.1.1.5

 

R2

int s0/2

ip add 25.1.1.2 255.255.255.0

no shutdown

int lo0

ip add 192.168.2.2 255.255.255.0

int t0 

ip add 10.1.1.2 255.255.255.0

no shutdown

tunnel source s0/1

tunnel mode gre mu

ip nhrp nhs 10.1.1.1

ip nhrp map 10.1.1.1 15.1.1.1

ip nhrp network-id 100

ip nhrp map multicast 15.1.1.1

ip route 0.0.0.0 0.0.0.0 15.1.1.5

 

R3

int s0/3

ip add 35.1.1.3 255.255.255.0

no shutdown

int lo0

ip add 192.168.3.3 255.255.255.0

int t0 

ip add 10.1.1.3 255.255.255.0

no shutdown

tunnel source s0/1

tunnel mode gre mu

ip nhrp nhs 10.1.1.1

ip nhrp map 10.1.1.1 15.1.1.1

ip nhrp network-id 100

ip nhrp map multicast 15.1.1.1

ip route 0.0.0.0 0.0.0.0 15.1.1.5

 

R4

int s0/0

ip add 45.1.1.4 255.255.255.0

no shutdown

int lo0

ip add 192.168.4.4 255.255.255.0

ip route 0.0.0.0 0.0.0.0 15.1.1.5

 

R5

int s0/1

ip add 15.1.1.5 255.255.255.0

no shutdown

int s0/2

ip add 25.1.1.5 255.255.255.0

no shutdown

int s0/3

ip add 35.1.1.5 255.255.255.0

no shutdown

int s0/0

ip add 45.1.1.5 255.255.255.0

no shutdown

至此,MGRE环境配置完成

起OSPF

R1

router ospf 1

router-id 1.1.1.1

network 10.1.1.1 0.0.0.0 a 0

network 192.168.1.1 0.0.0.0 a 0

 

R2

router ospf 1

router-id 2.2.2.2

network 10.1.1.2 0.0.0.0 a 0

network 192.168.2.2 0.0.0.0 a 0

 

R3

router ospf 1

router-id 3.3.3.3

network 10.1.1.3 0.0.0.0 a 0

network 192.168.3.3 0.0.0.0 a 0

 

由于tunnel 0在ospf中默认的工作方式为点到点,当R1和R2,R3都要建邻时就会出现路由翻滚。

解决方法:应修改tunnel口的工作方式为点到多点或广播。如果修改为广播,需要注意DR位置。

R1,R2,R3

int t0

ip ospf network point-to-mutlipoint

IPSec VPN

R1

access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.4.0 0.0.0.255    

R1的私有地址访问R4的私有地址时才走IPSec VPN

crypto isakmp policy 10

encryption 3des

hash md5

authentication pre-share

group 2

crypto isakmp key 6 cisco123 address 45.1.1.4   传到R4,定义共享秘钥为cisco123;

 

crypto ipsec transform-set xxx esp-3des esp-md5-hmac

mode tunnel   

 

crypto map openlab 10 ipsec-isakmp

set transform-set xxx

set peer 45.1.1.4

match address 100

调用

interface s0/1

crypto map openlab

R4

access-list 100 permit ip 192.168.4.0 0.0.0.255 192.168.1.0 0.0.0.255    

crypto isakmp policy 10

encryption 3des

hash md5

authentication pre-share

group 2

crypto isakmp key 6 cisco123 address 15.1.1.1

crypto ipsec transform-set xxx esp-3des esp-md5-hmac

mode tunnel   

crypto map openlab 10 ipsec-isakmp

set transform-set xxx

set peer 15.1.1.1

match address 100

interface s0/0

crypto map openlab

注:VPN的建立需要流量的触发。

QM表示隧道建立完成

  • 3
    点赞
  • 44
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
配置IPsec的步骤如下: 1. 配置IP地址。 2. 配置路由。 3. 添加兴趣流。 4. 配置ike安全提议。 5. 配置ike对等体。 6. 配置ipsec安全提议。 7. 配置ipsec安全策略。 8. 在接口应用ipsec安全策略。 具体来说,IPsec配置包括以下步骤: 1. 首先,配置IP地址,确保主机或设备拥有正确的IP地址。 2. 然后,配置路由,以确保数据包可以正确地转发到目标地址。 3. 接下来,添加感兴趣流(interesting traffic),指定需要进行IPsec加密和认证的流量。 4. 配置ike安全提议,设置ike协商过程中所使用的加密算法、认证算法等参数。 5. 配置ike对等体,指定与对端设备之间进行ike建立安全关联的相关参数。 6. 配置ipsec安全提议,设置ipsec加密和认证所使用的算法。 7. 配置ipsec安全策略,确定哪些流量需要进行ipsec保护。 8. 最后,在接口上应用ipsec安全策略,确保流经该接口的流量得到适当的保护。 根据引用中的配置示例,可以看到在ipsec安全策略中使用了sha2-256算法进行认证,使用了3des算法进行加密。 总结来说,enspipsec配置的步骤包括IP地址、路由、兴趣流、ike安全提议、ike对等体、ipsec安全提议、ipsec安全策略和接口应用ipsec安全策略。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [ensp上ipsec的简单配置](https://blog.csdn.net/m0_46626894/article/details/115324689)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值