Chinaunix首页 | 论坛 | 博客
  • 博客访问: 86050
  • 博文数量: 18
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 272
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-14 17:24
文章分类

全部博文(18)

文章存档

2011年(1)

2009年(17)

我的朋友

分类: 系统运维

2009-09-09 12:16:19

直接上图,这次画得还好看,哈哈
OSPF中集中路由器类型:
内部路由器:所有接口都属于一个区域的路由器;
区域边界路由器(ABR-Area borde router):连接一个或多个区域到骨干区域的路由器,路由器上的接口有多个区域。
骨干路由器:至少有一个接口于骨干区域相连的路由器
自治系统边界路由器(ASBR):OSPF域外部的通信量进入OSPF域的网管路由器。用来把其他路由选择协议学习到的路由通过路由选择重分配的方式注入到ospf域的路由器.
 
OSPF的区域类型
骨干区域:Area 0
标准区域:可以接受各种链路状态信息和汇总的路由通告,没有特殊定义的区域就是标准区域
末梢区域:只有一个默认路由作为其区域出口,区域不能作为虚链路的穿越区域;stub区域里无ASBR,不是骨干区域Area 0。
完全末梢区域:不仅使用默认路由到达ospf AS外的地址,而且使用默认路由到达区域外部的目的地址。(cisco私有)
非纯末梢区域
 
 
 
配IP比较费事,写了直接粘
R1
int s0/0
ip add 192.168.0.5 255.255.255.252
no shu
int s0/1
ip add 192.168.0.9 255.255.255.252
no shu
R2
int s0/0
ip add 192.168.0.6 255.255.255.252
no shu
int s0/2
ip add 192.168.1.5 255.255.255.252
no shu
int s0/3
ip add 192.168.1.9 255.255.255.252
no shu

R3
int s0/1
ip add 192.168.0.10 255.255.255.252
no shu
int s0/2
ip add 192.168.2.5 255.255.255.252
no shu
int s0/3
ip add 192.168.2.9 255.255.255.252
no shu
R4
int s0/2
ip add 192.168.1.6 255.255.255.252
no shu
int f1/0
ip add 192.168.1.13 255.255.255.252
no shu
R5
int s0/3
ip add 192.168.1.10 255.255.255.252
no shu
int f1/0
ip add 192.168.1.14 255.255.255.252
no shu
R6
int s0/2
ip add 192.168.2.6 255.255.255.252
no shu
int f1/0
ip add 192.168.2.13 255.255.255.252
no shu
R7
int s0/3
ip add 192.168.2.10 255.255.255.252
no shu
int f1/0
ip add 192.168.2.14 255.255.255.252
no shu
 
OSPF的配置:
R1:
R1(config)#router ospf 100
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 192.168.0.5 0.0.0.0 area 0
R1(config-router)#network 192.168.0.9 0.0.0.0 area 0
 
R2:
R2(config)#router ospf 100
R2(config-router)#router-id 2.2.2.2
R2(config-router)#net 192.168.0.6 0.0.0.0 area 0
R2(config-router)#net 192.168.1.5 0.0.0.0 area 1
R2(config-router)#net 192.168.1.9 0.0.0.0 area 1
 
R3:
R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.3
R3(config-router)#net 192.168.0.10 0.0.0.0 a 0
R3(config-router)#net 192.168.2.5 0.0.0.0 a 2
R3(config-router)#net 192.168.2.9 0.0.0.0 a 2
 
R4:
R4(config)#router ospf 100
R4(config-router)#router-id 4.4.4.4
R4(config-router)#net 192.168.1.6 0.0.0.0 a 1
R4(config-router)#net 192.168.1.13 0.0.0.0 a 1
 
R5:
R5(config)#router ospf 100
R5(config-router)#router-id 5.5.5.5
R5(config-router)#net 192.168.1.10 0.0.0.0 area 1
R5(config-router)#net 192.168.1.14 0.0.0.0 area 1
 
R6:
R6(config)#router ospf 100
R6(config-router)#router-id 6.6.6.6
R6(config-router)#net 192.168.2.6 0.0.0.0 area 2
R6(config-router)#net 192.168.2.13 0.0.0.0 area 2
 
R7:
R7(config)#router ospf 100
R7(config-router)#router-id 7.7.7.7
R7(config-router)#net 192.168.2.10 0.0.0.0 a 2
R7(config-router)#net 192.168.2.14 0.0.0.0 a 2
 
下面把区域1做成末梢区域:不接受ASBR发送的外部LSA,不过现在还没有其他AS的路由,在R7上起个回环,发布一个AS外部路由
 
R7(config)#int lo0
R7(config-if)#ip add 1.1.1.1 255.255.255.0
R7(config-if)#exit
R7(config)#router ospf 100
R7(config-router)#redistribute connected subnets #简单的重发布一个直连的子网,也可以用RIP等其他路由协议宣告网络来发布redistribute rip subnets {metric-type 1}#采用OE1,默认采用OE2
OE 2只记ASBR到外部网络的外部metric,OE 1还要计算OSPF内部metric。(有多个ASBR的时候使用OE 1可能比较好)
这样其他标准区域中就会有AS外的路由了。
R2上就会多一条E2的路由

R4#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
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/20] via 192.168.1.5, 00:00:06, Serial0/2
     192.168.0.0/30 is subnetted, 2 subnets
O IA    192.168.0.8 [110/192] via 192.168.1.5, 00:00:06, Serial0/2
……………………………………………………………………………………………………

现在把Area 1做成末梢区域,不接受AS外部的路由,即不接受ASBR的LSA类型(类型5)
R2(config-router)#area 1 stub
R4(config-router)#area 1 stub
R5(config-router)#area 1 stub
然后再查看R4上的路由,已经没有E2的路由了,但多出一条默认路由,即如果区域1中的路由器要到其他AS都从这个默认路由走

R4(config-router)#do 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 192.168.1.5 to network 0.0.0.0
     192.168.0.0/30 is subnetted, 2 subnets
O IA    192.168.0.8 [110/192] via 192.168.1.5, 00:00:07, Serial0/2
O IA    192.168.0.4 [110/128] via 192.168.1.5, 00:00:07, Serial0/2
     192.168.1.0/30 is subnetted, 3 subnets
O       192.168.1.8 [110/128] via 192.168.1.5, 00:00:07, Serial0/2
C       192.168.1.12 is directly connected, FastEthernet1/0
C       192.168.1.4 is directly connected, Serial0/2
     192.168.2.0/30 is subnetted, 3 subnets
O IA    192.168.2.8 [110/256] via 192.168.1.5, 00:00:07, Serial0/2
O IA    192.168.2.12 [110/257] via 192.168.1.5, 00:00:07, Serial0/2
O IA    192.168.2.4 [110/256] via 192.168.1.5, 00:00:07, Serial0/2
O*IA 0.0.0.0/0 [110/65] via 192.168.1.5, 00:00:07, Serial0/2

 
下面在把Area 1做成完全末梢区域:不接受ABR的LSA,即不需要知道其他区域的链路状态
直接在ABR上配置
R2(config-router)#area 1 stub no-summary
做完以后再看Area 1上的路由表,发现没有IA的路由,即AS内部区域的路由

R4#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 192.168.1.5 to network 0.0.0.0
     192.168.1.0/30 is subnetted, 3 subnets
O       192.168.1.8 [110/65] via 192.168.1.14, 16:07:10, FastEthernet1/0
C       192.168.1.12 is directly connected, FastEthernet1/0
C       192.168.1.4 is directly connected, Serial0/2
O*IA 0.0.0.0/0 [110/65] via 192.168.1.5, 00:00:15, Serial0/2

LSA(Link stat Advertisement):组成LSDB的材料
 
所有要到其他区域的都通过ABR的默认路由出去
LSA的通告类型
 
 
类型1 区域内路由器发的LSA
类型2 区域内DR给其他路由器的LSA
类型3 ABR给区域内其他路由器的关于其他区域链路状态的LSA (告诉其他区域的怎么去)
类型4 ABR给区域内其他路由器的关于ASBR的LSA (告诉区域内路由器哪些是ASBR)
类型5 ASBR发的告诉OSPF AS外部的目的地或者是到OSPF AS外部的默认路由。(告诉整个OSPF AS外部是怎么去)
类型7 从非纯末梢区域内(NSSA)的ASBR发出的LSA通告,同样是告诉ASBR外部相连的其他AS的信息,但是和类型5不同的就是它只在自己所属的NSSA区域内泛洪而不会对整个ospf AS泛洪。
 

LSA类型

 
类型 名称 由谁产生 内容 洪泛范围 备注 产生的路由条目
1 Router LSA 每个区域里的每个路由器都会产生 自身直连链路的类型、开销、网络号、掩码等 仅自身区域,不能跨ABR   构建区域内路由,路由表中为o
2 Network LSA 由DR和BDR产生 DR和BDR自身的信息,直连的网络号和掩码 仅自身区域,不能跨ABR 部分网络环境中没有(点对点)
3 Network summary LSA 由ABR产生 ABR直连的多个区域所在链路的网络和掩码 整个OSPF网络内 单区域没有 构建区域间的路由,路由表中为O IA
4 AS summary LSA 离ASBR最近(metric最下)的ABR产生 包含了ASBR的RID,告诉谁是ASBR 整个OSPF网络内 没有连其他外部网络的OSPF网络看不见
5 AS External LSA 由ASBR产生 外部网络情况的LSA 整个OSPF网络内 构建外部AS路由,路由表中为O E(1、2)
6 Multicast OSPF LSA cisco设备不支持        
7 NSSA LSA totally stubby区域中的ASBR 末梢区域相连的外部域的网络情况 末梢区域内 在NNSA的边界路由器上5转7,7转5
8 BGP外部属性LSA       搞不懂  
9、10、11 Opaque LSA       搞不懂  
 
 
 
路由器收到LSA的处理流程:
 
 
阅读(1540) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~