OSPF协议是客户要求使用并且要求在以下拓扑图中的,只允许路由器R3分别和R1及R2建立邻居关系,不允许R1和R2之间建立邻居关系。
简要拓扑如下:
OSPF限制FULL邻接关系的建立—作法一
改变OSPF的网络类型的方法,其好处在于LSA只会在相关链路上进行传递,而不会传递给另一个不需要建立邻接关系的OSPF邻居。具体方法是将在以太网的情况下的默认的OSPF网络类型由Broadcast(广播型)改变成NBMA(非广播多路访问),然后在R3上分别手工指定OSPF 邻居,以单播建立邻接关系。
R1上OSPF的简单配置:
- R1# show running-config | begin router ospf
- router ospf 1
- network 1.1.123.0 0.0.0.255 area 0
- neighbor 1.1.123.3
- R1# show running-config interface fastEthernet 1/0
- interface FastEthernet1/0
- ip address 1.1.123.1 255.255.255.0
- ip ospf network point-to-multipoint non-broadcas
R2上OSPF的简单配置:
- R2# show running-config | begin router ospf
- router ospf 1
- network 1.1.123.0 0.0.0.255 area 0
- neighbor 1.1.123.3
- R2# show running-config interface fastEthernet 1/0
- interface FastEthernet1/0
- ip address 1.1.123.2 255.255.255.0
- ip ospf network point-to-multipoint non-broadcas
R3上OSPF的简单配置:
- R3# show running-config | begin router ospf
- router ospf 1
- network 1.1.123.0 0.0.0.255 area 0
- neighbor 1.1.123.1
- neighbor 1.1.123.2
- R3# show running-config interface fastEthernet 1/0
- interface FastEthernet1/0
- ip address 1.1.123.3 255.255.255.0
- ip ospf network point-to-multipoint non-broadcas
校验结果:
- R3# show ip ospf neighbor 注意:R3上是两个FULL的邻接关系
- Neighbor ID Pri State Dead Time Address Interface
- 1.1.123.2 0 FULL/ - 00:01:41 1.1.123.2 FastEthernet1/0
- 1.1.123.1 0 FULL/ - 00:01:41 1.1.123.1 FastEthernet1/0
- R2# show ip ospf neighbor 注意:R2上仅仅和R3形成了FULL邻接关系
- Neighbor ID Pri State Dead Time Address Interface
- 1.1.123.3 0 FULL/ - 00:01:39 1.1.123.3 FastEthernet1/0
- R1#show ip ospf neighbor 注意:R1上仅仅和R3形成了FULL邻接关系
- Neighbor ID Pri State Dead Time Address Interface
- 1.1.123.3 0 FULL/ - 00:01:50 1.1.123.3 FastEthernet1/0
OSPF限制FULL邻接关系的建立中,此种作法文章更加推荐使用,希望大家通过实践去体会。如若想更多了解有关知识请看:OSPF限制FULL邻接关系的建立 下
【编辑推荐】