设为首页收藏本站language 语言切换
查看: 2756|回复: 14
收起左侧

[求助] 关于将OSPF外部路由重分发进其他路由协议的问题?

[复制链接]
发表于 2016-4-25 20:35:15 | 显示全部楼层 |阅读模式
3鸿鹄币
先看命令:router eigrp

redistribute ospf 1 match external 2

我在R2上做了重分发,将RIP路由重分发进了OSPF域内,R1上出现了RIP域内的路由:
Gateway of last resort is not set

      3.0.0.0/24 is subnetted, 1 subnets
O E2     3.3.3.0 [110/20] via 192.168.1.2, 00:32:51, Serial2/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/65] via 192.168.2.1, 00:50:22, Serial2/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Serial2/1
L        192.168.1.1/32 is directly connected, Serial2/1
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, Serial2/0
L        192.168.2.2/32 is directly connected, Serial2/0
O E2  192.168.3.0/24 [110/20] via 192.168.1.2, 00:32:51, Serial2/1
R1#  

然后通过一条串行线在R2的上方又做了一个EIGRP,R2的S2/3接口和R5的所有接口都宣告进了EIGRP 90.
最后我想在R2上做一个重分发,将OSPF域内的外部路由就是R1上打OE的那些路由给重分发进EIGRP 90当中,所以才用了redistribute ospf 1 match external 2 metric 1 1 1 1 1500 ,但是做完之后在R5的路由表上并没有出现这些OSPF域内的外部路由,请问这是怎么回事?
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.5.0/24 is directly connected, Loopback1
L        172.16.5.1/32 is directly connected, Loopback1
      192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.4.0/24 is directly connected, Serial2/3
L        192.168.4.2/32 is directly connected, Serial2/3
R5#

-------------------------------------------------------------------------------------------------------
这是各个路由器的配置:
R1#  show runn
Building configuration...

Current configuration : 1273 bytes
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef   
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
!         
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex full
!
interface FastEthernet1/0
no ip address
shutdown
speed auto
duplex auto
!
interface FastEthernet1/1
no ip address
shutdown
speed auto
duplex auto
!
interface Serial2/0
ip address 192.168.2.2 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
!
interface Serial2/1
ip address 192.168.1.1 255.255.255.0
ip ospf 1 area 0
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
router-id 1.1.1.1
!
ip forward-protocol nd
!
!         
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!         
end

R1#   

-----------------------------
Building configuration...

Current configuration : 1570 bytes
!
! Last configuration change at 20:16:42 UTC Mon Apr 25 2016
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!         
no ip domain lookup
ip cef
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!         
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex full
!
interface FastEthernet1/0
no ip address
shutdown
speed auto
duplex auto
!
interface FastEthernet1/1
no ip address
shutdown
speed auto
duplex auto
!         
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
ip address 192.168.1.2 255.255.255.0
ip ospf 1 area 0
serial restart-delay 0
!
interface Serial2/2
ip address 192.168.3.1 255.255.255.0
serial restart-delay 0
!
interface Serial2/3
ip address 192.168.4.1 255.255.255.0
serial restart-delay 0
!
!
router eigrp 90
network 192.168.4.1 0.0.0.0
redistribute ospf 1 match external 2 metric 1 1 1 1 1500
!         
router ospf 1
router-id 2.2.2.2
redistribute rip subnets
!
router rip
version 2
redistribute ospf 1 metric 3 match internal
network 192.168.3.0
no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!
end

R2# show runn
Building configuration...

Current configuration : 1570 bytes
!
! Last configuration change at 20:16:42 UTC Mon Apr 25 2016
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!         
no ip domain lookup
ip cef
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!         
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex full
!
interface FastEthernet1/0
no ip address
shutdown
speed auto
duplex auto
!
interface FastEthernet1/1
no ip address
shutdown
speed auto
duplex auto
!         
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
ip address 192.168.1.2 255.255.255.0
ip ospf 1 area 0
serial restart-delay 0
!
interface Serial2/2
ip address 192.168.3.1 255.255.255.0
serial restart-delay 0
!
interface Serial2/3
ip address 192.168.4.1 255.255.255.0
serial restart-delay 0
!
!
router eigrp 90
network 192.168.4.1 0.0.0.0
redistribute ospf 1 match external 2 metric 1 1 1 1 1500
!         
router ospf 1
router-id 2.2.2.2
redistribute rip subnets
!
router rip
version 2
redistribute ospf 1 metric 3 match internal
network 192.168.3.0
no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!
end

R2#  

----------------------------------------------------------
R3#show runn
Building configuration...

Current configuration : 1324 bytes
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef   
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!         
!
!
!
!
interface Loopback1
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex full
!
interface FastEthernet1/0
no ip address
shutdown
speed auto
duplex auto
!
interface FastEthernet1/1
no ip address
shutdown
speed auto
duplex auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
ip address 192.168.3.2 255.255.255.0
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router rip
version 2
network 3.0.0.0
network 192.168.3.0
no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!
end

------------------------------------------
R4#show running-config
Building configuration...

Current configuration : 1410 bytes
!
! Last configuration change at 19:27:20 UTC Mon Apr 25 2016
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!         
no ip domain lookup
ip cef
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!         
!
!
!
!
!
!
interface Loopback1
ip address 4.4.4.4 255.255.255.0
ip ospf 1 area 1
!
interface FastEthernet0/0
no ip address
shutdown
duplex full
!
interface FastEthernet1/0
no ip address
shutdown
speed auto
duplex auto
!
interface FastEthernet1/1
no ip address
shutdown
speed auto
duplex auto
!
interface Serial2/0
ip address 192.168.2.1 255.255.255.0
ip ospf 1 area 1
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
router-id 4.4.4.4
network 4.4.4.4 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!
end

R4#   

------------------------------------------------
R5#show running-config
Building configuration...

Current configuration : 1347 bytes
!
! Last configuration change at 20:17:18 UTC Mon Apr 25 2016
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!         
no ip domain lookup
ip cef
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!         
!
!
!
!
!
!
interface Loopback1
ip address 172.16.5.1 255.255.255.0
!
interface FastEthernet0/0
no ip address
shutdown
duplex full
!
interface FastEthernet1/0
no ip address
shutdown
speed auto
duplex auto
!
interface FastEthernet1/1
no ip address
shutdown
speed auto
duplex auto
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
ip address 192.168.4.2 255.255.255.0
serial restart-delay 0
!
!         
router eigrp 90
network 0.0.0.0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!
end

R5#  


捕获.PNG

最佳答案

查看完整内容

噢噢噢,大多数人在学习的初期都有你这种误解。我也曾经有过。R1上的OE2是从R2得到的,在R2上show ip ospf database的话,你可以看到LSA OE2,但是ADV Router是R2自身,而不是R1。AD是在比较通过不同路由协议学来的路由信息时使用的,但是在你这个结构里,在R2来看,3.3.3.3的来源只有一个,也就是RIP,所以没有办法比较。如果有第三者通过OSPF重分发了关于3.3.3.3的路由的话,R2应该会选择那个OE2。
发表于 2016-4-25 20:35:16 | 显示全部楼层
ccnafasttrack 发表于 2016-4-27 14:04
还有个问题。那就是将RIP路由重分发进OSPF(在R2上),为什么同属于ospf域的R1就有,而R2却选择了管理距 ...

噢噢噢,大多数人在学习的初期都有你这种误解。我也曾经有过。R1上的OE2是从R2得到的,在R2上show ip ospf database的话,你可以看到LSA OE2,但是ADV Router是R2自身,而不是R1。AD是在比较通过不同路由协议学来的路由信息时使用的,但是在你这个结构里,在R2来看,3.3.3.3的来源只有一个,也就是RIP,所以没有办法比较。如果有第三者通过OSPF重分发了关于3.3.3.3的路由的话,R2应该会选择那个OE2。
沙发 2016-4-25 20:35:16 回复 收起回复
回复

使用道具 举报

发表于 2016-4-25 23:51:04 | 显示全部楼层
你弄错地方了 。在r1这样做可以实现。

但是在r2上,你所谓的在r1上的OE2的这些条目都是不存在的。或者说是不在ospf域内的。重分布是基于路由表来操作的。你要把一个条目从ospf重分布到eigrp,那么这个条目在路由表中就要是表现为ospf的条目。但是现在他们是直连的或者是rip条目啊  

点评

回答的好啊,明白了  发表于 2016-4-28 12:52

评分

参与人数 1好评度 +1 收起 理由
ccnafasttrack + 1 很给力!

查看全部评分

板凳 2016-4-25 23:51:04 回复 收起回复
回复

使用道具 举报

发表于 2016-4-26 08:43:43 | 显示全部楼层
smallszg 发表于 2016-4-26 00:51
你弄错地方了 。在r1这样做可以实现。

但是在r2上,你所谓的在r1上的OE2的这些条目都是不存在的。或者 ...



地板 2016-4-26 08:43:43 回复 收起回复
回复

使用道具 举报

发表于 2016-4-26 08:44:42 | 显示全部楼层
在R2上看的话,是不存在OE2的。RIP学来的路由,应该是R打头的, 所以你重分发OE2是不行的。R2上做的话,你应该重分发RIP才对。路由表里的信息show ip route看一看哟
5# 2016-4-26 08:44:42 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-27 11:01:01 | 显示全部楼层
smallszg 发表于 2016-4-25 23:51
你弄错地方了 。在r1这样做可以实现。

但是在r2上,你所谓的在r1上的OE2的这些条目都是不存在的。或者 ...

还真是......那为什么同属于OSPF域的R1就会有,而在R2上就没有呢?难道和路由表的某些工作原理有关?
捕获.PNG
6# 2016-4-27 11:01:01 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-27 11:04:30 | 显示全部楼层
sboku 发表于 2016-4-26 08:44
在R2上看的话,是不存在OE2的。RIP学来的路由,应该是R打头的, 所以你重分发OE2是不行的。R2上做的话,你应 ...

刚才重新看了下R2的路由表,的确不存在OE的路由。但是此时如果在R2上将OSPF的路由重分发进RIP也不能做啊?因为在R2上路由表根本就不会发生任何变化。应该是和楼上说的那样,在R1上做合适些吧?
7# 2016-4-27 11:04:30 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-27 11:16:27 | 显示全部楼层
sboku 发表于 2016-4-26 08:44
在R2上看的话,是不存在OE2的。RIP学来的路由,应该是R打头的, 所以你重分发OE2是不行的。R2上做的话,你应 ...

因为在R3上就没有所谓OSPF协议,我分析的对吗?
8# 2016-4-27 11:16:27 回复 收起回复
回复

使用道具 举报

发表于 2016-4-27 12:35:48 | 显示全部楼层
ccnafasttrack 发表于 2016-4-27 12:16
因为在R3上就没有所谓OSPF协议,我分析的对吗?

看你这个图,R2和R5是EIGRP neighbor,所以,在R2的EIGRP上应该可以Redistribute RIP的。

router eigrp xxx
redistribute rip metric x x x x x

这样,应该可以,你试试
9# 2016-4-27 12:35:48 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-27 13:01:22 | 显示全部楼层
sboku 发表于 2016-4-27 12:35
看你这个图,R2和R5是EIGRP neighbor,所以,在R2的EIGRP上应该可以Redistribute RIP的。

router eigr ...

sorry,刚才我误解你的意思了。我的原意是要使用redistribute ospf 1 match这条命令,所以呢,我不重分发RIP。刚才重新弄了一下拓扑,将R5连接到了R1上,将R1上的OSPF外部路由重分发进了EIGRP,这样的话,从R5到R3去的路由就全部都有了。回程呢,先将OSPF路由重分发进了RIP,然后又将EIGRP路由重分发进了OSPF,所以一切都通了。谢谢大神。
捕获.PNG
10# 2016-4-27 13:01:22 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-27 13:04:23 | 显示全部楼层
sboku 发表于 2016-4-27 12:35
看你这个图,R2和R5是EIGRP neighbor,所以,在R2的EIGRP上应该可以Redistribute RIP的。

router eigr ...

还有个问题。那就是将RIP路由重分发进OSPF(在R2上),为什么同属于ospf域的R1就有,而R2却选择了管理距离小于OSPF外部路由的RIP路由呢?
11# 2016-4-27 13:04:23 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-27 17:54:06 | 显示全部楼层
sboku 发表于 2016-4-27 15:37
噢噢噢,大多数人在学习的初期都有你这种误解。我也曾经有过。R1上的OE2是从R2得到的,在R2上show ip osp ...

老师这么讲的话,我就明白了。也就是说,3.3.3.3只是通过RIP这个路由协议学习到的,而R2除了通过RIP学习到这条路由之外,没有别的途径,也就是没得比,而自己重分布出去的又不算。R1则不同,它在R2重分布RIP之前根本就没有3.3.3.3自然也就选择了OE打头的,没有打R的路由来参与竞争。爱死你了,老师,我要给你红包,感谢这么长时间以来你的帮助
12# 2016-4-27 17:54:06 回复 收起回复
回复

使用道具 举报

发表于 2016-4-28 01:07:48 | 显示全部楼层
ccnafasttrack 发表于 2016-4-27 18:54
老师这么讲的话,我就明白了。也就是说,3.3.3.3只是通过RIP这个路由协议学习到的,而R2除了通过RIP学习 ...

最好是给我金条
13# 2016-4-28 01:07:48 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2016-4-28 12:51:50 | 显示全部楼层
sboku 发表于 2016-4-28 01:07
最好是给我金条

有袁大头,行吗
14# 2016-4-28 12:51:50 回复 收起回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-4-25 12:14 , Processed in 0.272221 second(s), 30 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表