打印

[转帖] 实验室之OSPF篇

实验室之OSPF篇

理解OSPF中的network命令

目标:
R1上启用 OSPF,并且使用四条network命令来进行下面区域的配置
接口10.10.10.10 加入area 0
接口10.10.10.0 - 10.10.10.255 加入area 1
接口10.10.0.0 - 10.10.15.255 加入area 2
所有其他接口(1.0.0.0 - 223.255.255.255) 加入area 3


<!--[if !vml]-->
配置指南:
R1上创建loopback0 ,配置地址为10.10.10.10/32
R1上创建loopback1 ,配置地址为10.10.10.1/32
R1上创建loopback2 ,配置地址为10.10.10.255/32
R1上创建loopback3 ,配置地址为10.10.0.0/32
R1上创建loopback4 ,配置地址为10.10.15.255/32
R1上创建loopback5 ,配置地址为10.9.255.255/32
R1上创建loopback6 ,配置地址为10.10.16.0/32
R1上创建loopback7 ,配置地址为1.0.0.0/32
R1上创建loopback8 ,配置地址为223.255.255.255/32
启用OSPF 进程号为1
使用network命令配置接口10.10.10.10 加入OSPF area 0
使用network命令配置接口10.10.10.0 - 10.10.10.255加入OSPF area 1
使用network命令配置接口10.10.0.0- 10.10.15.255加入OSPF area 2
使用network命令配置接口1.0.0.0 -223.255.255.255加入OSPF area 3
自我提问:
wildcard mask 和接口subnet mask 的关系是什么?
如果多个OSPF network命令出现重复会怎么办?
怎么来验证某个接口属于哪个area?



最终配置和验证:

R1:

interface Loopback0

ip address 10.10.10.10 255.255.255.255

!

interface Loopback1

ip address 10.10.10.1 255.255.255.255

!

interface Loopback2

ip address 10.10.10.255 255.255.255.255

!

interface Loopback3

ip address 10.10.0.0 255.255.255.255

!

interface Loopback4

ip address 10.10.15.255 255.255.255.255

!

interface Loopback5

ip address 10.9.255.255 255.255.255.255

!

interface Loopback6

ip address 10.10.16.0 255.255.255.255

!

interface Loopback7

ip address 1.0.0.0 255.255.255.255

!

interface Loopback8

ip address 223.255.255.255 255.255.255.255

!

router ospf 1

network 10.10.10.10 0.0.0.0 area 0

network 10.10.10.0 0.0.0.255 area 1

network 10.10.0.0 0.0.15.255 area 2

network 0.0.0.0 255.255.255.255 area 3


R1#show ip ospf interface | include (Loopback[0-8]|Area)

Loopback0 is up, line protocol is up

Internet Address 10.10.10.10/32, Area 0

Loopback2 is up, line protocol is up

Internet Address 10.10.10.255/32, Area 1

Loopback1 is up, line protocol is up

Internet Address 10.10.10.1/32, Area 1

Loopback4 is up, line protocol is up

Internet Address 10.10.15.255/32, Area 2

Loopback3 is up, line protocol is up

Internet Address 10.10.0.0/32, Area 2

Loopback8 is up, line protocol is up

Internet Address 223.255.255.255/32, Area 3

Loopback7 is up, line protocol is up

Internet Address 1.0.0.0/32, Area 3

Loopback6 is up, line protocol is up

Internet Address 10.10.16.0/32, Area 3

Loopback5 is up, line protocol is up

Internet Address 10.9.255.255/32, Area 3


注解:
配置OSPF的第一步是全局启用此路由进程,通过在全局配置模式下使用router ospf命令,后面再加上本地有效的进程号即可。一旦进程启动,下一步需要的就是通过使用network命令来在接口上启用进程。
EIGRP一样,OSPFnetwork命令也使用wildcard mask 来标记特定端口或者一组端口启用此协议。另外还会标记此端口属于哪个link state area。这里的wildcard mask选项工作机理类似
IP access list中相应选项, 二进制的0代表进行此位的检查,而1代表忽略对此位的检查。Network命令中的wildcard mask选项和接口的subnet mask或者相应的宣告(advertisement)没有关系,只是简单的用来判定哪个接口属于此area。配置命令network 10.10.10.10 0.0.0.0 area 0表明只有地址为10.10.10.10 的接口属于area 0。配置命令network 10.10.10.0 0.0.0.255 area 1表明地址为10.10.10.XX为任一数字)的任一接口属于area 1. 配置命令network 10.10.0.0 0.0.15.255 area 2 表明地址为10.10.X.YX0-15Y为任一数字)的任一接口属于area 2。最后所有未被指定的接口都通过命令network 0.0.0.0 255.255.255.255 area 3将其加入area 3。当配置的多个network命令出现重复的时候,最精确的语句匹配。比如命令network 0.0.0.0 255.255.255.255 area 3 虽然表明所有的接口都加入area 3但是更精确的命令10.10.10.10 0.0.0.0 area 0会匹配从而使该接口加入area 0
对端口加入区域的验证可以使用在特权模式下使用show ip ospf interface命令

TOP

帧中继承载OSPF-广播(Broadcast)

目标:
R1R4R5之间的帧中继网络中配置OSPF,网络类型为broadcast,实现VLAN A, VLAN BVLAN C的互通




配置指南:
R1上配置接口Ethernet0/0地址为1.0.0.1/8
R4上配置接口Ethernet0/0地址为4.0.0.4/8
R5上配置接口Ethernet0/0地址为5.0.0.5/8
R1上配置接口Seria0/0地址为10.0.0.1/8
R4上配置接口Serial0/0地址为10.0.0.4/8
R5上配置接口Serial0/0地址为10.0.0.5/8
R1,R4R5Serial接口上配置帧中继封装
R4R5上禁用帧中继反向地址解析
R1上配置静态映射,通过DCLI10410.0.0.4和通过DLCI10510.0.0.5
R4上配置静态映射,通过DLCI40110.0.0.110.0.0.5
R5上配置静态映射,通过DLCI50110.0.0.1 10.0.0.4
确保链路支持广播和多播数据包传递
R1, R4, R5Serial接口上配置OSPF网络类型为broadcast
R4R5配置Serial接口OSPF优先级为0
配置R1, R4R5中所有接口加入area 0

自我提问:
• broadcast的网络类型和其他网络类型有什么不同?
这种网络类型中LSA是单播还是组播发送?
这种网络类型支持DR/BDR 选举吗?
这些属性对配置有什么影响?
最终配置和验证:

R1:

interface Ethernet0/0

ip address 1.0.0.1 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.1 255.0.0.0

encapsulation frame-relay

ip ospf network broadcast

frame-relay map ip 10.0.0.4 104 broadcast

frame-relay map ip 10.0.0.5 105 broadcast

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R4:

interface Ethernet0/0

ip address 4.0.0.4 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.4 255.0.0.0

encapsulation frame-relay

ip ospf network broadcast

ip ospf priority 0

frame-relay map ip 10.0.0.1 401 broadcast

frame-relay map ip 10.0.0.5 401

no frame-relay inverse-arp

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R5:

interface Ethernet0/0

ip address 5.0.0.5 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.5 255.0.0.0

encapsulation frame-relay

ip ospf network broadcast

ip ospf priority 0

frame-relay map ip 10.0.0.1 501 broadcast

frame-relay map ip 10.0.0.4 501

no frame-relay inverse-arp

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.4 0 FULL/DROTHER 00:00:33 10.0.0.4 Serial0/0

10.0.0.5 0 FULL/DROTHER 00:00:36 10.0.0.5 Serial0/0

R4#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.1 1 FULL/DR 00:00:39 10.0.0.1 Serial0/0

R5#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.1 1 FULL/DR 00:00:33 10.0.0.1 Serial0/0

R1#show 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, 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

C 1.0.0.0/8 is directly connected, Ethernet0/0

O 4.0.0.0/8 [110/74] via 10.0.0.4, 00:01:49, Serial0/0

O 5.0.0.0/8 [110/74] via 10.0.0.5, 00:01:49, Serial0/0

C 10.0.0.0/8 is directly connected, Serial0/0

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

O 1.0.0.0/8 [110/74] via 10.0.0.1, 00:02:26, Serial0/0

C 4.0.0.0/8 is directly connected, Ethernet0/0

O 5.0.0.0/8 [110/74] via 10.0.0.5, 00:02:26, Serial0/0

C 10.0.0.0/8 is directly connected, Serial0/0

R5#show 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, 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

O 1.0.0.0/8 [110/74] via 10.0.0.1, 00:00:11, Serial0/0

O 4.0.0.0/8 [110/74] via 10.0.0.4, 00:00:11, Serial0/0

C 5.0.0.0/8 is directly connected, Ethernet0/0

C 10.0.0.0/8 is directly connected, Serial0/0


注解:
在网络类型为broadcast的网络中OSPF hellos包是通过组播传递,像non-broadcast的网络类型一样需要DR/BDR 的选举。对于以太网络或者令牌网这种广播型网络来说,这种是缺省的网络类型。需要注意的是本例中的framerelay map命令增加了broadcast选项,这是因为hello包是组播传递的。 另外由于不是单播所以对于DRBDR就不需要配置neighbor的命令。同样还会出现前例讲到的优先级配置问题,略过。
通过使用show ip ospf neighbor命令来验证邻居关系,使用show ip ospf interface命令来验证网络类型和DR/BDR
关于下一跳的问题也类似前例。

TOP

帧中继承载OSPF – 非广播(Non-Broadcast)

目标:
R1R4R5之间的帧中继网络中配置OSPF,网络类型为non-broadcast,实现VLAN A, VLAN BVLAN C的互通




配置指南:
R1上配置接口Ethernet0/0地址为1.0.0.1/8
R4上配置接口Ethernet0/0地址为4.0.0.4/8
R5上配置接口Ethernet0/0地址为5.0.0.5/8
R1上配置接口Seria0/0地址为10.0.0.1/8
R4上配置接口Serial0/0地址为10.0.0.4/8
R5上配置接口Serial0/0地址为10.0.0.5/8
R1,R4R5Serial接口上配置帧中继封装(Frame Relay encapsulation)
R4R5上禁用帧中继反向地址解析(Frame-Relay Inverse-ARP)
R1上配置静态映射,通过DCLI10410.0.0.4和通过DLCI10510.0.0.5
R4上配置静态映射,通过DLCI40110.0.0.110.0.0.5
R5上配置静态映射,通过DLCI50110.0.0.1 10.0.0.4
R4R5配置Serial接口OSPF优先级为0
配置R1, R4R5中所有接口加入area 0
R1上配置对R4 R5的邻居命令
自我提问:
在多点的帧中继接口(multipoint Frame Relay interface)上缺省的OSPF网络类型是什么?
这种网络类型中LSA是单播还是组播发送?
这种网络类型支持DR/BDR 选举吗?
这些属性对配置有什么影响?
最终配置和验证:

R1:

interface Ethernet0/0

ip address 1.0.0.1 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.1 255.0.0.0

encapsulation frame-relay

frame-relay map ip 10.0.0.4 104

frame-relay map ip 10.0.0.5 105

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

neighbor 10.0.0.4

neighbor 10.0.0.5

R4:

interface Ethernet0/0

ip address 4.0.0.4 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.4 255.0.0.0

encapsulation frame-relay

ip ospf priority 0

frame-relay map ip 10.0.0.1 401

frame-relay map ip 10.0.0.5 401

no frame-relay inverse-arp

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R5:

interface Ethernet0/0

ip address 5.0.0.5 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.5 255.0.0.0

encapsulation frame-relay

ip ospf priority 0

frame-relay map ip 10.0.0.1 501

frame-relay map ip 10.0.0.4 501

no frame-relay inverse-arp

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.4 0 FULL/DROTHER 00:01:58 10.0.0.4 serial0/0

10.0.0.5 0 FULL/DROTHER 00:01:49 10.0.0.5 serial0/0

R4#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.1 1 FULL/DR 00:01:47 10.0.0.1 serial0/0

R5#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.1 1 FULL/DR 00:01:56 10.0.0.1 serial0/0

R1#show 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, 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

C 1.0.0.0/8 is directly connected, Ethernet0/0

O 4.0.0.0/8 [110/74] via 10.0.0.4, 00:01:49, Serial0/0

O 5.0.0.0/8 [110/74] via 10.0.0.5, 00:01:49, Serial0/0

C 10.0.0.0/8 is directly connected, Serial0/0

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

O 1.0.0.0/8 [110/74] via 10.0.0.1, 00:02:26, Serial0/0

C 4.0.0.0/8 is directly connected, Ethernet0/0

O 5.0.0.0/8 [110/74] via 10.0.0.5, 00:02:26, Serial0/0

C 10.0.0.0/8 is directly connected, Serial0/0

R5#show 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, 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

O 1.0.0.0/8 [110/74] via 10.0.0.1, 00:00:11, Serial0/0

O 4.0.0.0/8 [110/74] via 10.0.0.4, 00:00:11, Serial0/0

C 5.0.0.0/8 is directly connected, Ethernet0/0

C 10.0.0.0/8 is directly connected, Serial0/0


注解:
对于多点的帧中继接口缺省的网络类型是nonbroadcast,这种网络类型使用单播来传递OSPF hello包,像广播网络一样支持DR/BDR选举。由于hello数据包是单播,所以必须在DRBDR上手动配置邻居。注意的是在例子的frame-relay map命令中没有使用broadcast选项,因为是单播不是组播包。
前面例子中提到了OSPF不支持抢占和对于hub-spoke网络的特殊要求,所以本例中在R4R5这两个spoke路由器上配置优先级为0
通过使用show ip ospf neighbor命令来验证邻居关系,使用show ip ospf interface命令来验证网络类型和DR/BDR
还有一个有趣的现象就是在show ip route输出中的next-hop 值。比如R4的路由表可以看到到达网络5.0.0.0的下一跳为10.0.0.5,而物理上R4还是先要把数据包发送给R1。这也就是说R4必须有一个针对10.0.0.5地址的三层到二层的解析,同理针对Rr5必须有一个针对10.0.0.4的解析。

TOP

OSPF DR和BDR选举

目标:
配置以太网链路中的R1, R2 R3 启用OSPF,并且R1被选为DRR2被选为BDRR3不参与选举

配置指南:

R1上配置接口Ethernet0/0地址为10.0.0.1/8

R2上配置接口Ethernet0/0 地址为10.0.0.2/8

R3上配置接口Ethernet0/0地址为10.0.0.3/8

R1上配置接口Ethernet0/0
OSPF优先级为100

R2上配置接口Ethernet0/0
OSPF 优先级为50

R3上配置接口Ethernet0/0
OSPF 优先级为0

所有接口加入OSPF area 0
自我提问:

在以太网中缺省的 OSPF 网络类型(network type)是什么?

在这种网络类型中需要DR/BDR 选举吗?
DR的角色是什么?
BDR的角色呢?
DR/BDR选举是怎样产生的?

什么可以影响到DR/BDR的选举?

一个优先级比现有DR或者BDR的优先级还要高的路由器加入到网络会发生什么?
最终配置和验证:

R1:

interface Ethernet0/0

ip address 10.0.0.1 255.0.0.0

ip ospf priority 100

!

router ospf 1

network 10.0.0.1 0.0.0.0 area 0

R2:

interface Ethernet0/0

ip address 10.0.0.2 255.0.0.0

ip ospf priority 50

!

router ospf 1

network 10.0.0.2 0.0.0.0 area 0

R3:

interface Ethernet0/0

ip address 10.0.0.3 255.0.0.0

ip ospf priority 0

!

router ospf 1

network 10.0.0.3 0.0.0.0 area 0

R1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.2 50 FULL/BDR 00:00:38 10.0.0.2 Ethernet0/0

10.0.0.3 0 FULL/DROTHER 00:00:34 10.0.0.3 Ethernet0/0

R2#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.3 0 FULL/DROTHER 00:00:33 10.0.0.3 Ethernet0/0

10.0.0.1 100 FULL/DR 00:00:31 10.0.0.1 Ethernet0/0

R3#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.2 50 FULL/BDR 00:00:34 10.0.0.2 Ethernet0/0

10.0.0.1 100 FULL/DR 00:00:39 10.0.0.1 Ethernet0/0

R1#show ip ospf interface ethernet0/0

Ethernet0/0 is up, line protocol is up

Internet Address 10.0.0.1/8, Area 0

Process ID 1, Router ID 10.0.0.1, Network Type BROADCAST, Cost: 10

Transmit Delay is 1 sec, State DR, Priority 100

Designated Router (ID) 10.0.0.1, Interface address 10.0.0.1

Backup Designated router (ID) 10.0.0.2, Interface address 10.0.0.2


注解:
为了在网络类型为broadcastnonbroadcast的网络中减少LSA的复制所以定义了Designated Router (DR) Backup Designated Router (BDR) 两种路由器角色。当一个设备在此网段中发送LSA,这个LSA就是发给DR,然后DR再负责将此LSA发送到网段中的其他设备。如果DR出现问题,BDR会取代其位置。DRBDR的选择通过选举的方式选出。


这个选举流程由两个因素来决定,接口优先级(interface priority)和router-id。接口优先级从0255,缺省为1,如果配置为0表明不参加选举,如果是255就很有可能被选为DR。如果出现相同的优先级则最大的router-id会被选择。


OSPF router-id 可以通过自动或者手动配置两种方式获得。自动的话会选择最大的loopback地址,如果没有loopback则是所有接口中最大的地址。如果router-id是通过自动选择获得,那么如果有更大地址的新接口出现,OSPF进程又被重启的话router-id就会发生改变。由于router-id需要在整个OSPF domain中保持唯一,所以推荐通过router0-id命令进行手动配置。


在选举过程中会遇到的一个OSPF进程加载的速度问题。OSPF DR/BDR 的选举不像IS-IS DIS选举,是不支持抢占(preemption)的。这就意味着一旦选举完成,即使新加一个优先级更高的设备也不会进行重新的选择,相反只有在DR或者BDR出问题的时候才会发生重选。如果DR出问题,BDR会变为DR,然后进行BDR的重选;如果BDR失败,则进行BDR的重选。


在上面的例子中,如果R1R2R3选举完成之后加入到网段中,那么即使R2的优先级低于R1R1也不能抢占R2DR角色。为了确保某个设备一定要被选为DR就必须通过设置其他设备的优先级为0。特别是对那种只有一个设备具备整个网段二层连接性的情况,比如hub-and-spoke NBMA拓扑中的hub,如果hub出现失败则会导致其他设备之间的互联失败,因此必须配置hub为唯一的DR选举者。
一旦选举完成,可以通过show ip ospf neighborshow ip ospf interface命令来验证DRBDR的选择结果。

TOP

帧中继承载OSPF – 点对多点(Point-to-Multipoint)

目标:
R1R4R5之间的帧中继网络中配置OSPF,网络类型为point-to-multipoint,实现VLAN A, VLAN BVLAN C的互通。R4R5通过三层路由而不是静态映射来解析三层地址。



配置指南:
R1上配置接口Ethernet0/0地址为1.0.0.1/8
R4上配置接口Ethernet0/0地址为4.0.0.4/8
R5上配置接口Ethernet0/0地址为5.0.0.5/8
R1上配置接口Seria0/0地址为10.0.0.1/8
R4上配置接口Serial0/0地址为10.0.0.4/8
R5上配置接口Serial0/0地址为10.0.0.5/8
R1,R4R5Serial接口上配置帧中继封装
R4R5上禁用帧中继反向地址解析
R1上配置静态映射,通过DCLI10410.0.0.4和通过DLCI10510.0.0.5
R4上配置静态映射,通过DLCI40110.0.0.1
R5上配置态映射,通过DLCI50110.0.0.1
R4R5之间不配置静态映射
确保链路支持广播和多播数据包传递
R1, R4, R5Serial接口上配置OSPF网络类型为point-to-multipoint
配置R1, R4R5中所有接口加入area 0
自我提问:
帧中继网络中缺省的OSPF网络类型是什么?
point-to-multipoint的网络类型和其他网络类型有什么不同?
这种网络类型中LSA是单播还是组播发送?
这种类型会对三层到二层的解析产生什么 影响?
point-to-multipoint的网络类型对下一跳的处理和其他网络类型有什么不同?
这种类型会对是否配置需要配置三层到二层的解析产生什么影响?
最终配置和验证:

R1:

interface Ethernet0/0

ip address 1.0.0.1 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.1 255.0.0.0

encapsulation frame-relay

ip ospf network point-to-multipoint

frame-relay map ip 10.0.0.4 104 broadcast

frame-relay map ip 10.0.0.5 105 broadcast

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R4:

interface Ethernet0/0

ip address 4.0.0.4 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.4 255.0.0.0

encapsulation frame-relay

ip ospf network point-to-multipoint

frame-relay map ip 10.0.0.1 401 broadcast

no frame-relay inverse-arp

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R5:

interface Ethernet0/0

ip address 5.0.0.5 255.0.0.0

!

interface Serial0/0

ip address 10.0.0.5 255.0.0.0

encapsulation frame-relay

ip ospf network point-to-multipoint

frame-relay map ip 10.0.0.1 501 broadcast

no frame-relay inverse-arp

!

router ospf 1

network 0.0.0.0 255.255.255.255 area 0

R1#show frame-relay map

Serial0 (up): ip 10.0.0.4 dlci 104(0x68,0x1880), static,

broadcast,

CISCO, status defined, active

Serial0 (up): ip 10.0.0.5 dlci 105(0x69,0x1890), static,

broadcast,

CISCO, status defined, active

R4#show frame-relay map

Serial0 (up): ip 10.0.0.1 dlci 401(0x191,0x6410), static,

broadcast,

CISCO, status defined, active

R5#show frame-relay map

Serial0 (up): ip 10.0.0.1 dlci 501(0x191,0x6410), static,

broadcast,

CISCO, status defined, active

R1#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.5 1 FULL/ - 00:01:49 10.0.0.5 Serial0/0

10.0.0.4 1 FULL/ - 00:01:49 10.0.0.4 Serial0/0

R4#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.1 1 FULL/ - 00:01:47 10.0.0.1 Serial0/0

R5#show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.0.0.1 1 FULL/ - 00:01:56 10.0.0.1 Serial0/0

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

P - periodic downloaded static route

Gateway of last resort is not set

C 1.0.0.0/8 is directly connected, Ethernet0

O 4.0.0.0/8 [110/74] via 10.0.0.4, 00:55:30, Serial0

O 5.0.0.0/8 [110/74] via 10.0.0.5, 00:55:30, Serial0

10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 10.0.0.0/8 is directly connected, Serial0

O 10.0.0.4/32 [110/64] via 10.0.0.4, 00:55:30, Serial0

O 10.0.0.5/32 [110/64] via 10.0.0.5, 00:55:30, Serial0

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

P - periodic downloaded static route

Gateway of last resort is not set

O 1.0.0.0/8 [110/74] via 10.0.0.1, 02:32:17, Serial0

C 4.0.0.0/8 is directly connected, Ethernet0

O 5.0.0.0/8 [110/138] via 10.0.0.1, 02:32:17, Serial0

10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 10.0.0.0/8 is directly connected, Serial0

O 10.0.0.1/32 [110/64] via 10.0.0.1, 02:32:17, Serial0

O 10.0.0.5/32 [110/128] via 10.0.0.1, 02:32:17, Serial0

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

P - periodic downloaded static route

Gateway of last resort is not set

O 1.0.0.0/8 [110/74] via 10.0.0.1, 00:44:06, Serial0

O 4.0.0.0/8 [110/138] via 10.0.0.1, 00:44:06, Serial0

C 5.0.0.0/8 is directly connected, Ethernet0

10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 10.0.0.0/8 is directly connected, Serial0

O 10.0.0.1/32 [110/64] via 10.0.0.1, 00:44:06, Serial0

O 10.0.0.4/32 [110/128] via 10.0.0.1, 00:44:06, Serial0

R4#ping 10.0.0.5

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.0.0.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/120 ms

R4#ping 5.0.0.5

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 5.0.0.5, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 116/116/120 ms

R1#sh ip ospf interface

Serial0 is up, line protocol is up

Internet Address 10.0.0.1/8, Area 0

Process ID 1, Router ID 10.0.0.1, Network Type POINT_TO_MULTIPOINT,

Neighbor Count is 2, Adjacent neighbor count is 2

Adjacent with neighbor 10.0.0.4

Adjacent with neighbor 10.0.0.5


注解:
不像前面提到的broadcast non-broadcast, 网络类型为point-to-multipoint的网络不需要DRBDR的选举。发送hello数据包到组播地址224.0.0.5,因此在NBMA网络中如果是点到多点就必须支持广播。由于对于多点帧中继接口缺省网络类型是non-broadcast, 因此point-to-multipoint的网络类型必须通过命令ip ospf network point-to-multipoint在相应接口配置。和前面提到网络类型在功能上的最大不同就是在非广播媒介中怎么对下一跳解析的处理。这种网络类型会把网络认为是多个点到点链路的集合而不是一个扁平的广播网络。对于非广播和广播网络,OSPF 不知道真实的二层网络拓扑,在NBMA网络中更新传递时下一跳值是不会被修改的,这也就意味着对任何注入路由到网络的设备都必须有三层到二层的解析。对于点到多点的网络进行路由宣告时,下一跳值会被修改为直连的邻居地址,这也就意味着只需要对直连邻居进行三层到二层的解析。
在上述例子中R5学到的R4宣告的路由的下一跳被修改为R1的地址10.0.0.1,对于R4学到的R5宣告的路由同样。这样所有的数据包都会封装至10.0.0.1,就不需要R4R5之间的三层二层映射,而是通过三层路由来告知其通过R1到达目的地。至于另外网络类型下一跳的处理参考前面的例子。
除了对下一跳处理不同以外,还有就是处理宣告点对多点对端为主机路由而不是实际的网络,我们可以参看一下R1,R4R5的路由输出。R4到达R510.0.0.5不是通过映射而是通过三层路由。当这个网络被宣告到剩余的OSPF domain的话只是主机路由,比如看到的只是10.0.0.1/32,10.0.0.4/32, 10.0.0.5/32 来代表网络10.0.0.0/8

TOP

帧中继承载OSPF- 点对多点 非广播(Point-to-Multipoint No-broadcast)

目标:
R1R4R5之间的帧中继网络中配置OSPF,网络类型为point-to-multipoint non-broadcast,实现VLAN A, VLAN BVLAN C的互通。任何链路都不能配置广播支持。



配置指南:
R1上配置接口Ethernet0/0地址为1.0.0.1/8
R4上配置接口Ethernet0/0地址为4.0.0.4/8
R5上配置接口Ethernet0/0地址为5.0.0.5/8
R1上配置接口Seria0/0地址为10.0.0.1/8
R4上配置接口Serial0/0地址为10.0.0.4/8
R5上配置接口Serial0/0地址为10.0.0.5/8
R1,R4R5Serial接口上配置帧中继封装
R4R5上禁用帧中继反向地址解析
R1上配置静态映射,通过DCLI10410.0.0.4和通过DLCI10510.0.0.5
R4上配置静态映射,通过DLCI40110.0.0.1
R5上配置静态映射,通过DLCI50110.0.0.1
R4R5之间不配置静态映射
R1, R4,