OSPF环境下的MGRE实验

一:实验要求

二:实验步骤

 1.搭建拓扑

2.规划IP并配置

 R1


[r1]interface LoopBack 0
[r1-LoopBack0]ip add 1.1.1.1 24
[r1]interface g 0/0/01
[r1-GigabitEthernet0/0/1]ip add 15.0.0.1 24
Jan 28 2024 12:11:27-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]q

[r1]interface g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 25.0.0.1 24
Jan 28 2024 12:19:00-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]q
缺省路由   
[r1]ip route-static 0.0.0.0 0 15.0.0.2

R3

  
[r3]interface LoopBack 0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3-LoopBack0]q
[r3]interface g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 35.0.0.1 24
Jan 28 2024 12:12:34-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]q
缺省路由
[r3]ip route-static 0.0.0.0 0 35.0.0.2 

 R4

[r4]interface LoopBack 0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4-LoopBack0]q  
[r4]interface g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 45.0.0.1 24
Jan 28 2024 12:13:23-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]q
缺省路由
[r4]ip route-static 0.0.00.0 0 45.0.0.02 
[r4]q

R5

[r5]interface LoopBack 0
[r5-LoopBack0]ip add 5.5.5.5 24
[r5-LoopBack0]q
[r5]interface g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 55.0.0.01 24
Jan 28 2024 12:14:03-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r5-GigabitEthernet0/0/0]q
缺省路由
[r5]ip route-static 0.0.0.0 0 55.0.0.2 

R6

[r6]interface LoopBack 0
[r6-LoopBack0]ip add 6.6.6.6 24
[r6-LoopBack0]q
[r6]interface g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 65.0.0.1 24
Jan 28 2024 12:14:51-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r6-GigabitEthernet0/0/0]q
缺省路由  
[r6]ip route-static 0.0.00.0 0 65.0.0.2 

ISP 


[r2]interface LoopBack 0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]q
 [r2]interface g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 25.0.0.2 24
Jan 28 2024 12:15:50-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]int    
[r2]interface g 0/0/01
[r2-GigabitEthernet0/0/1]ip add 15.0.0.2 24
Jan 28 2024 12:16:07-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]q
[r2]int    
[r2]interface g 0/00/2
[r2-GigabitEthernet0/0/2]ip add 35.00.0.2 24 
[r2-GigabitEthernet0/0/2]
Jan 28 2024 12:16:34-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[r2-GigabitEthernet0/0/2]q
[r2]int    
[r2]interface g 4/0/0
[r2-GigabitEthernet4/0/0]ip add 45.0.0.2 24
[r2-GigabitEthernet4/0/0]
Jan 28 2024 12:16:52-08:00 r2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 
[r2-GigabitEthernet4/0/0]q   
[r2]interface g 4/0/1
[r2-GigabitEthernet4/0/1]ip add 55.0.0.2 24
[r2-GigabitEthernet4/0/1]
Jan 28 2024 12:17:13-08:00 r2 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet4/0/1 has entered the UP state. 
[r2-GigabitEthernet4/0/1]q
[r2]interface g 4/0/2
[r2-GigabitEthernet4/0/2]ip add 65.0.0.2 24
[r2-GigabitEthernet4/0/2]
Jan 28 2024 12:18:39-08:00 r2 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet4/0/2 has entered the UP state. 
[r2-GigabitEthernet4/0/2]q

3.R1-R5-R6建立hub-spoke的MGRE环境,其中R1为中心

R1 (中心站点)

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]source 15.0.0.1
Jan 29 2024 17:26:07-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state.   
[r1-Tunnel0/0/0]nhrp network-id 100
 

R5

 [r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip add 192.168.5.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/0]source GigabitEthernet 0/0/0
Jan 29 2024 17:31:20-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 

R6

[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]ip add 192.168.5.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/0]source GigabitEthernet 0/0/0
Jan 29 2024 17:33:43-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 
 

测试连通性

4.R1-R3-R4构建全连的MGRE环境

意思就是R1 R3 R4分别做一次中心站点但是nhrp network-id一定要设不同的值,为避免冲突情况下建议隧道接口采用不同的值。因基本原理一样我们以R1为例作为示例

R1作为中心站点时:

中心站点R1

[r1]interface Tunnel 0/0/01
[r1-Tunnel0/0/1]IP ADD 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol GRE p2mp 
[r1-Tunnel0/0/1]source 25.0.0.1 
[r1-Tunnel0/0/1]nhrp network-id 50

分支R3

[r3]interface Tunnel 0/0/01
[r3-Tunnel0/0/1]ip add 192.168.6.2 24
[r3-Tunnel0/0/1]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/1]source GigabitEthernet 0/0/0
[r3-Tunnel0/0/1]nhrp network-id 50
[r3-Tunnel0/0/1]nhrp entry 192.168.6.1 25.0.0.1 register 

 分支站点R4

[r4-Tunnel0/0/1]ip add 192.168.6.3 24
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp 
[r4-Tunnel0/0/1]source GigabitEthernet 0/0/0
Jan 29 2024 18:27:35-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/1 has entered the UP state. 
[r4-Tunnel0/0/1]nhrp network-id 50
[r4-Tunnel0/0/1]nhrp entry 192.168.6.1 25.0.0.1 register 
[r4-Tunnel0/0/1]q

测试连通

 

 

 

  • 19
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值