RIP协议和EIGEP协议
 
路由器的端口连接图如下:
Router1 S1/0 <----> Router2 S1/0
Router2 S1/1 <----> Router3 S1/0
Router<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1 F0/0 <----> VPCS V0/1
Router3 F0/0 <----> VPCS V0/2
拓扑图如下:
一、配置Router1
我们来在第一个路由器上配置路由的基本信息,定义路由器的名称、IP地址,时钟频率、开启端口,如下步骤:
R1:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Router>en

Router#conf t

Router(config)#hostname r1

r1(config)#int s1/0

r1(config-if)#ip addr 172.16.1.1 255.255.255.0

r1(config-if)#clock rate  64000

r1(config-if)#no shut

r1(config-if)#exit

r1(config)#int f0/0

r1(config-if)#ip addr 192.168.1.1 255.255.255.0

r1(config-if)#no shut

r1(config-if)#exit

基本的路由信息配置完成后,我们来配置RIP协议,以及宣告路由器上IP所在的网段
r1(config)#router rip

r1(config-router)#network  172.16.1.0

r1(config-router)#network  192.168.1.0

r1(config-router)#exit

r1(config-)#exit

二、配置Router2
接着我们来配置路由器二的基本信息,和路由器一的配置几乎一样,我们只须改一下IP地址即可
R2:

Router>en

Router#conf t

Router(config)#hostname r2

r2(config)#int s1/0

r2(config-if)#ip addr 172.16.1.2 255.255.255.0

r2(config-if)#no shut

r2(config-if)#exit

r2(config)#int s1/1

r2(config-if)#ip addr 172.10.1.1 255.255.255.0

r2(config-if)#clock rate 64000

r2(config-if)#no shut

r2(config-if)#exit

r2(config)#exit

在路由器二上配置OSPF协议,以及路由重分发,首先我们把RIP协议放入了OSPF协议中了。输入OSPF的进程号,以及AREA区域号,我们在这定义AREA的区域号为0.大家可以在“redistribute rip metric后面打“?”依次来查看
r2(config)#router ospf 1

r2(config-router)#redistribute rip metric 100

r2(config-router)#network 172.16.1.0   0.0.0.255  area 0

r2(config-router)#network 172.10.1.0   0.0.0.255  area 0

r2(config-router)#network 192.168.1.0   0.0.0.255  area 0

r2(config-router)#network 192.168.2.0   0.0.0.255  area 0

r2(config-router)#exit

下面我们来配置RIP协议并且把OSPF协议放入了RIP协议中了。
r2(config)#router rip

r2(config-router)#redistribute ospf 1 metric 2

r2(config-router)#network 172.16.1.0

r2(config-router)#network 172.10.1.0

r2(config-router)#network 192.168.1.0

r2(config-router)#network 192.168.2.0

r2(config-router)#exit

r2(config)#exit

三、配置Router3
最后我们来配置路由器三,首先是基本配置,和前两个路由的配置一样,只须改一下IP地址即可
R3:
Router>en

Router#conf t

Router(config)#hostname r3

r3(config)#int s1/0

r3(config-if)#ip addr 172.10.1.2 255.255.255.0

r3(config-if)#no shut

r3(config-if)#exit

r3(config)#int f0/0

r3(config-if)#ip addr 192.168.2.1 255.255.255.0

r3(config-if)#no shut

r3(config-if)#exit

接下来我们来在路由器三上配置OSPF协议,以及宣告路由器三上IP所在的网段
r3(config)#router ospf 1

r3(config-router)#network 172.10.1.0  0.0.0.255  area 0

r3(config-router)#network 192.168.2.0  0.0.0.255  area 0

r3(config-router)#exit

四、查看三个路由器的路由表
接下来我们来查看一下Router1的路由表,从中可以清楚地看见路由一已经学习到了其他网段的信息
在路由二的路由表中可以看见已经学习到了其他路由的信息,而且从中也可以看出用的协议是RIP协议和OSPF协议
Router3上也很正常学习到了其他网段的信息了
五、测试
各自的路由表中都有了其他路由的信息,那么毫无疑问肯定能通讯了。耳听为虚眼见为实,我们来在PC机上配置上IP地址来ping一下试试!

Ok!没问题。PC1可以ping通路由器二与路由器三的直连端口IP,也ping通了PC2
PC2也可以ping通路由器二与路由器一的直连端口IP,同时也ping通了PC1
 
 
 
本文出自 “幸福正在延续中......” 博客