OSPF综合实验

实验要求:
1.如图连接,合理规划IP地址,所有路由器各自创建一个loopback接口
2.R1再创建三个接口IP地址为201.1.1.1/24、201.1.2.1/24、201.1.3.1/24
R5再创建三个接口IP地址为202.1.1.1/24、202.1.2.1/24、202.1.3.1/24
R7再创建三个接口IP地址为203.1.1.1/24、203.1.2.1/24、203.1.3.1/24
3.如图运行路由协议
R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,
部署OSPF网络,MGRE修改为BMA网络类型
4.area 1 区域不得出现4.5类LSA
5.其他区域优先通过R3访问R1 三个环回接口
6.尽量减少路由条目数量
7.area 1 区域增加安全性
8.全网可达

如图:

一、topo如下

 二、进行接口配置

R1:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int l0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 201.1.1.1 24
[R1-LoopBack1]int l2
[R1-LoopBack2]ip add 201.1.2.1 24
[R1-LoopBack2]int l3
[R1-LoopBack3]ip add 201.1.3.1 24
[R1-LoopBack3]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 18.1.1.1 24
Jul 31 2021 23:34:49-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 18.1.1.2
R2:


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int l0
[R2-LoopBack0]ip add 2.2.2.2 24
[R2-LoopBack0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 28.1.1.1 24
Jul 31 2021 23:42:29-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R2-GigabitEthernet0/0/1]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 24.1.1.1 24
Jul 31 2021 23:42:41-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]q
[R2]ip route-static 0.0.0.0 0 28.1.1.2
R3:



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int l0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]int g0/0/2
[R3-GigabitEthernet0/0/2]ip add 38.1.1.1 24
Jul 31 2021 23:43:18-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R3-GigabitEthernet0/0/2]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 34.1.1.1 24
Jul 31 2021 23:43:31-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R3-GigabitEthernet0/0/1]q
[R3]ip route-static 0.0.0.0 0 38.1.1.2
R4:


<Huawei>
Jul 31 2021 23:41:24-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt
hernet0/0/0 has turned into UP state.
<Huawei>
Jul 31 2021 23:41:27-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[1]:Interface GigabitEt
hernet4/0/0 has turned into UP state.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int l0
[R4-LoopBack0]ip add 4.4.4.4 24
[R4-LoopBack0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
Jul 31 2021 23:44:20-08:00 R4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 24.1.1.2 24
Jul 31 2021 23:44:40-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip add 34.1.1.2 24
Jul 31 2021 23:44:50-08:00 R4 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R4-GigabitEthernet0/0/2]int g4/0/0
[R4-GigabitEthernet4/0/0]ip add 46.1.1.1 24
Jul 31 2021 23:45:06-08:00 R4 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 
[R4-GigabitEthernet4/0/0]
R5:


<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R5
[R5]int l0
[R5-LoopBack0]ip add 5.5.5.5 24
[R5-LoopBack0]int l1
[R5-LoopBack1]ip add 202.1.1.1 24
[R5-LoopBack1]int l2
[R5-LoopBack2]ip add 202.1.2.1 24
[R5-LoopBack2]int l3
[R5-LoopBack3]ip add 202.1.3.1 24
[R5-LoopBack3]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 45.1.1.2 24
Jul 31 2021 23:47:01-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
R6:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R6
[R6]int l0
[R6-LoopBack0]ip add 6.6.6.6 24
[R6-LoopBack0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip add 46.1.1.2 24
Jul 31 2021 23:48:53-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R6-GigabitEthernet0/0/1]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 67.1.1.1 24
Jul 31 2021 23:49:01-08:00 R6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R6-GigabitEthernet0/0/0]
R7:



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R7
[R7]int l0
[R7-LoopBack0]ip add 7.7.7.7 24
[R7-LoopBack0]int l1
[R7-LoopBack1]ip add 203.1.1.1 24
[R7-LoopBack3]in l2
[R7-LoopBack2]ip add 203.1.2.1 24
[R7-LoopBack2]int l3
[R7-LoopBack3]ip add 203.1.3.1 24
[R7-LoopBack3]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 67.1.1.2 24
Jul 31 2021 23:50:42-08:00 R7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R7-GigabitEthernet0/0/1]
R8:



<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys ISP
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 18.1.1.2 24
Jul 31 2021 23:51:51-08:00 ISP %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[ISP-GigabitEthernet0/0/0]int g0/0/1
[ISP-GigabitEthernet0/0/1]ip add 28.1.1.2 24
Jul 31 2021 23:51:59-08:00 ISP %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[ISP-GigabitEthernet0/0/1]int g0/0/2
[ISP-GigabitEthernet0/0/2]ip add 38.1.1.2 24
Jul 31 2021 23:52:12-08:00 ISP %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[ISP-GigabitEthernet0/0/2]

二、配置相关的路由协议

R1:

<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]ospf 100 ro 91.1.1.1
[R1-ospf-100]area 0
[R1-ospf-100-area-0.0.0.0]net 1.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]net 201.1.0.0 0.0.255.255
[R1-ospf-100-area-0.0.0.0]net 18.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]
R2:


<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]ospf 100 ro 92.2.2.2
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]net 2.2.2.2 0.0.0.0
[R2-ospf-100-area-0.0.0.0]net 28.1.1.1 0.0.0.0
[R2-ospf-100-area-0.0.0.0]area 1
[R2-ospf-100-area-0.0.0.1]net 24.1.1.1 0.0.0.0
[R2-ospf-100-area-0.0.0.1]
R3:


<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]ospf 100 ro 93.3.3.3
[R3-ospf-100]area 0
[R3-ospf-100-area-0.0.0.0]net 38.1.1.1 0.0.0.0
[R3-ospf-100-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[R3-ospf-100-area-0.0.0.0]area 1
[R3-ospf-100-area-0.0.0.1]net 34.1.1.1 0.0.0.0
[R3-ospf-100-area-0.0.0.1]
R4:


<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]ospf 100 ro 94.4.4.4
[R4-ospf-100]area 1
[R4-ospf-100-area-0.0.0.1]net 4.4.4.4 0.0.0.0
[R4-ospf-100-area-0.0.0.1]net 24.1.1.2 0.0.0.0
[R4-ospf-100-area-0.0.0.1]net 34.1.1.2 0.0.0.0
[R4-ospf-100-area-0.0.0.1]area 2
[R4-ospf-100-area-0.0.0.2]net 46.1.1.1 0.0.0.0
[R4-ospf-100-area-0.0.0.2]rip 200
[R4-rip-200]ver 2
[R4-rip-200]net 45.0.0.0
[R4-rip-200]import-route o	
[R4-rip-200]import-route ospf 100
[R4-rip-200]ospf 100
[R4-ospf-100]i	
[R4-ospf-100]import-route rip 200
[R4-ospf-100]
R5:


<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]rip 200
[R5-rip-200]ver 2
[R5-rip-200]net 5.0.0.0
[R5-rip-200]net 202.1.0.0
[R5-rip-200]
R6:


<R6>sys
Enter system view, return user view with Ctrl+Z.
[R6]ospf 100 ro 96.6.6.6
[R6-ospf-100]area 2
[R6-ospf-100-area-0.0.0.2]net 6.6.6.6 0.0.0.0
[R6-ospf-100-area-0.0.0.2]net 46.1.1.2 0.0.0.0
[R6-ospf-100-area-0.0.0.2]rip 100
[R6-rip-100]ver 2
[R6-rip-100]net 67.0.0.0
[R6-rip-100]q
[R6]ospf 100
[R6-ospf-100]import-route r	
[R6-ospf-100]import-route rip 100
[R6-ospf-100]rip 100
[R6-rip-100]i	
[R6-rip-100]import-route o	
[R6-rip-100]import-route ospf 100
[R6-rip-100]
R7:



<R7>sys
Enter system view, return user view with Ctrl+Z.
[R7]rip 100
[R7-rip-100]ver 2
[R7-rip-100]net 7.0.0.0
[R7-rip-100]net 203.1.0.0
[R7-rip-100]net 67.0.0.0
[R7-rip-100]
R8:



<ISP>sys
Enter system view, return user view with Ctrl+Z.
[ISP]ospf 100 ro 98.8.8.8
[ISP-ospf-100]area 0
[ISP-ospf-100-area-0.0.0.0]net 18.1.1.2 0.0.0.0
[ISP-ospf-100-area-0.0.0.0]net 28.1.1.2 0.0.0.0
[ISP-ospf-100-area-0.0.0.0]net 38.1.1.2 0.0.0.0

 三、R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,
部署OSPF网络,MGRE修改为BMA网络类型

R1:


[R1]int t0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R1-Tunnel0/0/0]source 18.1.1.1
Aug  1 2021 00:15:28-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
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
R2:


[R2]int t0/0/0
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/0]source 28.1.1.1
[R2-Tunnel0/0/0]ip add 10.1.1.2 24
Aug  1 2021 00:17:22-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 	
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 18.1.1.1 re	
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 18.1.1.1 register 
[R2-Tunnel0/0/0]
R3:



<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]int t0/0/0
[R3-Tunnel0/0/0]ip add 10.1.1.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source 38.1.1.1
Aug  1 2021 00:19:10-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.1.1 18.1.1.1 register 
[R3-Tunnel0/0/0]

如图:

R1:

 R2:

R3:

  四、area 1 区域不得出现4.5类LSA,因为stub区域不允许重发布,所以使用NSSA特殊区域

R2:


[R2-Tunnel0/0/0]q
[R2]ospf 100
[R2-ospf-100]area 1
[R2-ospf-100-area-0.0.0.1]nssa
R3:


[R3]ospf 100
[R3-ospf-100]area 1
[R3-ospf-100-area-0.0.0.1]nssa
[R3-ospf-100-area-0.0.0.1]
R4:


[R4]ospf 100
[R4-ospf-100]area 1
[R4-ospf-100-area-0.0.0.1]nssa

如图:

R2:

 

 R3:

 

 R4:

 

五、 将环回接口类型更改为broadcast

R1:

<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]int l0
[R1-LoopBack0]o	
[R1-LoopBack0]ospfn	
[R1-LoopBack0]ospf n	
[R1-LoopBack0]ospf network-type b	
[R1-LoopBack0]ospf network-type broadcast 
[R1-LoopBack0]int l1
[R1-LoopBack1]ospf ne	
[R1-LoopBack1]ospf network-type b	
[R1-LoopBack1]ospf network-type broadcast 
[R1-LoopBack1]int l2
[R1-LoopBack2]ospf ne	
[R1-LoopBack2]ospf network-type b	
[R1-LoopBack2]ospf network-type broadcast 
[R1-LoopBack2]int l3
[R1-LoopBack3]ospf ne	
[R1-LoopBack3]ospf network-type b	
[R1-LoopBack3]ospf network-type broadcast 
[R1-LoopBack3]int t0/0/0
[R1-Tunnel0/0/0]ospf n	
[R1-Tunnel0/0/0]ospf network-type b	
[R1-Tunnel0/0/0]ospf network-type broadcast 
[R1-Tunnel0/0/0]
R2:

<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]int l0
[R2-LoopBack0]ospf n	
[R2-LoopBack0]ospf network-type b	
[R2-LoopBack0]ospf network-type broadcast 
[R2-LoopBack0]int t0/0/0
[R2-Tunnel0/0/0]ospf n	
[R2-Tunnel0/0/0]ospf network-type b	
[R2-Tunnel0/0/0]ospf network-type broadcast 
[R2-Tunnel0/0/0]
R3:

<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]ip route-static 0.0.0.0 0 38.1.1.2
[R3]int l0	
[R3-LoopBack0]ospf network-type b	
[R3-LoopBack0]ospf network-type broadcast 
[R3-LoopBack0]int t0/0/0
[R3-Tunnel0/0/0]ospf network-type b	
[R3-Tunnel0/0/0]ospf network-type broadcast 
[R3-Tunnel0/0/0]
R4:

<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]int l0
[R4-LoopBack0]os	
[R4-LoopBack0]ospf n	
[R4-LoopBack0]ospf network-type  b	
[R4-LoopBack0]ospf network-type  broadcast 
[R4-LoopBack0]

六、R1-R2-R3网络类型为BMA

 七、全网可达

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值