实验目的
掌握OSPF的区域汇总
掌握OSPF的简单口令以及MD5认证
掌握如何修改hello、dead间隔及cost的值
实验要求:做area 1 在向Area 0通告时进行汇总
在R1与R2 之间做区域的简单口令认证
在R2与R3之间做区域的MD5认证
修改R3、R4之间的hello、dead间隔为5、20
修改R4的S2/1口的cost为80
在所有路由器上开启OSPF邻居日志
实验拓扑
实验步骤
步骤1 进行底层配置
R1#
configure terminal
R1(config)# interface s2/1
R1(config-if)# ip address 12.0.0.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# interface loopback0
R1(config-if)# ip address 172.16.1.1 255.255.255.0
R1(config-if)# interface loopback1
R1(config-if)# ip address 172.16.2.1 255.255.255.0
R1(config-if)# interface loopback 2
R1(config-if)# ip address 172.16.3.1 255.255.255.0
R1(config-if)# interface loopback 3
R1(config-if)# ip address 172.16.4.1 255.255.255.0
R1(config)# interface s2/1
R1(config-if)# ip address 12.0.0.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# interface loopback0
R1(config-if)# ip address 172.16.1.1 255.255.255.0
R1(config-if)# interface loopback1
R1(config-if)# ip address 172.16.2.1 255.255.255.0
R1(config-if)# interface loopback 2
R1(config-if)# ip address 172.16.3.1 255.255.255.0
R1(config-if)# interface loopback 3
R1(config-if)# ip address 172.16.4.1 255.255.255.0
R2#
configure terminal
R2(config)#
interface serial2/1
R2(config-if)# ip address 12.0.0.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# interface s2/2
R2(config-if)# ip address 23.0.0.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# ip address 12.0.0.2 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# interface s2/2
R2(config-if)# ip address 23.0.0.2 255.255.255.0
R2(config-if)# no shutdown
R3#
configure terminal
R3(config)# interface serial2/1
R3(config-if)# ip address 23.0.0.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# interface serial 2/2
R3(config-if)# ip address 34.0.0.3 255.255.255.0
R3(config-if)# no shutdown
R3(config)# interface serial2/1
R3(config-if)# ip address 23.0.0.3 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# interface serial 2/2
R3(config-if)# ip address 34.0.0.3 255.255.255.0
R3(config-if)# no shutdown
R4(config)#
interface serial 2/1
R4(config-if)# ip address 34.0.0.4 255.255.255.0
R4(config-if)# no shutdown
R4(config-if)# ip address 34.0.0.4 255.255.255.0
R4(config-if)# no shutdown
步骤2 在网络中各个路由器开启OSPF协议
R1(config)# router ospf 100
R1(config-router)# network 172.16.1.1 0.0.0.255 area 1
R1(config-router)# network 172.16.2.1 0.0.0.255 area 1
R1(config)# router ospf 100
R1(config-router)# network 172.16.1.1 0.0.0.255 area 1
R1(config-router)# network 172.16.2.1 0.0.0.255 area 1
R1(config-router)#
network 172.16.3.1 0.0.0.255 area 1
R1(config-router)# network 172.16.4.1 0.0.0.255 area 1
R1(config-router)# network 12.0.0.0 0.0.0.255 area 1
R1(config-router)# log-adjacency-changes //打开OSPF邻居状态日志
R1(config-router)# network 172.16.4.1 0.0.0.255 area 1
R1(config-router)# network 12.0.0.0 0.0.0.255 area 1
R1(config-router)# log-adjacency-changes //打开OSPF邻居状态日志
R2(config)#
router ospf 100
R2(config-router)# network 12.0.0.0 0.0.0.255 area 1
R2(config-router)# network 23.0.0.0 0.0.0.255 area 0
R2(config-router)# log-adjacency-changes
R2(config-router)# network 12.0.0.0 0.0.0.255 area 1
R2(config-router)# network 23.0.0.0 0.0.0.255 area 0
R2(config-router)# log-adjacency-changes
R3(config)#
router ospf 100
R3(config-router)# network 23.0.0.0 0.0.0.255 area 0
R3(config-router)# network 34.0.0.0 0.0.0.255 area 2
R3(config-router)# network 23.0.0.0 0.0.0.255 area 0
R3(config-router)# network 34.0.0.0 0.0.0.255 area 2
R3(config-router)#
log-adjacency-changes
R4(config)#
router ospf 100
R4(config-router)# network 34.0.0.0 0.0.0.255 area 2
R4(config-router)# network 34.0.0.0 0.0.0.255 area 2
步骤2 在R2上对区域1进行路由汇总
R2(config)#
router ospf 100
R2(config-router)# area 1 range 172.16.0.0 255.255.248.0
R2(config-router)# area 1 range 172.16.0.0 255.255.248.0
步骤3 在R2与R3之间做区域的MD5认证
R2(config)#
interface serial2/2
R2(config-if)# ip ospf message-digest-key 1 md5 cisco //定义认证密钥
R2(config-if)# exit
R2(config)# router ospf 100
R2(config-router)# area 0 authentication message-digest //在区域0中开启认证
R2(config-if)# ip ospf message-digest-key 1 md5 cisco //定义认证密钥
R2(config-if)# exit
R2(config)# router ospf 100
R2(config-router)# area 0 authentication message-digest //在区域0中开启认证
R3(config-router)#
interface serial2/1
R3(config-if)#
ip ospf message-digest-key 1 md5 cisco
R3(config-if)# router ospf 100
R3(config-router)# area 0 authentication message-digest
R3(config-if)# router ospf 100
R3(config-router)# area 0 authentication message-digest
步骤4 修改hello、dead间隔的值
R3(config)#
interface serial2/2
R3(config-if)# ip ospf hello-interval 5
R3(config-if)# ip ospf hello-interval 5
R3(config-if)#
ip ospf dead-interval 20
R4(config)#
interface serial2/1
R4(config-if)# ip ospf hello-interval 5
R4(config-if)# ip ospf dead-interval 20
R4(config-if)# ip ospf hello-interval 5
R4(config-if)# ip ospf dead-interval 20
步骤5 修改R4上的serial2/1接口的cost
R4(config)#
interface s2/1
R4(config-if )#ip ospf cost 80
R4(config-if )#ip ospf cost 80
使用命令show ip ospf interface s0查看修改结果,包括RID,优先级,所属区域,计时器以及开销值等信息。
R4#
show ip ospf interface serial 2/1
Serial2/1 is up, line protocol is up
Internet Address 34.0.0.4/24, Area 2
Process ID 100, Router ID 34.0.0.4, Network Type POINT_TO_POINT, Cost: 80
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
Hello due in 00:00:00
Index 1/1, flood queue length 0
Next 0×0(0)/0×0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 34.0.0.3
Serial2/1 is up, line protocol is up
Internet Address 34.0.0.4/24, Area 2
Process ID 100, Router ID 34.0.0.4, Network Type POINT_TO_POINT, Cost: 80
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 5, Dead 20, Wait 20, Retransmit 5
Hello due in 00:00:00
Index 1/1, flood queue length 0
Next 0×0(0)/0×0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 34.0.0.3
OSPF常用show 命令:
show ip protocol | 显示路由器上运行的所有路由选择协议 |
show ip router | 显示完整的路由表 |
show ip ospf | 显示ospf路由进程的基本信息 |
show ip ospf interface | 显示接口的ospf相关信息 |
show ip ospf interface fastethernet0/0 | 显示特定接口F0/0的ospf信息 |
show ip ospf border-rotuers | 显示所有边界路由信息 |
show ip ospf neighbor | 显示ospf的邻居表 |
show ip ospf neighbor detail | 显示ospf邻居的详细信息 |
show ip ospf database | 显示ospf的数据库 |
©著作权归作者所有:来自51CTO博客作者ljp0501的原创作品,如需转载,请注明出处,否则将追究法律责任
职场 休闲 OSPF扩展实验
Cisco 学习
0
收藏
上一篇:RIP扩展实验 下一篇:VTP配置