RIPv1基本配置

来源:互联网 发布:学生宿舍网络设计方案 编辑:程序博客网 时间:2024/06/05 16:20

实验环境


RIPv1基本配置

Step1

配制前查看路由表的路由条目。例如R4:

R4#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,B - BGP

       D - EIGRP, EX -EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSAexternal type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF externaltype 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 -IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidatedefault, U - per-user static route, o - ODR

       P - periodicdownloaded static route

 

Gateway of last resort is not set

 

     4.0.0.0/32 issubnetted, 1 subnets

C       4.4.4.4 isdirectly connected, Loopback1

     34.0.0.0/24 issubnetted, 1 subnets

C       34.1.1.0 isdirectly connected, FastEthernet0/0


R1

R1(config)#router rip      //启用RIP协议

R1(config-router)#ver 1      //RIP版本为RIPv1。version 2,指定RIP版本为RIPv2

R1(config-router)#net 12.1.1.0      //network 目标网段(相邻的)

R1(config-router)#net 1.1.1.1

R1(config-router)#ex


R2

R2(config)#router rip

R2(config-router)#ver 1

R2(config-router)#net 12.1.1.0

R2(config-router)#net 23.1.1.0

R2(config-router)#net 2.2.2.2

R2(config-router)#ex


R3

R3(config)#router rip

R3(config-router)#ver 1

R3(config-router)#net 23.1.1.0

R3(config-router)#net 34.1.1.0

R3(config-router)#net 3.3.3.3

R3(config-router)#ex


R4

R4(config)#router rip

R4(config-router)#ver 1

R4(config-router)#net 34.1.1.0

R4(config-router)#net 4.4.4.4

R4(config-router)#ex


Step2

配置后查看路由表路由条目。例如R4:



以上说明,路由器R4通过RIP协议学到了5条路由。其中路由条目“R    1.0.0.0/8 [120/3] via 34.1.1.3, 00:00:00,FastEthernet0/0”含义如下:

R:路由条目是通过RIP学来的; 

1.0.0.0/8:目标网络;

120:RIP 路由协议的默认管理距离;

3: 度量值,从路由器 R4 到达网络 1.0.0.0/8 的度量值为 3 跳;

via 34.1.1.3:下一跳地址;

00:00:00:距离下一次更新还有30(30-00)秒;

FastEthernet0/0:接收该路由条目的本路由器的接口。


Step3

用ping命令来查看全网连通性。


Step4

使用show ip protocols查看路由协议。

R4#show ip protocols

Routing Protocol is "rip"

//路由器上运行的路由协议是 RIP

Sending updates every 30 seconds, next due in 5 seconds

//更新周期是 30 秒,距离下次更新还有5秒

Invalid after 180 seconds, hold down 180, flushed after 240

//invalid after:路由条目如果在 180 秒还没有收到更新,则被标记为无效

Outgoing update filter list for all interfaces is not set

//在出方向上没有设置过滤列表

Incoming update filter list for all interfaces is not set

//在入方向上没有设置过滤列表

Redistributing: rip

//只运行 RIP 协议,没有其它的协议重分布进来

Default version control: send version 1, receive 1

//默认发送版本 1 的路由更新,接收版本 1 的路由更新

  Interface             Send  Recv Triggered RIP  Key-chain

  FastEthernet0/0       1    1    

  Loopback1             1     1    

Automatic network summarization is in effect

//RIP 路由协议默认开启自动汇总功能

Maximum path: 4

//RIP 路由协议可以支持 4 条等价路径(负载均衡路径)

Routing for Networks:

    4.0.0.0

    34.0.0.0

//以上7行表明 RIP 通告的网络

Passive Interface(s):

Routing Information Sources:

    Gateway         Distance      Last Update

    34.1.1.3             120      00:00:06

Distance: (default is 120)

//管理距离


Step5

使用debug ip rip查看 RIP 路由协议的动态更新过程。

R1#debug ip rip

RIP protocol debugging is on

R1#RIP: received v1 update from 12.1.1.2 on FastEthernet0/0

      2.0.0.0 in 1 hops

      3.0.0.0 in 2 hops

      4.0.0.0 in 3 hops

      23.0.0.0 in 1 hops

      34.0.0.0 in 2 hops

RIP: sending  v1 update to255.255.255.255 via Loopback1 (1.1.1.1)

RIP: build update entries

      network 2.0.0.0metric 2

      network 3.0.0.0metric 3

      network 4.0.0.0metric 4

      network 12.0.0.0metric 1

      network 23.0.0.0metric 2

      network 34.0.0.0metric 3

RIP: sending  v1 update to255.255.255.255 via FastEthernet0/0 (12.1.1.1)

RIP: build update entries

      network 1.0.0.0metric 1


Step6

每个路由器关闭自动汇总,查看路由表有什么变化

R4(config)#router rip

R4(config-router)#no auto-summary    //关闭自动汇总


Step7

在R1上修改RIP 的四个计时器:

R1(config)#router rip

R1(config-router)#version 2

R1(config-router)#timers basic 20 120 120 160

四个值分别代表 update, Invalid, hold down, flushed

查看路由表有什么变化

0 0