本帖最后由 子杰 于 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/
|