OSPF 未显示在 show ip route

网络工程 思科 路由 转变 路由器 ospf
2022-02-28 08:07:59

请帮助我,我不知道我的配置有什么问题。OSPF 不工作。

在此处输入图像描述

路由器 1:

int g0/0
ip add 210.1.1.1 255.255.255.224
no shut

int s0/0/1
ip add 172.20.0.222 255.255.255.252
no shut

路由器 0:

int g0/0
ip add 172.20.0.129 255.255.255.224
no shut

int s0/0/1
ip add 172.20.0.221 255.255.255.252
no shut

int s0/0/0
ip add 172.20.0.218 255.255.255.252
no shut

router ospf 1
router-id 2.2.2.2

network 172.20.0.128 0.0.0.31 area 0
network 172.20.0.220 0.0.0.3 area 0
2个回答

您没有在两台路由器上配置 OSPF。路由协议的重点是与其他路由器共享路由。只在一台路由器上运行 OSPF 是没有好处的。

您需要像在路由器 0 上一样在路由器 1 上配置 OSPF。如果在路由器 1 的 OSPF 配置中包含连接到路由器 1 的所有路由,路由器 0 应该能够看到它们,而路由器 1 应该能够看到路由器 0 上的路由。

您需要像在 Router0 上一样配置 Router1。您还可以捕获数据包(即 Wireshark)来检查 OSPF hello 数据包,如果路由器正在发送它们,那么该路由器上的 OSPF 应该已启动。

例如:(路由器 1)

interface g0/0
ip address 210.1.1.1 255.255.255.224
no shutdown

interface s0/0/1
ip address 172.20.0.222 255.255.255.252
no shutdown

router ospf 1
router-id 1.1.1.1

network 210.1.1.1 0.0.0.31 area 0
network 172.20.0.222 0.0.0.3 area 0