OSPF综合实验

目录

要求

分析

构建拓扑图结构

​编辑 配置

1.区域0

 区域1

区域2

区域3

区域4

验证


要求

分析

1.子网划分为4个,区域0,1,2各一个,区域3,4共一个,然后根据需要再细化

2.区域1做完全末梢,区域4的R9需要做重发布,区域2的R12需要做完全nssa,来达到减少路由条目数量

构建拓扑图结构

 配置

1.区域0

R3

<Huawei>sys

[r3]int g0/0/1

[r3-GigabitEthernet0/0/1]ip add 172.16.8.2 21        //地址配置

[r3]ip route-static 0.0.0.0 0 172.16.8.1        //缺省路由

[r3]int t0/0/0

[r3-Tunnel0/0/0]ip add 12.1.1.1 24                //MGRE配置

[r3-Tunnel0/0/0]tunnel-protocol gre p2mp        //选择多点

[r3-Tunnel0/0/0]nhrp entry multicast dynamic        //注册中心

[r3-Tunnel0/0/0]nhrp network-id 100        

[r3-Tunnel0/0/0]undo rip split-horizon        //关掉水平分割

[r3]ospf 1 router-id 3.3.3.3                //ospf配置

[r3-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255        //宣告

[r3]int t0/0/0

[r3-Tunnel0/0/0]ospf network-type broadcast        //接口类型修改为broadcast

R4

<Huawei>sys

[ISP]int g0/0/0                //地址配置

[ISP-GigabitEthernet0/0/0]ip add 172.16.8.1 21

[ISP-GigabitEthernet0/0/0]int g0/0/2

[ISP-GigabitEthernet0/0/2]ip add 172.16.24.1 21

[ISP-GigabitEthernet0/0/2]int g4/0/0

[ISP-GigabitEthernet4/0/0]ip add 172.16.56.1 21

[ISP-GigabitEthernet4/0/0]int g0/0/1

[ISP-GigabitEthernet0/0/1]ip add 172.16.40.1 21

[ISP-GigabitEthernet0/0/1]int loo 0

[ISP-LoopBack0]ip add 172.16.0.1 21

R5

<Huawei>sys

[Huawei]sysn r5

[r5]int g0/0/0

[r5-GigabitEthernet0/0/0]ip add 172.16.24.2 21        //地址配置

[r5-GigabitEthernet0/0/0]int loo 1

[r5-LoopBack1]ip add 172.16.0.1 21        //环回配置

[r5-LoopBack1]q

[r5]ip route-static 0.0.0.0 0 172.16.24.1        //缺省路由配置

[r5]int t0/0/0

[r5-Tunnel0/0/0]ip add 12.1.1.2 24

[r5-Tunnel0/0/0]tunnel-protocol gre p2mp

[r5-Tunnel0/0/0]source 172.16.24.2

[r5-Tunnel0/0/0]nhrp entry 12.1.1.1 172.16.8.2 register        //到中心注册

[r5-Tunnel0/0/0]nhrp network-id 100

[r5]ospf 1 router-id 5.5.5.5

[r5-ospf-1]area 0

[r5-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255        

[r5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255

[r5-Tunnel0/0/0]ospf network-type broadcast

R6

<Huawei>sys

[Huawei]sysn r6

[r6]int g0/0/0

[r6-GigabitEthernet0/0/0]ip add 172.16.40.2 21

[r6-LoopBack2]ip add 172.16.32.1 21

[r6-LoopBack2]q

[r6]ip route-static 0.0.0.0 0 172.16.40.1

<r6>sys

[r6]int t0/0/0

[r6-Tunnel0/0/0]ip add 12.1.1.3 24

[r6-Tunnel0/0/0]tunnel-protocol gre p2mp

[r6-Tunnel0/0/0]source 172.16.40.2

[r6-Tunnel0/0/0]nhrp entry 12.1.1.1 172.16.8.2 register        //注册

[r6-Tunnel0/0/0]nhrp network-id 100

<r6>sys

[r6]ospf 1 router-id 6.6.6.6

[r6-ospf-1]area 0

[r6-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255        //宣告

[r6-ospf-1-area-0.0.0.0]network 172.16.32.0 0.0.7.255

[r6-ospf-1-area-0.0.0.0]int t0/0/0

[r6-Tunnel0/0/0]ospf dr-priority 0        //放弃选举

<r6>sys

[r6]int t0/0/0

[r6-Tunnel0/0/0]ospf network-type broadcast

R7

<Huawei>sys

[Huawei]sysn r7

[r7]int g0/0/0

[r7-GigabitEthernet0/0/0]ip add 172.16.56.2 21

[r7-LoopBack3]ip add 172.16.48.1 21

[r7-LoopBack3]q

[r7]ip route-static 0.0.0.0 0 172.16.56.1

<r7>sys

[r7]int t0/0/0

[r7-Tunnel0/0/0]ip add 12.1.1.4 24

[r7-Tunnel0/0/0]tunnel-protocol gre p2mp

[r7-Tunnel0/0/0]source 172.16.56.2

[r7-Tunnel0/0/0]nhrp entry 12.1.1.1 172.16.8.2 register

[r7-Tunnel0/0/0]nhrp network-id 100

<r7>sys

[r7]ospf 1 router-id 7.7.7.7

[r7-ospf-1]area 0

[r7-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255

[r7-ospf-1-area-0.0.0.0]network 172.16.48.0 0.0.7.255

[r7-ospf-1-area-0.0.0.0]int t0/0/0

[r7-Tunnel0/0/0]ospf dr-priority 0        //放弃选举

[r7-Tunnel0/0/0]ospf network-type broadcast

[r7-ospf-1-area-0.0.0.0]abr-summary 172.16.0.0 255.255.192.0        //区域0汇总

 区域1

R1

<Huawei>sys                

[Huawei]sysn r1

[r1]int g0/0/0                                                        //地址配置

[r1-GigabitEthernet0/0/0]ip add 172.16.64.2 20

[r1-GigabitEthernet0/0/0]int loo 4

[r1-LoopBack4]ip add 172.16.80.1 20

[r1-LoopBack4]q  

[r1]ospf 1 router-id 1.1.1.1        //ospf配置

[r1-ospf-1]area 1

[r1-ospf-1-area-0.0.0.1]network 172.16.64.0 0.0.15.255

[r1-ospf-1-area-0.0.0.1]network 172.16.80.0 0.0.15.255

R2

<Huawei>sys

<Huawei>sysn r2

[r2]int g0/0/0

[r2-GigabitEthernet0/0/0]ip add 172.16.64.3 20

[r2-GigabitEthernet0/0/0]int loo 8

[r2-LoopBack8]ip add 172.16.96.1 20

[r2-LoopBack8]q

[r2]ospf 1 router-id 2.2.2.2

[r2-ospf-1]area 1

[r2-ospf-1-area-0.0.0.1]network 172.16.64.0 0.0.15.255

[r2-ospf-1-area-0.0.0.1]network 172.16.96.0 0.0.15.255

R3

<r3>sys

[r3]int g0/0/0

[r3-GigabitEthernet0/0/0]ip add 172.16.64.1 20

[r3-GigabitEthernet0/0/0]int loo 9

[r3-LoopBack9]ip add 172.16.112.1 20

[r3-LoopBack9]q

[r3]ospf 1 router-id 3.3.3.3

[r3-ospf-1]are

[r3-ospf-1]area 1

[r3-ospf-1-area-0.0.0.1]network 172.16.64.0 0.0.15.255

[r3-ospf-1-area-0.0.0.1]network 172.16.112.0 0.0.15.255

区域汇总配置

<r3>sys

[r3]ospf 1 r

[r3]ospf 1 router-id 3.3.3.3

[r3-ospf-1]area 0

[r3-ospf-1-area-0.0.0.0]abr-summary 172.16.0.0 255.255.192.0

[r3-ospf-1-area-0.0.0.0]q

[r3-ospf-1]area 1

[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.64.0 255.255.192.0

完全末梢配置

<r1>sys

[r1]ospf 1 router-id 1.1.1.1

[r1-ospf-1]area 1

[r1-ospf-1-area-0.0.0.1]stub

<r2>sys

[r2]ospf 1 router-id 2.2.2.2

[r2-ospf-1]area 1

[r2-ospf-1-area-0.0.0.1]stub

[r3]ospf 1 router-id 3.3.3.3

[r3-ospf-1]area 1

[r3-ospf-1-area-0.0.0.1]stub

[r3-ospf-1-area-0.0.0.1]stub no-summary

区域2

地址配置

R6

<r6>sys

[r6]int g0/0/1

[r6-GigabitEthernet0/0/1]ip add 172.16.160.1 19

R11

<Huawei>sys

[Huawei]sysn r11

[r11]int g0/0/0

[r11-GigabitEthernet0/0/0]ip add 172.16.160.2 19

[r11-GigabitEthernet0/0/0]int g0/0/1

[r11-GigabitEthernet0/0/1]ip add 172.16.144.1 20

[r11-GigabitEthernet0/0/1]int loo 10

[r11-LoopBack10]ip add 172.16.128.1 20

R12

<Huawei>sys

[Huawei]sysn r12

[r12]int g0/0/0

[r12-GigabitEthernet0/0/0]ip add 172.16.144.2 20

[r12-GigabitEthernet0/0/0]int loo 11

[r12-LoopBack11]ip add 10.0.0.1 25

[r12-LoopBack11]int loo 12

[r12-LoopBack12]ip add 10.0.0.129 25

完全NSSA配置

[r6]ospf 1 router-id 6.6.6.6     

[r6-ospf-1]area 2

[r6-ospf-1-area-0.0.0.2]network 172.16.160.0 255.255.224.0

[r6-ospf-1-area-0.0.0.2]nssa no-summary 

<r11>sys

[r11]ospf 1 router-id 11.11.11.11    

[r11-ospf-1]area 2

[r11-ospf-1-area-0.0.0.2]network 172.16.160.0 255.255.224.0

[r11-ospf-1-area-0.0.0.2]network 172.16.128.0 255.255.224.0

[r11-ospf-1-area-0.0.0.2]nssa

<r12>sys

[r12-ospf-1]area 2

[r12-ospf-1-area-0.0.0.2]network 172.16.144.0 255.255.192.0

[r12-ospf-1-area-0.0.0.2]nssa

[r12-ospf-1-area-0.0.0.2]q

[r12-ospf-1]q

[r12]rip                //rip配置

[r12-rip-1]version 2

[r12-rip-1]network 10.0.0.0

[r12-rip-1]q

[r12]ospf 1 r

[r12]ospf 1 router-id 12.12.12.12

[r12-ospf-1]import-route rip        //宣告rip

[r12-ospf-1]asbr-summary 10.0.0.0 255.255.255.0        //汇总

<r6>sys

[r6]ospf 1 router-id 6.6.6.6

[r6-ospf-1]area 2

[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.128.0 255.255.192.0        //区域汇总

区域3

R7

<r7>sys

[r7]int g0/0/1

[r7-GigabitEthernet0/0/1]ip add 172.16.192.1 20

R8

<Huawei>sys

[Huawei]sysn r8

[r8]int g0/0/0

[r8-GigabitEthernet0/0/0]ip add 172.16.192.2 20

[r8-GigabitEthernet0/0/0]int g0/0/1

[r8-GigabitEthernet0/0/1]ip add 172.16.216.1 21

[r8-GigabitEthernet0/0/1]int loo 5

[r8-LoopBack5]ip add 172.16.208.1 21

R9

<Huawei>sys

[Huawei]sysn r9

[r9]int g0/0/0

[r9-GigabitEthernet0/0/0]ip add 172.16.216.2 21

[r7]ospf 1 router-id 7.7.7.7

[r7-ospf-1]area 3

[r7-ospf-1-area-0.0.0.3]network 172.16.192.0 255.255.240.0

[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.192.0 255.255.192.0

[r8]ospf 1 router-id 8.8.8.8

[r8-ospf-1]area 3

[r8-ospf-1-area-0.0.0.3]network 172.16.192.0 255.255.240.0

[r8-ospf-1-area-0.0.0.3]network 172.16.208.0 255.255.240.0

[r9]ospf 1 router-id 9.9.9.9

[r9-ospf-1]area 3

[r9-ospf-1-area-0.0.0.3]network 172.16.216.0 255.255.248.0

[r9-ospf-1-area-0.0.0.3]abr-summary 172.16.192.0 255.255.224.0        //区域汇总

区域4

[r9]int g0/0/1

[r9-GigabitEthernet0/0/1]ip add 172.16.248.1 21

[r9-GigabitEthernet0/0/1]int loo 6

[r9-LoopBack6]ip add 172.16.200.1 21

[r9]ospf 2 router-id 9.9.9.9

[r9-ospf-2]area 4

[r9-ospf-2-area-0.0.0.4]network 172.16.240.0 255.255.240.0

[r9-ospf-2-area-0.0.0.4]abr-summary 172.16.224.0 255.255.224.0

[r9-ospf-1]import-route ospf 2               //在1进程宣告2进程

[r9-ospf-2]import-route ospf 1                //在2进程宣告1进程

[Huawei]sysn r10

[r10]int g0/0/0

[r10-GigabitEthernet0/0/0]ip add 172.16.248.2 21

[r10-GigabitEthernet0/0/0]int loo 7

[r10-LoopBack7]ip add 172.16.224.1 20

[r10]ospf 1 router-id 10.10.10.10

[r10-ospf-1]area 4

[r10-ospf-1-area-0.0.0.4]network 172.16.248.0 255.255.248.0

[r10-ospf-1-area-0.0.0.4]network 172.16.224.0 255.255.240.0

[r10-GigabitEthernet0/0/0]ospf dr-priority 0

验证

这里只拿部分展示 

r1   ping    r12的环回

r1 ping  r10

r11的环回L11 ping R2的环回L8

r3   ping    L1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

维运

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值