雏鹰部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2294|回复: 6

[讨论/求助] 双点双向重分布的思路和解决方法

[复制链接]
发表于 2013-4-23 09:11:22 | 显示全部楼层 |阅读模式
本帖最后由 子杰 于 2013-9-13 16:10 编辑

  双点双向重分布的思路和解决方法
例子:
R1/R2/R3互联端口运行OSPF协议,R2/R3/R4互联端口运行EIGRP协议,R1的loopback0重分布进OSPF协议中,R4的loopback 0重分布进EIGRP协议中;现在要实现R1能通过R3和R4都能学习到2.2.2.2/24的路由条目,R2能通过R3和R4都能学习到1.1.1.1/24;

  双点双向重分布的思路
该题目会出现R1不能通过R3和R4同时学习到2.2.2.2/24;
网段1.1.1.1/24重分布进OSPF协议后,R3和R4都做OSPF重分布进EIGRP中,假设先对R3做重分布,此时R4与R3也是EIGRP邻居,所以R3会将1.1.1.1/24路由告诉给R4,但R4与R1也是OSPF邻居,所以R1也会将1.1.1.1/24的路由告诉给R4,因为R4从R1学习到1.1.1.1/24的AD值为120,R4从R3学习到的1.1.1.1/24的AD值为170,所以R4是将通过OSPF学习到1.1.1.1/24放进路由表中;这时R4再做OSPF重分布进EIGRP中,会将通过OSPF学习到1.1.1.1/24也重分布进EIGRP中,这样R2就能学习到通过R3和R4过来的1.1.1.0/24路由条目;

同样的道理:
网段2.2.2.2/24重分布进EIGRP协议后,R3和R4都做EIGRP重分布进OSPF协议中,假设是先在R3做这个重分布,此时R1能通过R3学习到2.2.2.0/24,且R1和R4也是OSPF邻居,所以R4也会学习到2.2.2.2/24;但R2与R4也是EIGRP邻居,所以R4能通过R2学习到2.2.2.2/24;在R4中通过R1学习到2.2.2.2/24的AD为120,通过R2学习到的2.2.2.2/24的AD值为170,所以在R4的路由表只会存放从R1学习到的2.2.2.2/24路由条目。此时在R4做EIGRP重分布进OSPF协议这个动作,并不能将2.2.2.2/24的路由条目通过EIGRP路由身份重分布进OSPF协议中,因为R4路由表里并没有以EIGRP身份存在的2.2.2.2/24路由条目;
所以通过以下的两种方法来解决该问题;

解决方法
方法一配置步骤(打tag)
步骤一:
R1/R2/R3/R4基础配置
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0      
interface FastEthernet0/0
  ip address 13.13.13.1 255.255.255.0
interface FastEthernet1/0
ip address 14.14.14.1 255.255.255.0
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0   
interface FastEthernet0/0
ip address 23.23.23.2 255.255.255.0
interface FastEthernet1/0
ip address 24.24.24.2 255.255.255.0
R3:
interface FastEthernet0/0
ip address 13.13.13.3 255.255.255.0
interface FastEthernet1/0
ip address 23.23.23.3 255.255.255.0
R4:
interface FastEthernet0/0
ip address 14.14.14.4 255.255.255.0
interface FastEthernet1/0
ip address 24.24.24.4 255.255.255.0
步骤二:
R1/R3/R4运行OSPF协议
R1
router ospf 1
router-id 1.1.1.1
network 13.13.13.0 0.0.0.255 area 0
network 14.14.14.0 0.0.0.255 area 0
redistribute connected subnets
R3
router ospf 1
router-id 3.3.3.3
network 13.13.13.0 0.0.0.255 area 0
R4
router ospf 1
router-id 4.4.4.4
network 14.14.14.0 0.0.0.255 area 0
R2/R3/R4运行EIGRP
R2
router eigrp 1
redistribute connected metric 1000 100 255 11500
network 23.23.23.0 0.0.0.255
network 24.24.24.0 0.0.0.255
no auto-summary
R3
router eigrp 1
network 23.23.23.0 0.0.0.255
no auto-summary
R4
router eigrp 1
network 24.24.24.0 0.0.0.255
no auto-summary
步骤三:
R4
access-list1 permit 2.2.2.0 0.0.0.255
route-map ccna permit 10
match ip address 1
set tag 120
route-map ccna permit 20
router ospf 1
redistribute eigrp 1 subnets route-map ccna
/通过ACL抓起2.2.2.0/24,再通过route-map对2.2.2.0/24进行打tag120,并将route-map重分布进OSPF中,传递给R3设备/
route-map spoto deny 10
match tag 100
route-map spoto permit 20
router ospf 1
distribute-list route-map spoto in
/从R4学习到带有tag为100的网段,通过分发列表拒绝重分布进R3中/
R3
access-list1 permit 2.2.2.0 0.0.0.255
route-map spoto permit 10
match ip address 1
set tag 100
route-map spoto permit 20
router ospf 1
redistribute eigrp 1 subnets route-map spoto
/通过ACL抓起2.2.2.0/24,再通过route-map对2.2.2.0/24进行打tag100,并将route-map重分布进OSPF中,传递给R4设备/
route-map ccna deny 10
match tag 120
route-map ccna permit 20
routerospf 1
distribute-list route-map ccna in
/从R3学习到带有tag为120的网段,通过分发列表拒绝重分布进R4中/

方法二配置步骤(修改distance值)
步骤一:
R1/R2/R3/R4基础配置
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0      
interface FastEthernet0/0
ip address 13.13.13.1 255.255.255.0
interface FastEthernet1/0
ip address 14.14.14.1 255.255.255.0
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.0   
interface FastEthernet0/0
ip address 23.23.23.2 255.255.255.0
interface FastEthernet1/0
ip address 24.24.24.2 255.255.255.0
R3:
interface FastEthernet0/0
ip address 13.13.13.3 255.255.255.0
interface FastEthernet1/0
ip address 23.23.23.3 255.255.255.0
R4:
interface FastEthernet0/0
ip address 14.14.14.4 255.255.255.0
interface FastEthernet1/0
ip address 24.24.24.4 255.255.255.0
步骤二:
R1/R3/R4运行OSPF协议
R1
router ospf 1
router-id 1.1.1.1
network 13.13.13.0 0.0.0.255 area 0
network 14.14.14.0 0.0.0.255 area 0
redistribute connected subnets
R3
router ospf 1
router-id 3.3.3.3
network 13.13.13.0 0.0.0.255 area 0
R4
router ospf 1
router-id 4.4.4.4
network 14.14.14.0 0.0.0.255 area 0
R2/R3/R4运行EIGRP
R2
router eigrp 1
redistribute connected metric 1000 100 255 11500
network 23.23.23.0 0.0.0.255
network 24.24.24.0 0.0.0.255
no auto-summary
R3
router eigrp 1
network 23.23.23.0 0.0.0.255
no auto-summary
R4
router eigrp 1
network 24.24.24.0 0.0.0.255
no auto-summary
步骤三:
R3
router ospf 1
distance 180 4.4.4.4 0.0.0.0  /将从R4学习到的所有路由条目的AD值改为180/
R4
router ospf 1
distance 180 3.3.3.3 0.0.0.0  /将从R3学习到的所有路由条目的AD值改为180/
注意:若命令是写成
access-list1 permit 1.1.1.0
router ospf 110
distance 175 1.1.1.1 0.0.0.0 1 /最后的1表示ACL列表号为1的网段重分布进去时路由AD改为175/



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
发表于 2013-4-23 09:31:45 | 显示全部楼层
双点双向是路由控制的难点。
感谢Jay的分享。
发表于 2013-4-23 09:44:33 | 显示全部楼层
感谢楼主
发表于 2013-4-23 15:12:41 | 显示全部楼层
好东西
发表于 2013-4-28 15:52:36 | 显示全部楼层
看到这个重分布 翻开随堂笔记又看了一遍 上课的一幕幕又重现眼前 呵呵 支持
发表于 2013-4-28 22:26:27 | 显示全部楼层
虽然现在看不懂,但先熟悉下。
发表于 2013-5-7 00:36:39 | 显示全部楼层
研究了一晚上,终于有所领悟,谢谢杰哥的分享,明天晚上继续学习……
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-4-20 23:24 , Processed in 0.077745 second(s), 19 queries , Gzip On.

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