您的位置:首页 > 其它

CCNP-11 OSPF试验7(BSCI)

2007-10-18 09:05 459 查看

CCNP-11 OSPF试验7

实验拓扑:



试验要求:R1 R2 R3
R4按照拓扑上连好,R1 R2
R4起OSPF,R3起RIPv2,首先把AREA 1设置为普通区域,并且配置R1重分布RIPv2路由到OSPF,观察R4上的LSDB的类型,然后再把AREA 1配置成为STUB区域,观察R4的LSDB有什么变化。
试验目的:掌握OSPF
STUB的配置方法,并且能够分析LSDB的变化。

实验配置:
R1:
R1(config)#int s1/0
R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#int s1/1
R1(config-if)#ip add 199.99.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shu

R2:
R2(config)#int s1/0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int s1/1
R2(config-if)#ip add 199.99.3.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shu
R2(config-if)#exit

R3:
R3(config)#int s1/0
R3(config-if)#ip add 199.99.2.2 255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit

R4:
R4(config)#int s1/0
R4(config-if)#ip add 199.99.3.2 255.255.255.0
R4(config-if)#no shu
R4(config-if)#exit

OK,基本的链路层配置完毕,然后用ping测试连通性,这里略,然后在R1
R2 R4上配置OSPF,R3 R1上配置RIP,并在R1上重分布RIP路由到OSPF中,都起loopback口:
R1(config)#int loop0
R1(config-if)#ip add 1.1.1.1
255.255.255.0
R1(config-if)#ip ospf network
point-to-point
R1(config-if)#exit
R1(config)#router ospf 100
R1(config-router)#network
199.99.1.0 0.0.0.255 area 0
R1(config-router)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 199.99.2.0
R1(config-router)#no auto-summary
R1(config-router)#exit
R1(config)#router ospf 100
R1(config-router)#redistribute
rip subnets
R1(config-router)#exit

R2(config)#int loop0
R2(config-if)#ip add 2.2.2.2
255.255.255.0
R2(config-if)#ip ospf network
point-to-point
R2(config-if)#exit
R2(config)#router ospf 100
R2(config-router)#network
199.99.1.0 0.0.0.255 area 0
R2(config-router)#network
199.99.3.0 0.0.0.255 area 1

R3(config)#int loop 0
R3(config-if)#ip add 3.3.3.3
255.255.255.0
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#network
199.99.2.0
R3(config-router)#network
3.3.3.0
R3(config-router)#no auto-summary
R3(config-router)#end

R4(config)#int loop0
R4(config-if)#ip add 4.4.4.4
255.255.255.0
R4(config-if)#ip ospf network
point-to-point
R4(config-if)#exit
R4(config)#router ospf 100
R4(config-router)#network
199.99.3.0 0.0.0.255 area 1

好了,注意每台路由器和不同路由协议所通告的网段,下面我们在R1 R2 R4上show ip route查看一下路由表:
R1#show 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

1.0.0.0/24
is subnetted, 1 subnets
C
1.1.1.0 is directly connected, Loopback0
3.0.0.0/24
is subnetted, 1 subnets
R
3.3.3.0 [120/1] via 199.99.2.2, 00:00:07,
Serial1/1
O IA 199.99.3.0/24
[110/128] via 199.99.1.2, 00:01:12, Serial1/0
C
199.99.2.0/24 is directly connected, Serial1/1
C
199.99.1.0/24 is directly connected, Serial1/0

R2#show 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

2.0.0.0/24
is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Loopback0
3.0.0.0/24
is subnetted, 1 subnets
O E2 3.3.3.0
[110/20] via 199.99.1.1, 00:00:02, Serial1/0
C
199.99.3.0/24 is directly connected, Serial1/1
O E2 199.99.2.0/24
[110/20] via 199.99.1.1, 00:00:08, Serial1/0
C
199.99.1.0/24 is directly connected, Serial1/0

R4#show 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

3.0.0.0/24
is subnetted, 1 subnets
O E2 3.3.3.0
[110/20] via 199.99.3.1, 00:00:08, Serial1/0
4.0.0.0/24
is subnetted, 1 subnets
C
4.4.4.0 is directly connected, Loopback0
C
199.99.3.0/24 is directly connected, Serial1/0
O E2 199.99.2.0/24
[110/20] via 199.99.3.1, 00:00:09, Serial1/0
O IA 199.99.1.0/24
[110/128] via 199.99.3.1, 00:00:35, Serial1/0

我们在R2和R4的路由表里发现了O E2和O IA路由,O E2表示从自治系统外部学到的路由,O IA表示从相同自治系统中不同区域学到的路由,下面我们show ip ospf database查看一下LSDB表:
R1#show ip ospf database

OSPF Router with ID (1.1.1.1) (Process ID
100)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 6 0x80000003 0x0046F0 2
2.2.2.2 2.2.2.2 29 0x80000004 0x00E051 2

Summary Net Link States (Area
0)

Link ID ADV Router
Age Seq# Checksum
199.99.3.0 2.2.2.2 28 0x80000001 0x00E0E5

Type-5
AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
199.99.2.0 1.1.1.1 5 0x80000001 0x00E589 0

以上为R1的LSDB,发现里面有LSA TYPE-1 and 3 and 5,由此我们可以知道R1为ASBR。

R2#show ip ospf database

OSPF Router with ID (2.2.2.2) (Process ID
100)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 15 0x80000003 0x0046F0 2
2.2.2.2 2.2.2.2 36 0x80000004 0x00E051 2

Summary Net Link States (Area
0)

Link ID ADV Router Age Seq# Checksum
199.99.3.0 2.2.2.2 35 0x80000001 0x00E0E5

Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 40
0x80000001 0x0083A2
2
4.4.4.4 4.4.4.4 40 0x80000002 0x00AF6D 2

Summary Net Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
199.99.1.0 2.2.2.2 40
0x80000001 0x00F6D1

Summary ASB Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 9 0x80000001 0x00935C

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
3.3.3.0 1.1.1.1 4 0x80000001 0x005D36 0
199.99.2.0 1.1.1.1 15 0x80000001 0x00E589 0

以上为R2的LSDB,发现它包含了两个区域的LSDB,说明它是一台ABR,同样我们可以看到LSA TYPE-1 and 3 and 5。

R4#show ip ospf database

OSPF Router with ID (4.4.4.4) (Process ID
100)

Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 47
0x80000001 0x0083A2 2
4.4.4.4 4.4.4.4 46 0x80000002 0x00AF6D 2

Summary Net Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
199.99.1.0 2.2.2.2 47 0x80000001 0x00F6D1

Summary ASB Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 16 0x80000001 0x00935C

Type-5 AS External Link States

Link ID
ADV Router Age Seq# Checksum Tag
3.3.3.0 1.1.1.1 12 0x80000001 0x005D36 0
199.99.2.0 1.1.1.1 22 0x80000001 0x00E589 0

以上为R4的LSDB,包含了LSA TYPE-1 and 3 and 4 and 5。

接下来我们把AREA 1配置成为STUB区域,看看LSDB有什么变化:
R2(config)#router ospf 100
R2(config-router)#area 1
stub

R4(config)#router ospf 100
R4(config-router)#area 1
stub
注意:area xx
stub这条命令要在STUB区域内的每台OSPF路由器上配置,否则无法成功建立邻居关系!然后我们在R4上clear ip route *,再show ip route查看,看看是否有什么变化?
R4#show 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 199.99.3.1 to
network 0.0.0.0

4.0.0.0/24
is subnetted, 1 subnets
C
4.4.4.0 is directly connected, Loopback0
C
199.99.3.0/24 is directly connected, Serial1/0
O IA 199.99.1.0/24 [110/128] via
199.99.3.1, 00:00:07, Serial1/0
O*IA
0.0.0.0/0 [110/65] via 199.99.3.1, 00:00:07, Serial1/0
R4#show 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

3.0.0.0/24
is subnetted, 1 subnets
O E2 3.3.3.0
[110/20] via 199.99.3.1, 00:00:08, Serial1/0
4.0.0.0/24
is subnetted, 1 subnets
C 4.4.4.0
is directly connected, Loopback0
C 199.99.3.0/24 is directly connected,
Serial1/0
O E2 199.99.2.0/24
[110/20] via 199.99.3.1, 00:00:09, Serial1/0
O IA 199.99.1.0/24
[110/128] via 199.99.3.1, 00:00:35, Serial1/0

发现了吗?原来的O E2路由没有了,变成了O*IA路由了,下一跳地址为ABR的接口地址,show ip
ospf database查看一下LSDB的变化:
R4#show ip ospf database

OSPF Router with ID (4.4.4.4) (Process ID
100)

Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 22 0x80000003 0x009D88 2
4.4.4.4 4.4.4.4 20 0x80000004 0x00C953 2

Summary Net Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 27 0x80000001 0x0075C0
199.99.1.0 2.2.2.2 27 0x80000002 0x0013B6
R4#show ip ospf database

OSPF Router with ID (4.4.4.4)
(Process ID 100)

Router Link States (Area 1)

Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 47 0x80000001 0x0083A2 2
4.4.4.4 4.4.4.4 46 0x80000002 0x00AF6D 2

Summary Net Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
199.99.1.0 2.2.2.2 47 0x80000001 0x00F6D1

Summary ASB Link States (Area
1)

Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 16 0x80000001 0x00935C

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
3.3.3.0 1.1.1.1 12 0x80000001 0x005D36 0
199.99.2.0 1.1.1.1 22 0x80000001 0x00E589 0

原来的LSA TYPE-4 and 5的LSA没有了,多了一条三类的默认路由,由此我们可以判断出STUB区域中的ABR将外部来的5类LSA转变为默认3类LSA后,再向区域内泛洪。这样配置后LSDB的体积明显小多了。

实验总结:掌握OSPF的特殊区域STUB区域的配置方法,理解STUB区域的作用,理解STUB区域的ABR将阻止外部传来的4和5类LSA洪泛到STUB区域内,并且将5类LSA转变为一条默认的3类LSA后,再向STUB区域内洪泛。

本文出自 “★Beckham~23” 博客,请务必保留此出处http://loveme23.blog.51cto.com/7891/46604
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: