一、实验拓扑: 二、命令部署: 1、第一种:重分发静态路由方式: R1(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.4 R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1 //为了回包

R1(config)#router eigrp 90 R1(config-router)#redistribute static

2、第二种:宣告默认路由方式: R1(config)#ip route 0.0.0.0 0.0.0.0 f1/0 R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#router eigrp 90 R1(config-router)#network 0.0.0.0

3、第三种:宣告主类网络方式: R1(config)#ip route 14.0.0.0 255.0.0.0 f1/0 R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#ip default-network 14.0.0.0 这里必须写为主类网络:14.0.0.0 R1(config)#ip route 14.0.0.0 255.0.0.0 f1/0 静态路由必须是主类

R1(config)#router eigrp 90 R1(config-router)#network 14.0.0.0 0.0.0.255 必须宣告14.0.0.0

4、第四种:路由聚合(路由汇总)方式:汇总到 0.0.0.0 0.0.0.0 R1(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.4 R4(config)#ip route 0.0.0.0 0.0.0.0 14.1.1.1

R1(config)#int f0/0 R1(config-if)#ip summary-address eigrp 90 0.0.0.0 0.0.0.0

三、验证: 1、第一种:重分发静态 R2#show ip route //可以看到1条170的默认外部路由,因为是通过重分发引进来的,并不是EIGRP本身的路由条目 D*EX 0.0.0.0/0 [170/30720] via 12.1.1.1, 00:00:34, FastEthernet0/0 同理:R3和R2一样的效果。

2、第二种:宣告默认路由方式: R2#show ip route D* 0.0.0.0/0 [90/30720] via 12.1.1.1, 00:00:26, FastEthernet0/0

3、第三种:宣告主类网络方式: R2#show ip route D* 14.0.0.0/8 [90/30720] via 12.1.1.1, 00:00:33, FastEthernet0/0 此为默认路由

R2#ping 4.4.4.4
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: UUUUU 结论:因为默认网关R1:没有到4.4.4.4的路由条目,如无默认路由效果是:…..

R2#ping 14.1.1.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 14.1.1.4, timeout is 2 seconds: .!!!! 结论:有14.1.1.1的默认路由 4、第四种:路由聚合(路由汇总)方式:汇总到 0.0.0.0 0.0.0.0 R2#show ip route D* 0.0.0.0/0 [90/30720] via 12.1.1.1, 00:00:45, FastEthernet0/0