认识OSPF数据库,调试OSPF

实验4-4:认识OSPF数据库,调试OSPF

【实验目的】:
在本次实验中,将使用show命令查看链路状态数据库(LSDB)结构。你也会使用和观察OSPF的根区域
为了完成本次实验,你需要完成下列任务:
  • 认识OSPF LSDB结构
  • 认识一些LSDB数据工具
  • 使用OSPF区域路由汇总限制路由表的尺寸和更新数据包。
  • 使用OSPF根区域限制路由表的尺寸和更新数据包。
【实验拓扑】:
【命令列表】:
命令
描述
(config-router)#area x stub
配置一个区域为存根区域。使用一条缺省路由到达边区域界路由器,代替被阻止的第五类LSA(外部路由)。
(config-router)#area x stub no-summary
配置一个完全存根区域,使用一条缺省路由到达区域边界路由器,代替被阻止的第345LSA(区域间和外部路由)
Show ip ospf database
显示LSDB
Show ip ospf database external
显示外部的LSAs(LSA type 5)
【实验帮助】:
如果出现任何问题,可以向在值的辅导老师提出并请求提供帮助。
【任务一】:测试OSPF数据库
实验过程:
第一步:使用show ip ospf database命令显示OSPF数据库。OSPF数据库显示了所有存储在路由器上的LSAs。使用下面的表解释OSPF数据库。
  • 你在OSPF有看到第12345类的LSA吗?
  • 在边界路由器上,你看到了area 0area xLSA吗?
  • 在内部路由器,你是否仅看到了area xLSA信息?
使用下面的表格解决OSPF数据库中的一些信息:
栏目
提供的信息
ADV Rouer
发布路由器的RID
Age
LSA 的老化时间
Checksum
LSA 校正和内容
Link Count
路由器接口的数量。
每一个串口计算为两个连接,每一个以太网接口计算为一个连接
Link ID
序列号,用于发现更旧的和重复的LSA
Tag
有目的的设备某条路由是从一个特定的重分布进程进入的。
 
第二步:使用show ip ospf database external命令显示OSPF数据库中的所有第五类LSAs。这个核心路由器BBR2重分布网络10.254.0.0/24OSPF。确定这个网络10.254.0.0是第五类LSA路由。
你的边界路由器输出应该与下列类似:
P1R2#sh ip os da external
OSPF Router with ID ( 10.1.0 .2) (Process ID 1)
Type-5 AS External Link States
Routing Bit Set on this LSA
LS age: 39
Options: (No TOS-capability, DC)
LS Type: AS External Link
Link State ID: 10.254.0.0 (External Network Number )
Advertising Router: 172.31.1.3
LS Seq Number: 80000001
Checksum: 0x4D 7A
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 0.0.0 .0
External Route Tag: 0
【任务二】:OSPF区域路由汇总
在本次任务中,你将认识OSPF路由汇总带来的好处。路由汇总减少路由表的尺寸,减少路由更新数据包和最小化线路抖动(flapping)的影响。另外,路由汇总还能最小化路由器内存和CPU需求。
实验过程:
第一步:在边界路由器PxR1PxR2上,在OSPF路由进程下使用area range命令汇总这个机架area x网络10.x.0.0/16
第二步:从边界路由器上TELNETBBR2路由器(172.31.xx.4),测试BBR2的路由表。
现在BBR2路由器学习了两个路径到达网络10.x.0.0/16BBR2路由器将不再学习每一个连接(10.x.0.0/24, 10.x.1.0/24, 10.x.2.0/24, 10.x.3.0/24)
BBR2
路由器也需要学习网络10.xx.0.0/24,那是因为这个网络不是路由汇总范围中的一部分。
你的显示输出应该与下列类似:
BBR2#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
Gateway of last resort is not set
172.31.0.0/16 is variably subnetted, 4 subnets, 2 masks
O 172.31.1.0/24 [110/128] via 172.31.11.2, 00:00:04, Serial0
[110/128] via 172.31.11.1, 00:00:04, Serial 0
C 172.31.11.0/24 is directly connected, Serial0
O 172.31.11.1/32 [110/64] via 172.31.11.1, 00:00:04, Serial0
O 172.31.11.2/32 [110/64] via 172.31.11.2, 00:00:04, Serial0
10.0.0 .0/8 is variably subnetted, 3 subnets, 2 masks
O I A 10.11.0 .0/24 [110/128] via 172.31.11.1, 00:00:04, Serial0
[110/128] via 172.31.11.2, 00:00:04, Serial0
O I A 10.1.0 .0/16 [110/74] via 172.31.11.1, 00:00:04, Serial0
[110/74] via 172.31.11.2, 00:00:05, Serial0
O E2 10.254.0.0/24 [110/20] via 172.31.11.2, 00:00:05, Serial0
[110/20] via 172.31.11.1, 00:00:05, Serial0
BBR2#
第三步:在边界路由器上验证路由汇总如何更改路由表。在边界路由器上路由表是否有缩小?解释为什么这里会有一条路由到Null 0接口。你的显示应该与下列类似:
P1R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.31.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 172.31.1.0/24 is directly connected, Serial 0
C 172.31.11.0/24 is directly connected, Serial0.1
O 172.31.11.1/32 [110/64] via 172.31.1.1, 00:01:58, Serial0
O 172.31.11.4/32 [110/64] via 172.31.11.4, 00:01:58, Serial0.1
10.0.0 .0/8 is variably subnetted, 7 subnets, 2 masks
C 10.11.0.0/24 is directly connected, Serial0.2
O 10.1.3.0/24 [110/74] vi a 10.1.2 .4, 00:01:27, Ethernet 0
C 10.1.2.0/24 is directly connected, Ethernet0
O 10.1.1.0/24 [110/74] vi a 10.11.0 .1, 00:01:28, Serial0.2
[110/74] vi a 10.1.0 .1, 00:01:28, Serial 1
C 10.1.0.0/24 is directly connected, Serial1
O 10.1.0.0/16 is a summary, 00:01:28, Null0
O E2 10.254.0.0/24 [110/20] via 172.31.1.3, 00:01:30, Serial0
P1R2#
第四步:配置机架中的OSPF区域为存根区域(记住因为存根标记是包括在HELLO包中,需要配置两个边界路由器和内部路由器)。注意这里的错误消息和如果两个路由器之间没有完全同意存根区域这里是没有邻接关系是建立的。在配置路由器为存根区域的,你期望有什么样问题发生?
第五步:测试边界路由器(PxR1PxR2)和内部路由器(PxR3PxR4)的路由表。确定这里有域间和域内路由,以及他们出现的理由。
注意在内部躜上器上并没有任何外部路由。自助ABR(边界路由器)产生一条缺省路由到内部路由器到达外部网络。你的输出应该与下列类似:
P1R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.31.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 172.31.1.0/24 is directly connected, Serial 0
C 172.31.11.0/24 is directly connected, Serial0.1
O 172.31.11.2/32 [110/64] via 172.31.1.2, 00:00:55, Serial0
O 172.31.11.4/32 [110/64] via 172.31.11.4, 00:00:55, Serial0.1
10.0.0 .0/8 is variably subnetted, 7 subnets, 2 masks
C 10.11.0.0/24 is directly connected, Serial0.2
O 10.1.3.0/24 [110/74] vi a 10.1.1 .3, 00:00:00, Ethernet0
O 10.1.2.0/24 [110/74] vi a 10.11.0 .2, 00:00:01, Serial0.2
[110/74] vi a 10.1.0 .2, 00:00:01, Serial 1
C 10.1.1.0/24 is directly connected, Ethernet 0
C 10.1.0.0/24 is directly connected, Serial1
O 10.1.0.0/16 is a summary, 00:00:01, Null0
O E2 10.254.0.0/24 [110/20] via 172.31.1.3, 00:00:01, Serial0

P1R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 10.1.1 .1 to network 0.0.0.0
172.31.0.0/16 is variably subnetted, 4 subnets, 2 masks
O IA 172.31.1.0/24 [110/74] vi a 10.1.1 .1, 00:00:31, Ethernet0
O IA 172.31.11.1/32 [110/10] vi a 10.1.1 .1, 00:00:31, Ethernet0
O IA 172.31.11.2/32 [110/74] vi a 10.1.1 .1, 00:00:31, Ethernet0
[110/74] vi a 10.1.3 .4, 00:00:31, Serial0
O IA 172.31.11.4/32 [110/74] vi a 10.1.1 .1, 00:00:31, Ethernet0
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
O 10.11.0.0/24 [110/74] vi a 10.1.1 .1, 00:00:32, Ethernet 0
C 10.200.200.13/32 is directly connected, Loopback 0
C 10.1.3.0/24 is directly connected, Serial0
O 10.1.2.0/24 [110/74] vi a 10.1.3 .4, 00:00:32, Serial 0
C 10.1.1.0/24 is directly connected, Ethernet0
O 10.1.0.0/24 [110/74] vi a 10.1.1 .1, 00:00:32, Ethernet0
O*IA 0.0.0.0/0 [110/11] vi a 10.1.1 .1, 00:00:33, Ethernet0
第六步:配置OSPF路由器为完全存根区域。记住,仅仅ABR是需要被配置为完全存根区域。
第七步:通过PING TFTP服务器验证连接的正确性。
第八步:测试这个边界路由器(PxR1PxR2)和内部路由器(PxR3PxR4)的路由表。
确定在内部路由器上是否有域间OSPF路由,出现的理由是什么?你的输出应该与下列输出类似:
P1R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.31.0.0/16 is variably subnetted, 4 subnets, 2 masks
C 172.31.1.0/24 is directly connected, Serial 0
C 172.31.11.0/24 is directly connected, Serial0.1
O 172.31.11.2/32 [110/64] via 172.31.1.2, 00:01:16, Serial0
O 172.31.11.4/32 [110/64] via 172.31.11.4, 00:01:16, Serial0.1
10.0.0 .0/8 is variably subnetted, 7 subnets, 2 masks
C 10.11.0.0/24 is directly connected, Serial0.2
O 10.1.3.0/24 [110/74] vi a 10.1.1 .3, 00:01:16, Ethernet0
O 10.1.2.0/24 [110/74] vi a 10.11.0 .2, 00:01:17, Serial0.2
[110/74] vi a 10.1.0 .2, 00:01:17, Serial 1
C 10.1.1.0/24 is directly connected, Ethernet 0
C 10.1.0.0/24 is directly connected, Serial1
O 10.1.0.0/16 is a summary, 00:01:17, Null0
O E2 10.254.0.0/24 [110/20] via 172.31.1.3, 00:01:18, Serial0
P1R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 10.1.1 .1 to network 0.0.0.0
10.0.0 .0/8 is variably subnetted, 6 subnets, 2 masks
O 10.11.0.0/24 [110/74] vi a 10.1.1 .1, 00:05:32, Ethernet 0
C 10.200.200.13/32 is directly connected, Loopback 0
C 10.1.3.0/24 is directly connected, Serial0
O 10.1.2.0/24 [110/74] vi a 10.1.3 .4, 00:05:32, Serial 0
C 10.1.1.0/24 is directly connected, Ethernet0
O 10.1.0.0/24 [110/74] vi a 10.1.1 .1, 00:05:32, Ethernet0
O*IA 0.0.0.0/0 [110/11] vi a 10.1.1 .1, 00:05:32, Ethernet0
【实验验证】:
成功完成整个实验,你需要完成下列任务:
  • 你有认识了OSPF数据库,并认识了调查链路状态数据库(LSDB)的工具。
  • 你有配置你的实验路由器区域是OSPF存根区域和完全存根区域。
  • 你有在不影响网络可达性的条件下,使用路由汇总最小化路由表。你应该还是能够PING通你的实验设备和网络核心。
【路由器配置】:
P1R1:
P1R1#sh run
Building configuration...
Current configuration : 1210 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname P1R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
no ip domain lookup
!
!
!
!
interface Ethernet0
ip address 10.1.1 .1 255.255.255.0
!
interface Serial0
ip address 172.31.1.1 255.255.255.0
encapsulation frame-relay
frame-relay map ip 172.31.1.3 111 broadcast
no frame-relay inverse-arp
!
interface Serial0.1 multipoint
ip address 172.31.11.1 255.255.255.0
ip ospf network point-to-multipoint
frame-relay map ip 172.31.11.4 211 broadcast
no frame-relay inverse-arp
!
interface Serial0.2 point-to-point
ip address 10.11.0.1 255.255.255.0
frame-relay interface-dlci 122
!
interface Serial1
ip address 10.1.0.1 255.255.255.0
clockrate 64000
!
router ospf 1
router-id 10.1.0.1
log-adjacency-changes
area 1 stub no-summary
area 1 range 10.1.0.0 255.255.0.0
network 10.1.0.0 0.0.255.255 area 1
network 10.11.0.0 0.0.0.255 area 1
network 172.31.1.0 0.0.0.255 area 0
network 172.31.11.0 0.0.0.255 area 0
!
no ip http server
ip classless
!
!
!
!
line con 0
exec-timeout 30 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end
P1R2:
P1R2#sh run
Building configuration...
Current configuration : 1213 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname P1R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
no ip domain lookup
!
!
!
!
interface Ethernet0
ip address 10.1.2 .2 255.255.255.0
!
interface Serial0
ip address 172.31.1.2 255.255.255.0
encapsulation frame-relay
ip ospf priority 0
frame-relay map ip 172.31.1.3 112 broadcast
no frame-relay inverse-arp
!
interface Serial0.1 multipoint
ip address 172.31.11.2 255.255.255.0
ip ospf network point-to-multipoint
frame-relay map ip 172.31.11.4 212 broadcast
no frame-relay inverse-arp
!
interface Serial0.2 point-to-point
ip address 10.11.0.2 255.255.255.0
frame-relay interface-dlci 221
!
interface Serial1
ip address 10.1.0.2 255.255.255.0
!
router ospf 1
router-id 10.1.0.2
log-adjacency-changes
area 1 stub no-summary
area 1 range 10.1.0.0 255.255.0.0
network 10.1.0.0 0.0.255.255 area 1
network 10.11.0.0 0.0.0.255 area 1
network 172.31.1.0 0.0.0.255 area 0
network 172.31.11.0 0.0.0.255 area 0
!
no ip http server
ip classless
!
!
!
!
line con 0
exec-timeout 30 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
end
P1R3:
P1R3#sh run
Building configuration...
Current configuration : 635 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname P1R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
!
interface Loopback0
ip address 10.200.200.13 255.255.255.255
!
interface Ethernet0
ip address 10.1.1 .3 255.255.255.0
!
interface Serial0
ip address 10.1.3.3 255.255.255.0
clockrate 64000
!
interface Serial1
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
area 1 stub
network 10.1.0.0 0.0.255.255 area 1
!
no ip http server
ip classless
!
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
!
End
P1R4:
P1R4#sh run
Building configuration...
Current configuration : 674 bytes
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname P1R4
!
!
ip subnet-zero
!
!
!
interface Loopback0
ip address 10.200.200.14 255.255.255.255
no ip directed-broadcast
!
interface Ethernet0
ip address 10.1.2 .4 255.255.255.0
no ip directed-broadcast
ip ospf priority 0
!
interface Serial0
ip address 10.1.3.4 255.255.255.0
no ip directed-broadcast
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
router ospf 1
log-adjacency-changes
area 1 stub
network 10.1.0.0 0.0.255.255 area 1
!
ip classless
no ip pim bidir-enable
!
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
 

本文出自 “butter520” 博客,转载请与作者联系!

你可能感兴趣的:(职场,休闲,调试OSPF,认识OSPF数据库)