殛空

导航

 

配置使用RIPv2

实验目的

学会配置RIP版本2路由协议

 

预配置

第一步 配置所有接口

R1路由器

R1(config)#interface s1/2

R1(config-if)#no shutdown

R1(config-if)#ip address 192.168.0.1

R1(config-if)#ip address 192.168.0.1 255.255.255.0

R1(config-if)#interface loopback 0

R1(config-if)#ip address 1.1.1.1 255.255.255.0

R1(config-if)#interface loopback 1

R1(config-if)#ip address 172.16.1.1 255.255.255.0

R1(config-if)#end

R2路由器

R2(config)#interface s2/1

R2(config-if)#no shutdown

R2(config-if)#ip a

00:21:55: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up

R2(config-if)#ip adde

00:21:56: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up

R2(config-if)#ip address 192.168.0.2 255.255.255.0

R2(config-if)#interface loopback 1

R2(config-if)#ip address 172.16.2.2 255.255.255.0

R2(config-if)#interface loopback 0

R2(config-if)#ip address 2.2.2.2 255.255.255.0

R2(config-if)#end

 

实验过程

第一步 R1R2上配置RIPv2

R1(config)#router rip

R1(config-router)#version 2

R1(config-router)#network 1.1.1.1

R1(config-router)#network 192.168.0.1

R1(config-router)#network 172.16.1.1

R1(config-router)#exit

R1(config)#

 

R2(config)#router rip

R2(config-router)#version 2

R2(config-router)#network 192.168.0.2

R2(config-router)#network 172.16.2.2

R2(config-router)#network 2.2.2.2

R2(config-router)#end

R2#

第二步 查看RIP协议运行情况

R1#show ip protocols

Routing Protocol is "rip"

  Sending updates every 30 seconds, next due in 18 seconds

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

  Outgoing update filter list for all interfaces is

  Incoming update filter list for all interfaces is

  Redistributing: rip

  Default version control: send version 2, receive version 2

    Interface        Send  Recv   Key-chain

    Serial1/2        2     2                     

    Loopback0        2     2                     

    Loopback1        2     2                     

  Routing for Networks:

    1.0.0.0

    172.16.0.0

    192.168.0.0

  Routing Information Sources:

    Gateway         Distance      Last Update

  Distance: (default is 120)

 

开启debug

00:41:25: RIP: sending v2 update to 224.0.0.9 via Serial1/2 (192.168.0.1)

00:41:25:      1.0.0.0/8 -> 0.0.0.0, metric 1, tag 0

00:41:25:      172.16.0.0/16 -> 0.0.0.0, metric 1, tag 0

00:41:25: RIP: sending v2 update to 224.0.0.9 via Loopback0 (1.1.1.1)

00:41:25:      2.0.0.0/8 -> 0.0.0.0, metric 2, tag 0

00:41:25:      172.16.0.0/16 -> 0.0.0.0, metric 1, tag 0

00:41:25:      192.168.0.0/24 -> 0.0.0.0, metric 1, tag 0

00:41:25: RIP: sending v2 update to 224.0.0.9 via Loopback1 (172.16.1.1)

00:41:25:      172.16.0.0/16 -> 0.0.0.0, metric 2, tag 0

00:41:25:      1.0.0.0/8 -> 0.0.0.0, metric 1, tag 0

00:41:25:      2.0.0.0/8 -> 0.0.0.0, metric 2, tag 0

00:41:25:      192.168.0.0/24 -> 0.0.0.0, metric 1, tag 0

00:41:25: RIP: ignored v2 packet from 1.1.1.1 (sourced from one of our addresses)

00:41:25: RIP: ignored v2 packet from 172.16.1.1 (sourced from one of our addresses)

R1#

00:41:32: RIP: received v2 update from 192.168.0.2 on Serial1/2

00:41:32:      2.0.0.0/8 -> 0.0.0.0 in 1 hops

00:41:32:      172.16.0.0/16 -> 0.0.0.0 in 1 hops

 

可以看到RIPv2 使用组播地址224.0.0.9来发送更新!

 

注:另一种配置RIPv2的方法

在接口下:ip rip send version 2

                 ip rip receive version 2

 

第三步 查看路由表

R1#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 NSSA external type 1, N2 - OSPF NSSA external type 2

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

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default

       U - per-user static route, o - ODR

       T - traffic engineered route

 

Gateway of last resort is not set

 

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

R    2.0.0.0/8 [120/1] via 192.168.0.2, 00:00:23, Serial1/2

     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks

R       172.16.0.0/16 [120/1] via 192.168.0.2, 00:00:23, Serial1/2

C       172.16.1.0/24 is directly connected, Loopback1

C    192.168.0.0/24 is directly connected, Serial1/2

 

posted on 2011-10-24 10:31  殛空  阅读(673)  评论(0)    收藏  举报