---------------------------------------------------------------

OSPF在NBMA网络中的解决方案

---------------------------------------------------------------


一、OSPF在NBMA网络中产生的通信问题


配置基本的帧中继网络

231715790.png

帧中继配置

R1:

interface s1/0

ip address 192.168.1.1 255.255.255.0

no shutdown

encapsulation frame-relay

no frame-relay inverse-arp

frame-relay map ip 192.168.1.2 102 broadcast

frame-relay map ip 192.168.1.3 103 broadcast

exit

router ospf 1

network 192.168.1.0 0.0.0.255 area 0

R2:

interface s1/0

ip address 192.168.1.2 255.255.255.0

no shutdown

encapsulation frame-relay

no frame-relay inverse-arp

frame-relay map ip 192.168.1.1 201 broadcast

frame-relay map ip 192.168.1.3 201 broadcast

exit

router ospf 1

network 192.168.1.0 0.0.0.255 area 0

R3:

interface s1/0

ip address 192.168.1.3 255.255.255.0

no shutdown

encapsulation frame-relay

no frame-relay inverse-arp

frame-relay map ip 192.168.1.1 301 broadcast

frame-relay map ip 192.168.1.2 301 broadcast

exit

router ospf 1

network 192.168.1.0 0.0.0.255 area 0


路由配置

R1:

router ospf 1

network 192.168.1.0 0.0.0.255 area 0

R2:

router ospf 1

network 192.168.1.0 0.0.0.255 area 0

R3:

router ospf 1

network 192.168.1.0 0.0.0.255 area 0



debug ip ospf adj

clear ip ospf process刷新ospf进程,重新计算

show ip ospf neighbor查看ospf邻居


问题:只看到了down state,以后的邻居关系就建立不了

原因:不支持广播和组播,ospf路由器在建立邻居关系的时候,第一个hello包使用的是组播,第二个才是单播包,又因为NBMA网络不支持组播,所以才导致邻居关系无法建立起来


默认情况下,参与到NBMA网路中的ospf接口模式为non-broacast,都不支持广播

show ip ospf interface s1/0


二、在NBMA网络上运行OSPF解决方案

---------------------------------------------------------------------------

五种解决方法:在NBMA网络上运行OSPF解决方案

工业标准

non-broadcast:保持默认的NBMA状态

point-to-multipoint:点到多点

cisco标准

broadcast:模拟成广播网络

point-tomultipoint non-broadcast:点到多点非广播

point-to-point:点到点网络


show ip ospf inter s0/0 查看当前模式,默认是non-broadcast模式

----------------------------------------------------------------------------



--------------------------------------------------------------------------

方法一:NBMA模式:保持NBMA的接口模式去运行ospf,手动指定邻居

-------------------------------------------------------------------------

要点:

默认就是non-broadcast模式,所以不需要去修改接口模式了

邻居不能自动发现,必须通过neighbor命令手动指定邻居,指定的是邻居的RouterID

在NBMA网络中,需要选举DR和BDR的,如果拓扑是星型网络,就要让中心路由器成为DR;如果是全互连的就无所谓了

通过修改接口优先级,优先级0代表该路由器永远无法成为DR或者BDR,1是路由器默认的接口优先级

时间计时器:deadtime---120秒hello间隔----30秒

1、帧中继配置还是和上面一样(DLCI复用)

2、修改接口模式:所有路由器在帧中继的接口都要配置

ip ospf network non-broadcast

3、手动指定邻居

R1:(中心路由器),我们只需要在这一台路由器上指定邻居就可以了,那是因为在ospf建立邻居关系的时候,第一个发送hello包使用的是组播地址,其他路由器再发送的时候使用的就是单播地址了,就不再需要组播,所以我们在中心路由器上指定邻居完成第一个hello包的传输就可以了

手动指定路由器的两个邻居

router ospf 1

neighbor 192.168.1.2 必须使用邻居路由器的router-id

neighbor 192.168.1.3

exit


4、手动调整优先级,使中心路由器成为DR

R1

interface s0/0

ip ospf priority 25

或者

在指定邻居的时候,将邻居的优先级设置为0

router ospf 1

neighbor 192.168.1.2 priority 0

neighbor 192.168.1.3 priority 0

5、在每台路由器上刷新ospf进程重新计算DR

clear ip ospf process


查看邻居关系

show ip ospf neighbor


-----实验:证明在手动指定邻居的时候我们使用的是邻居物理接口地址还是邻居的RouterID


创建两个回环接口

R2:

interface lo 0

ip address 2.2.2.2 255.255.255.255

no shutdown

ip ospf 1 area 0在接口上通过ospf路由

R3:

interface lo 0

ip address 3.3.3.3 255.255.255.255

no shutdown

ip ospf 1 area 0


clear ip ospf p 刷新ospf进程,重新计算RID

或者

手动指定RID

R2:

router ospf 1

router-id 2.2.2.2

R3:

router ospf 1

router-id 3.3.3.3


clear ip ospf process 刷新进程,让RID生效


更改邻居

router ospf 1

neighbor 192.168.1.2 邻居路由器的RouterID

neighbor 192.168.1.3

exit

show ip ospf neighbor

deadtime:120秒

hello间隔:30秒


--------------------------------------------------------------------------

方法二:广播模式--broadcast

-------------------------------------------------------------------------

要点:

邻居是自动发现的

在星型拓扑中,中心路由器还是DR,配置和上述一样

hello时间间隔是10秒;deadtime是40秒

在这种网络中需要选举DR/BDR


删掉之前的OSPF路由

no router ospf 1


1、帧中继配置和上面是一样的(DLCI复用)


2、手动调整优先级,使中心路由器成为DR

R1

interface s0/0

ip ospf priority 25


3、配置OSPF路由

router ospf 1

network area 0


4、将路由器所有在NBMA网络中的接口类型修改为broadcast

interface s1/0

ip ospf network broadcast


show ip ospf inter s1/0查看接口的网络类型


-------------------------------------------------------------------------

方法三:点到点模式

中心路由器必须划分成点到点子接口

-------------------------------------------------------------------------

hellotime是30秒,deadtime是120秒

不需要选举DR和BDR

中心路由器必须划分子接口,边缘路由器可以使用物理接口,或者划分子接口

划分点到点子接口的路由器,不需要使用 ip ospf network point-to-point这条命令

IP编制需要重新规划,使用两个不同的子网


1、帧中继配置(不用DLCI复用)

R1:

interface s1/0

en fr

no frame inver

no shutdown

interface s1/0.1 point-to-point

ip address 192.168.1.1 255.255.255.252

no shutdown

frame-relay interface-dlci 102

interface s1/0.2 point-to-point

ip address 192.168.1.5 255.255.255.252

no shutdown

frame-relay interface-dlci 103

router ospf 1

network 192.168.1.1 0.0.0.0 area 0

network 192.168.1.5 0.0.0.0 area 0


R2:

interface s0/0

en fr

no frame inver

ip address 192.168.1.2 255.255.255.252

no shut

frame-relay map ip 192.168.1.1 201 broadcast

ip ospf network point-to-point

router ospf 1

network 192.168.1.2 255.255.255.252 area 0正常通告


R3:

interface s0/0

en fr

no frame inver

ip address 192.168.1.6 255.255.255.252

no shut

ip ospf network point-to-point

frame-relay map ip 192.168.1.1 301 broadcast

ip ospf 1 area 0 OSPF的另外一种路由通告方式



-------------------------------------------------------------------------

方法四:点到多点模式

可以直接使用物理接口,也可以使用多点子接口

-------------------------------------------------------------------------


hellotime是30秒,deadtime是120秒

不需要选举DR和BDR

不需要DLCI复用,但是运行了ospf之后,两个spoke之间任意可以通信

自动产生一条多点帧中继接口的主机路由,用于解决不使用DICI复用产生的端到端连通性问题

如果使用多点子接口代替物理接口,那么多点子接口不需要使用 ip ospf network point-to-multipoint


清空所有路由器的配置

default s1/0

no router ospf 1


1、配置帧中继,不使用DLCI的复用,运行ospf

R1:

interface s1/0

ip address 192.168.1.1 255.255.255.0

no shutdown

encapsulation frame-relay

no frame-relay inverse-arp

frame-relay map ip 192.168.1.2 102 broadcast

frame-relay map ip 192.168.1.3 103 broadcast

exit

router ospf 1

network 192.168.1.0 0.0.0.255 area 0

R2:

interface s1/0

ip address 192.168.1.2 255.255.255.0

no shutdown

encapsulation frame-relay

no frame-relay inverse-arp

frame-relay map ip 192.168.1.1 201 broadcast

exit

router ospf 1

network 192.168.1.0 0.0.0.255 area 0

R3:

interface s1/0

ip address 192.168.1.3 255.255.255.0

no shutdown

encapsulation frame-relay

no frame-relay inverse-arp

frame-relay map ip 192.168.1.1 301 broadcast

exit

router ospf 1

network 192.168.1.0 0.0.0.255 area 0


2、更改接口模式,如果使用子接口就不需要

R1:

interface s1/0

ip ospf network point-to-multipoint

R2:

interface s1/0

ip ospf network point-to-multipoint

R3:

interface s1/0

ip ospf network point-to-multipoint




-------------------------------------------------------------------------

方法五:点到多点非广播模式

跟点到多点模式相比,邻居必须要手动指定,其他特点和点到多点一样

-------------------------------------------------------------------------

要点:

hellotime是30秒,deadtime是120秒

不需要选举DR和BDR

不需要DLCI复用,但是运行了ospf之后,两个spoke之间任意可以通信

自动产生一条多点帧中继接口的主机路由,用于解决不使用DICI复用产生的端到端连通性问题

如果使用多点子接口代替物理接口,那么多点子接口不需要使用 ip ospf network point-to-multipoint

跟点到多点模式相比,必须要手动指定邻居


1、帧中继配置(无DLCI复用)

2、OSPF路由(和上面一样)

3、手动指定路由器的两个邻居

router ospf 1

neighbor 192.168.1.2 邻居接口的IP地址

neighbor 192.168.1.3

exit


4、更改接口模式,如果使用子接口就不需要

R1:

interface s1/0

ip ospf network point-to-multipoint

R2:

interface s1/0

ip ospf network point-to-multipoint

R3:

interface s1/0

ip ospf network point-to-multipoint