首先要纠正一下,这张图的192.168.10.0/30这一段应该为192.168.10.0/24,因为非主类网络做放缺省可能出现奇怪的问题.
44

放缺省时,我们指有类网络,如果指的是无类网络时,将会出现问题.
配置这个default-network ,一直以来都不是很清楚的问题.老师讲它为放缺省. 我觉得把它说为协议发布会更好一点吧.如何理解?它的做法是在R2上做一条缺省路由,然后通过EIGRP来传递,让每个路由都能接收到来自R2的路由更新,达到每个路由器的缺省值为外部路由器地址.
其实有关这个放缺省,使用协议来承载会很方便(当然,它就不只是限于EIGRP,像OSPF,RIP应该都OK的),当然手工配置也是可以的.我不知道在企业中会不会都是这么用的.为了配合这张图,就先配置一下吧.
这个思路也是很简单;因为是使用EIGRP来做承载,所以配置的连通性,在此不多说了.
1.配置EIGRP,就当是练练手,做为我的复习阶段,多做些笔记还是很有用的.至少也说明在复习期间留了一下东西吧.
R1(config)#router eigrp 50
R1(config-router)#net 172.16.1.1
R1(config-router)#no au
R2(config)#router eigrp 50
R2(config-router)#no au
R2(config-router)#net 172.16.1.2
R2(config-router)#net 172.16.1.5
R2(config-router)#ip route 0.0.0.0 0.0.0.0 192.168.10.2   (互指默认路由)
R5(config)#router eig 50
R5(config-router)#net 172.16.1.6
R5(config-router)#no au
R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1      (互指默认路由)
验证一下: 确认没有问题.
R1#show ip route eig
     172.16.0.0/30 is subnetted, 2 subnets
D       172.16.1.4 [90/284160] via 172.16.1.2, 00:00:51, FastEthernet0/1
R5#show ip route eigrp
     172.16.0.0/30 is subnetted, 2 subnets
D       172.16.1.0 [90/307200] via 172.16.1.5, 00:00:13, Ethernet1/1
下一步,就是如何让EIGRP来承载那条放缺省路由呢? 首先我们需要写一条默认的路由,然后把R2的E1/1口,宣告到网络中来.
其实学完了CCNP后,我们可以手工的把这条路由宣告到EIGRP里去. 那这里,我们就把两种方法都做一下.
首先确认一下R1能不能PING通R3
R1#ping 192.168.10.2             >>>>>>>>>>>>>不通,当然了,没路由肯定不通.
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
>>>>>>1.放缺省:
R2(config)#router ei 50
R2(config-router)#net 192.168.10.10
R2(config-router)#exit
R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2
R2(config)#ip default-network 192.168.10.0
在R1上测一下:(通了)
R1#ping 192.168.3.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/129/180 ms
R1#show ip route
Gateway of last resort is 172.16.1.2 to network 192.168.10.0
D*   192.168.10.0/24 [90/284160] via 172.16.1.2, 00:03:33, FastEthernet0/1(来自172.16.1.2传来的EIGRP默认路由)
     172.16.0.0/30 is subnetted, 2 subnets
D       172.16.1.4 [90/284160] via 172.16.1.2, 00:03:33, FastEthernet0/1
C       172.16.1.0 is directly connected, FastEthernet0/1
>>>>>>2.静态路由重分发(书上是叫路由重分布,不过我叫不习惯,叫重分发还是习惯一点)
在R2上启用路由重分发,将静态路由重分布到EIGRP中。
R2(config)#router eigrp 50
R2(config-router)#red
R2(config-router)#redistribute st
R2(config-router)#redistribute static    (将其路的路由协议重分布到EIGRP中,它的默认Metric值为170)
在R1上我们来看一下路由表:
R1#show ip route
D    192.168.10.0/24 [90/284160] via 172.16.1.2, 00:03:18, FastEthernet0/1
     172.16.0.0/30 is subnetted, 2 subnets
D       172.16.1.4 [90/284160] via 172.16.1.2, 00:11:42, FastEthernet0/1
C       172.16.1.0 is directly connected, FastEthernet0/1
D*EX 0.0.0.0/0 [170/284160] via 172.16.1.2, 00:01:57, FastEthernet0/1  ------从R2那里学来的了。一条外部静态路由。AD值为170
总结:
1、使用放缺省有一定的限制(放缺省的一定要是主类网络,否则会出问题,我尝试了多次的证明),在某种情况下可能会造成路由环路。
2、使用路由重分布,操作简单,没有限制。
复习时做的实验,有问题欢迎大家指正,你的批评就是我的提升!