取消
显示结果 
搜索替代 
您的意思是: 
cancel
809
查看次数
0
有帮助
6
回复

OSPF

我的小驴子吖
Spotlight
Spotlight

network 10.28.0.0 0.0.255.255 area 28

network 10.212.0.0 0.0.255.255 area 212

network 0.0.0.0 255.255.255.255 area 0

Is area0 being chosen preferentially

Area 28 and area 212 can be interconnected with area 0 through ABR

Even if they are not in the same area, 10.28.0.0 and 10.212.0.0 can still be connected to each other

If I change the area 0 to Network 2.0.0.0 0.0.1.255 area 0, will this address affect the interconnection between 10.28.0.0 and 10.212.0.0

 

Router ospf 110

Router ID 1.1.1.1 

Do these two have to exist simultaneously

6 条回复6

M02@rt37
VIP
VIP

Hello @我的小驴子吖 

 

OSPF does not prefer Area 0 because of the wildcard statement! It simply matches each interface against the most specific network command, so your 10.28.0.0/16 interface goes to area 28, 10.212.0.0/16 goes to area 212, and everything else falls into area 0.

Area 28 and 212 can reach each other only because your router is an ABR connected to area 0, and if you replace the broad area-0 command with a specific network 2.0.0.0 ... and no interfaces fit that range, the router will loose its Area0 connection, stop being an ABR, and area 28 and 212 will no longer interconnect...

As concerned, the router id 1.1.1.1, it is just an identifier; it doesn't need to match any interface or network...The network statements controle which interfaces run OSPF and in which area. These 2 things exist independently and does not need to match.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Does OSPF have to be applied to interfaces? Only then will it take effect
Alternatively, matching the network range with the IP address of the interface will take effect

Hello @我的小驴子吖 

Yes, OSPF only become active on an interface if you explicitly enable it, either by matching the interface’s IP address with network statement under the OSPF process or by configuring ospf directly on the interface with ip ospf /process area /id command.

If the interface doesn't match a network statement and you haven’t applied OSPF under the interface, OSPF will not run on that interface...

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Router ospf 110
network 10.28.0.0 0.0.255.255 area 28
network 10.212.0.0 0.0.255.255 area 212
network 2.0.0.0 0.0.1.255 area 0
Do I still need to write router OSPF 110 under the port after finishing this, or can it take effect without being applied under the port, or do I need to perform other operations to make OSPF 110 take effect

Hello 

It should be ok like this. You configure what you need under the ospf process...

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Rockyw
Spotlight
Spotlight

问题一:Is area0 being chosen preferentially?(区域0是否被优先选择?)

答:​ 在OSPF中,区域0(骨干区域)在路径选择上并没有绝对的“优先权”。 路径选择的优先顺序是基于OSPF的路由器类型和区域结构,而不是简单地“优先选择区域0”。具体规则如下:

  1. 区域内路径(Intra-Area): 这是最优先的。如果数据包的目的地就在同一个OSPF区域内,路由器会直接选择该区域内的路径。这是OSPF设计的基本原则。
  2. 区域间路径(Inter-Area): 如果目的地在其他区域,所有区域间的通信必须经过区域0。这是OSPF的硬性规定。
    • 在您的配置中,数据包从区域28去往区域212,路径必须是:区域28 -> 区域0(通过ABR) -> 区域212
    • 所以,区域0在这里扮演的是必需的交通枢纽角色,而不是因为被“优先选择”,而是因为它是唯一的、强制的通道

结论:​ 区域0本身不被“优先”,但所有跨区域的流量都必须流经它,这使得它至关重要。


问题二:Even if they are not in the same area, 10.28.0.0 and 10.212.0.0 can still be connected to each other?(即使不在同一区域,10.28.0.0和10.212.0.0也能互相连接吗?)

答:是的,可以互相连接。 这正是多区域OSPF设计的目的。只要区域28和区域212都正确地连接到骨干区域(区域0),并且有ABR在它们和区域0之间交换路由信息,那么这两个不同区域的网络就可以互相通信。


问题三:If I change the area 0 to network 2.0.0.0 0.0.1.255 area 0, will this affect the interconnection?(如果我改成 network 2.0.0.0 0.0.1.255 area 0,会影响互联吗?)

答:这个修改本身完全不会影响区域28和区域212之间的互联。 解释如下: OSPF的 network命令的作用是启用路由器接口参与OSPF进程。它告诉路由器:“哪些接口上启用OSPF,以及这些接口属于哪个区域。”

  • network 0.0.0.0 255.255.255.255 area 0是一个“偷懒”但有效的配置。它使用通配符掩码 0.0.0.0匹配所有IP地址,意味着路由器上所有激活的接口都将运行OSPF并归属于区域0
  • network 2.0.0.0 0.0.1.255 area 0的含义是:只有IP地址在 2.0.0.0到 2.0.1.255范围内的接口,才会运行OSPF并归属于区域0

关键点:​ 区域28和区域212的互联,取决于连接这些区域的ABR(区域边界路由器)​ 是否有接口在区域0中,并且与骨干区域建立了邻接关系。

  • 只要ABR上有一个或多个接口正确地配置在区域0中(无论是通过 0.0.0.0匹配到的,还是通过 2.0.0.0匹配到的),它就能履行ABR的职责,在区域0、区域28和区域212之间传递路由信息。
  • 您修改的只是“哪些接口属于区域0”,只要确保ABR连接到区域0的链路接口IP在 2.0.0.0/23范围内,或者有其他接口确保ABR与区域0的连通性,互联就不会受影响。

警告:​ 将配置从 0.0.0.0 255.255.255.255改为 2.0.0.0 0.0.1.255风险极高。如果ABR上没有IP地址落在 2.0.0.0/23范围内的接口,那么它的所有接口都将不再属于区域0,导致它失去与骨干区域的连接。这将立即中断区域28和区域212之间的通信,因为违反了“所有区域必须与骨干区域直接相连”的原则。


问题四:Router ospf 110and Router ID 1.1.1.1, Do these two have to exist simultaneously?(这两条命令必须同时存在吗?)

答:不是必须的,但它们通常一起配置,并且有明确的依赖关系。

  1. router ospf 110: 这是必须存在的。这条命令是进入OSPF配置模式的开关。没有它,后面所有的OSPF配置(包括设置Router ID、定义网络区域)都无法进行。
  2. router-id 1.1.1.1: 这条命令不是必须的,但强烈推荐显式配置
    • 作用: 为OSPF进程指定一个唯一的路由器ID。Router ID是OSPF中路由器的唯一标识,用于建立邻居关系、标识LSA的发起者等,至关重要。
    • 如果不配置: 路由器会使用一个自动选择的规则,通常是选取所有激活接口中最大的IP地址。如果这个接口宕机,Router ID可能会改变,导致OSPF邻居关系中断,网络不稳定。
    • 依赖关系: router-id命令必须在 router ospf 110配置模式下执行。没有前者,后者无法输入。

总结:

  • router ospf 110是必需的入口命令。
  • router-id 1.1.1.1是强烈建议在入口命令之后配置的子命令,以保证网络稳定性。

所以,在您的配置中,它们“必须”同时存在,才能构成一个稳定、可预期的OSPF配置。只输入 router-id而不先输入 router ospf 110是不可能的。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rockyw | If it solves your problem, please mark as answer. Thanks !
快捷链接