OSPF环境中在ABR上过滤类型3的LSA—测试
测试—在未应用LSA过滤前,看下ospf数据库的内容
- R1#show ip ospf database
- OSPF Router with ID (1.1.1.1) (Process ID 1)
- Router Link States (Area 0)
- Link ID ADV Router Age Seq# Checksum Link count
- 1.1.1.1 1.1.1.1 21 0x80000004 0x0010BC 1
- 2.2.2.2 2.2.2.2 21 0x80000002 0x00D5EF 1
- Net Link States (Area 0)
- Link ID ADV Router Age Seq# Checksum
- 10.1.1.2 2.2.2.2 21 0x80000001 0x002CEB
- Summary Net Link States (Area 0)
- Link ID ADV Router Age Seq# Checksum
- 192.168.1.0 1.1.1.1 161 0x80000001 0x00B815
- 192.168.2.0 1.1.1.1 161 0x80000001 0x00AD1F
- 192.168.3.0 1.1.1.1 161 0x80000001 0x00A229
- 192.168.4.0 2.2.2.2 352 0x80000001 0x00794D
- 192.168.5.0 2.2.2.2 352 0x80000001 0x006E57
- 192.168.6.0 2.2.2.2 352 0x80000001 0x006361
- Router Link States (Area 1)
- Link ID ADV Router Age Seq# Checksum Link count
- 1.1.1.1 1.1.1.1 161 0x80000004 0x00CFF1 3
- Summary Net Link States (Area 1)
- Link ID ADV Router Age Seq# Checksum
- 10.1.1.0 1.1.1.1 17 0x80000003 0x00509A
- 192.168.4.0 1.1.1.1 12 0x80000001 0x001A70
- 192.168.5.0 1.1.1.1 12 0x80000001 0x000F7A
- 192.168.6.0 1.1.1.1 12 0x80000001 0x000484
发现区域0的类型3的LSA有6条,分别是由R1、R2通告的。区域1的类型3的LSA有4条,都是由R1通告的。
测试—查看 R1的路由表
- R1#show ip route ospf
- O IA 192.168.4.0/24 [110/65] via 10.1.1.2, 00:03:20, Serial0
- O IA 192.168.5.0/24 [110/65] via 10.1.1.2, 00:03:20, Serial0
- O IA 192.168.6.0/24 [110/65] via 10.1.1.2, 00:03:20, Serial0
发现是3条区域间路由
测试—现在在R1上应用LSA过滤
现在在R1上应用LSA过滤过滤进去区域1,允许前缀为192.168.4.0/24的LSA,限制其他前缀的。
- R1(config)#ip prefix-list lsa3in permit 192.168.4.0/24
- R1(config-router)#area 1 filter-list prefix lsa3in in
查看R1的数据库
- R1#show ip ospf database
- OSPF Router with ID (1.1.1.1) (Process ID 1)
- Router Link States (Area 0)
- Link ID ADV Router Age Seq# Checksum Link count
- 1.1.1.1 1.1.1.1 568 0x80000004 0x0010BC 1
- 2.2.2.2 2.2.2.2 568 0x80000002 0x00D5EF 1
- Net Link States (Area 0)
- Link ID ADV Router Age Seq# Checksum
- 10.1.1.2 2.2.2.2 569 0x80000001 0x002CEB
- Summary Net Link States (Area 0)
- Link ID ADV Router Age Seq# Checksum
- 192.168.1.0 1.1.1.1 709 0x80000001 0x00B815
- 192.168.2.0 1.1.1.1 709 0x80000001 0x00AD1F
- 192.168.3.0 1.1.1.1 709 0x80000001 0x00A229
- 192.168.4.0 2.2.2.2 900 0x80000001 0x00794D
- 192.168.5.0 2.2.2.2 900 0x80000001 0x006E57
- 192.168.6.0 2.2.2.2 900 0x80000001 0x006361
- Router Link States (Area 2)
- Link ID ADV Router Age Seq# Checksum Link count
- 1.1.1.1 1.1.1.1 709 0x80000004 0x00CFF1 3
- Summary Net Link States (Area 2)
- Link ID ADV Router Age Seq# Checksum
- 192.168.4.0 1.1.1.1 554 0x80000001 0x001A70
发现区域0的6条类型3的LSA都在,而区域2的类型3的LSA只有一条192.168.4.0,也就是前缀列表中允许的。
查看R1的路由表
- R1#show ip route ospf
- O IA 192.168.4.0/24 [110/65] via 10.1.1.2, 00:05:04, Serial0
- O IA 192.168.5.0/24 [110/65] via 10.1.1.2, 00:05:04, Serial0
- O IA 192.168.6.0/24 [110/65] via 10.1.1.2, 00:05:04, Serial0
【编辑推荐】