A-A+

实战:RIP和EIGRP路由再发布的设置步骤

2015年11月23日 站长资讯 暂无评论

不同的动态路由协议之间需要交换路由表,也需要进行路由再发布。

打开随书光盘中第6章练习“07 RIP和EIGRP路由再发布.pkt”,网络拓扑如图6-23所示。网络中的路由器和计算机已经按照图示的地址配置完成。Router0和Router1运行了RIPv2,并且关闭了自动汇总,Router1和Router2运行了EIGRP协议。

你需要配置Router1将EIGRP协议学到的路由通过RIP协议通告给Router0;配置Router1将RIPv2学到的路由通过EIGRP协议通告给Router2。

▲图6-23 RIP和EIGRP路由再发布的网络拓扑

操作步骤如下。

(1)在Router1上运行show ip route命令查看路由表。

  1. Router1#show ip route  
  2.   
  3. Gateway of last resort is not set  
  4.   
  5. 10.0.0.0/30 is subnetted, 2 subnets  
  6.   
  7. C 10.0.0.0 is directly connected, Serial3/0  
  8.   
  9. C 10.0.0.4 is directly connected, Serial2/0  
  10.   
  11. 172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks  
  12.   
  13. R 172.16.0.0/24 [120/1] via 10.0.0.1, 00:00:26, Serial3/0  
  14.   
  15. R 172.16.1.0/24 [120/1] via 10.0.0.1, 00:00:26, Serial3/0  
  16.   
  17. R 172.16.2.0/24 [120/1] via 10.0.0.1, 00:00:26, Serial3/0  
  18.   
  19. D 192.168.0.0/24 [90/20514560] via 10.0.0.6, 00:35:10, Serial2/0  

可以看到在Router1上的路由表中包括了通过RIP协议学到的路由和通过EIGRP协议学到的路由。

(2)在Router0上查看路由表。

  1. Router0#show ip route  
  2.   
  3. Gateway of last resort is not set  
  4.   
  5. 10.0.0.0/30 is subnetted, 2 subnets  
  6.   
  7. C 10.0.0.0 is directly connected, Serial2/0  
  8.   
  9. R 10.0.0.4 [120/1] via 10.0.0.2, 00:00:14, Serial2/0  
  10.   
  11. 172.16.0.0/24 is subnetted, 3 subnets  
  12.   
  13. C 172.16.0.0 is directly connected, FastEthernet0/0  
  14.   
  15. C 172.16.1.0 is directly connected, FastEthernet1/0  
  16.   
  17. C 172.16.2.0 is directly connected, FastEthernet6/0  

可以看到Router1没有将其通过EIGRP学到的路由通过RIP协议通告给Router0。

(3)在Router2上查看路由表。

同样可以看到Router1没有将其通过RIP学到的路由通过EIGRP协议通告给Router2。

(4)在Router1上配置将EIGRP发布到RIP。

  1. Router1#config t  
  2.   
  3. Router1(config)#router rip  
  4.   
  5. Router1(config-router)#redistribute eigrp 10 metric ?  
  6.   
  7. <0-16> Default metric  
  8.   
  9. transparent Transparently redistribute metric  
  10.   
  11. Router1(config-router)#redistribute eigrp 10 metric 3  

最后一条命令将EIGRP协议学到的路由度量值转化为RIP协议的度量值3。

(5)在Router1上配置将RIP发布到EIGRP。

Router1(config)#router eigrp 10

Router1(config-router)#redistribute rip metric 10000 100 255 1 1500

最后一条命令是将RIP学到的路由度量值转化为EIGRP的度量值。其中:

10000:是带宽,单位是kb/s;

100:是延迟,单位是10us;

255:是可靠性,值可以是0~255,255是100%可靠;

1:是负载,值可以是1~255,255是100%负载,即网络将要堵塞;

1500:是最大传输单元(MTU),单位为8比特字节。

(6)在Router0上查看路由表。

  1. Router0#show ip route  
  2.   
  3. Gateway of last resort is not set  
  4.   
  5. 10.0.0.0/30 is subnetted, 2 subnets  
  6.   
  7. C 10.0.0.0 is directly connected, Serial2/0  
  8.   
  9. R 10.0.0.4 [120/1] via 10.0.0.2, 00:00:04, Serial2/0  
  10.   
  11. 172.16.0.0/24 is subnetted, 3 subnets  
  12.   
  13. C 172.16.0.0 is directly connected, FastEthernet0/0  
  14.   
  15. C 172.16.1.0 is directly connected, FastEthernet1/0  
  16.   
  17. C 172.16.2.0 is directly connected, FastEthernet6/0  
  18.   
  19. R 192.168.0.0/24 [120/3] via 10.0.0.2, 00:12:34, Serial2/0  

--学到了再发布的路由

(7)在Router2上查看路由表。

  1. Router2#show ip route  
  2.   
  3. Gateway of last resort is not set  
  4.   
  5. 10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks  
  6.   
  7. D 10.0.0.0/8 is a summary, 01:04:04, Null0  
  8.   
  9. D 10.0.0.0/30 [90/21024000] via 10.0.0.5, 01:04:04, Serial3/0  
  10.   
  11. C 10.0.0.4/30 is directly connected, Serial3/0  
  12.   
  13. 172.16.0.0/24 is subnetted, 3 subnets  
  14.   
  15. D EX 172.16.0.0 [170/20537600] via 10.0.0.5, 00:07:39, Serial3/0  

--再发布的路由

D EX 172.16.1.0 [170/20537600] via 10.0.0.5, 00:07:39, Serial3/0

--再发布的路由

D EX 172.16.2.0 [170/20537600] via 10.0.0.5, 00:07:39, Serial3/0

--再发布的路由

C 192.168.0.0/24 is directly connected, FastEthernet0/0

可以看到D EX开头的路由是EIGRP的外部路由,也就是RIP发布到EIGRP的路由,管理距离是170。

(8)在PC0 上ping PC2,测试网络是否通。

PC>ping 192.168.0.2

(9)在Router1上取消再发布。

  1. Router1(config)#router eigrp 10  
  2.   
  3. Router1(config-router)#no redistribute rip --取消EIGRP到RIP的发布  
  4.   
  5. Router1(config)#router rip  
  6.   
  7. Router1(config-router)#no redistribute eigrp 10 --取消RIP到EIGRP的发布  
标签:

给我留言