在做这个实验的时候主要是要按照的以下几个步骤进行:
一、对路由器进行模块的添加(我用的是2811),然后连线。

rip与ospf路由重分布_路由 重分布 rip ospf 单向pi 然后我选用了三台相同的路由器,连线之后得到的拓扑图为:

 

rip与ospf路由重分布_路由 重分布 rip ospf 单向pi_02 用的是R1的s0/0/0的端口接的R2的s0/0/0,R2的s0/0/1接的是R3的s0/0/1。

二、对三台路由器进行最基本的配置:

 

 

R1:Continue with configuration dialog? [yes/no]: no
     Press RETURN to get started!
     Router>en
     Router#conf t
     Enter configuration commands, one per line. End with CNTL/Z     
     Router(config)#hostname R1
     R1(config)#int loop 0
     %LINK-5-CHANGED: Interface Loopback0, changed state to up
     %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
     R1(config-if)#ip add 1.1.1.1 255.255.255.0
     R1(config-if)#no shut
     R1(config-if)#ex
     R1(config)#int s0/0/0
     R1(config-if)#ip add 192.168.1.10 255.255.255.0
     R1(config-if)#clock rate 64000
     R1(config-if)#no shut
     %LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
     R1(config-if)#
 
R2:Router>en
    Router#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    Router(config)#host R2
    R2(config)#int loop 0
    %LINK-5-CHANGED: Interface Loopback0, changed state to up
    %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
    R2(config-if)#ip add 2.2.2.2 255.255.255.0
    R2(config-if)#no shut
    R2(config-if)#ex
    R2(config)#int s0/0/0
    R2(config-if)#ip add 192.168.1.20 255.255.255.0
    R2(config-if)#no shut
    %LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
    R2(config-if)#ex
    R2(config)#int s0/0/1
    %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
    R2(config-if)#ip add 10.10.10.10 255.255.255.0
    R2(config-if)#clock rate 64000
   R2(config-if)#no shut
 
   %LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
 
 
R3:ter>en
     Router#conf t
     Enter configuration commands, one per line. End with CNTL/Z.
     Router(config)#host R3
     R3(config)#int loop 3.3.3.3 255.255.255.0
     R3(config)#int loop 0
     %LINK-5-CHANGED: Interface Loopback0, changed state to up
     %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
     R3(config-if)#ip add 3.3.3.3 255.255.255.0
     R3(config-if)#no shut
     R3(config-if)#ex
     R3(config)#int s0/0/1
     R3(config-if)#ip add 10.10.10.20 255.255.255.0
     R3(config-if)#no shut
     %LINK-5-CHANGED: Interface Serial0/0/1, changed state to up
    %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to u

三、对几台路由器进行rip或则ospf的配置,但是既然是路由重分布,肯定彼此之间用的不是相同的协议,所以R2的不同端口用的是不同的协议,这里我们就先讨论RIPOSPF的路由重分布。以后慢慢讨论EIGRPIS-ISBGPRIPOSPF之间的重分布。

R1:

R1(config-if)#ex
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#net 1.1.1.1
R1(config-router)#net 192.168.1.0
 
R2:
 
R2是最要的,是重分布成功与否的关键。
R2(config-if)#ex
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#net 192.168.1.0
R2(config-router)#redistribute ospf 100 metric 3
R2(config-router)#router ospf 100
R2(config-router)#net 10.10.10.0 0.0.0
R2(config-router)#net 10.10.10.0 0.0.0.255 area 0
R2(config-router)#net 2.2.2.2 0.0.0.255 area 0
R2(config-router)#redistribute rip metric 3 subnets
 
R3:
 
R3(config-if)#ex
R3(config)#int s0/0/1
R3(config-if)#ip add 10.10.10.20 255.255.255.0
R3(config-if)#no shut
R3(config-if)#ex
R3(config)#int loop 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#router ospf 100
R3(config-router)#net 10.10.10.0 0.0.0.255 area 0
R3(config-router)#net 3.3.3.3 0.0.0.255 area 0
00:14:22: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.2.2 on Serial0/0/1 from LOADING to FULL, Loading Done

现在几台的充分部已经差不多了,我们可以ping一下,看看可不可以ping通,

 

R1:
R1>en
R1#ping 2.2.2.2
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
 
R1#ping 192.168.1.20
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
 
R1#ping 192.168.1.0
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.0, timeout is 2 seconds:
 
Reply to request 0 from 192.168.1.20, 31 ms
Reply to request 1 from 192.168.1.20, 31 ms
Reply to request 2 from 192.168.1.20, 31 ms
Reply to request 3 from 192.168.1.20, 31 ms
Reply to request 4 from 192.168.1.20, 31 ms
 
R1#ping 3.3.3.3
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
 
R1#ping 10.10.10.20
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms
 
R1#
 
R2:
R2>en
R2#ping 1.1.1.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 17/28/32 ms
 
R2#ping 192.168.1.0
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.0, timeout is 2 seconds:
 
Reply to request 0 from 192.168.1.10, 32 ms
Reply to request 1 from 192.168.1.10, 32 ms
Reply to request 2 from 192.168.1.10, 32 ms
Reply to request 3 from 192.168.1.10, 31 ms
Reply to request 4 from 192.168.1.10, 31 ms
 
R2#ping 10.10.10.0
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.0, timeout is 2 seconds:
 
Reply to request 0 from 10.10.10.20, 31 ms
Reply to request 1 from 10.10.10.20, 31 ms
Reply to request 2 from 10.10.10.20, 31 ms
Reply to request 3 from 10.10.10.20, 31 ms
Reply to request 4 from 10.10.10.20, 15 ms
 
R2#ping 3.3.3.3
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
 
 
R3:
R3>en
R3#ping 1.1.1.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms
 
R3#ping 192.168.1.0
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.0, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
 
R3#ping 192.168.1.20
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
 
R3#ping 192.168.1.20
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.20, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms
 
R3#ping 10.10.10.10
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 17/28/32 ms
 
R3#ping 10.10.10.0
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.0, timeout is 2 seconds:
 
Reply to request 0 from 10.10.10.10, 31 ms
Reply to request 1 from 10.10.10.10, 31 ms
Reply to request 2 from 10.10.10.10, 31 ms
Reply to request 3 from 10.10.10.10, 31 ms
Reply to request 4 from 10.10.10.10, 31 ms

        通过ping的过程,细心的朋友会发现:R1ping3.3.3.3ping不通,而R3ping1.1.1.1可以通,那么其中的原因是什么啊?

       其实在实际生活中发生这种情况有以下两种可能性:

一、安装了个人防火墙

   
在共享上网的机器中,出于安全考虑,大部分作为服务器的主机都安装了个人防火墙软件,而其他作为客户机的机器则一般不安装。几乎所有的个人防火墙软件,默认情况下是不允许其他机器Ping本机的。一般的做法是将来自外部的ICMP请求报文滤掉,但它却对本机出去的ICMP请求报文,以及来自外部的ICMP应答报文不加任何限制。这样,从本机Ping其他机器时,如果网络正常,就没有问题。但如果从其他机器Ping这台机器,即使网络一切正常,也会出现超时无应答的错误。

   
大部分的单方向Ping通现象源于此。解决的办法也很简单,根据你自己所用的不同类型的防火墙,调整相应的设置即可。

   
二、错误设置IP地址

   
正常情况下,一台主机应该有一个网卡,一个IP地址,或多个网卡,多个IP地址(这些地址一定要处于不同的IP子网)。但对于在公共场所使用的电脑,特别是网吧,人多手杂,其中不泛有探索者。曾有一次两台电脑也出现了这种单方向Ping通的情况,经过仔细检查,发现其中一台电脑的拨号网络适配器(相当于一块软网卡)的TCP/IP设置中,设置了一个与网卡IP地址处于同一子网的IP地址,这样,在IP层协议看来,这台主机就有两个不同的接口处于同一网段内。当从这台主机Ping其他的机器时,会存在这样的问题:

   
1)主机不知道将数据包发到哪个网络接口,因为有两个网络接口都连接在同一网段;

   
2)主机不知道用哪个地址作为数据包的源地址。因此,从这台主机去Ping其他机器,IP层协议会无法处理,超时后,Ping 就会给出一个超时无应答的错误信息提示。但从其他主机Ping这台主机时,请求包从特定的网卡来,ICMP只须简单地将目的、源地址互换,并更改一些标志即可,ICMP应答包能顺利发出,其他主机也就能成功Ping通这台机器了。

   当然在这里不可能是防火墙的问题。那么细心的你,慢慢下去试试,看看其中的原因是什么?在一篇博文中我将会解决这个问题。