发新话题
打印

[网络转载] RIP的v1和v2的一些总结

RIP的v1和v2的一些总结

RIP版本2会在边界处把子网自动汇总成主类路由,可以用no auto-summary命令可以关闭

topo:

148.1.1.0/24---r1---------------------------r3----loopback 0(3.3.3.3/24)
                       /  \                                 /
                   s1  s0                              s0
     148.1.1.2/24  192.1.1.1/24         192.1.1.2/24

ps:*代表路由器



r3(RIPv1)和r1(RIPv2)通讯,不管r1(RIPv2)是否自动汇总,r1(RIPv2)发送RIPv2的更新, 忽略或不理睬r3(RIPv1)的更新信息;r3(RIPv1)发送RIPv1的更新,忽略或不理睬r2(RIPv2)的更新信 息
导致分别采用v1和v2的路由器r3和r1在不同网络下ping不通,不可路由
v1  Default version control: send version 2, receive version 2
    Interface        &am p;am p;am p;nb sp;    Send  Recv  Triggered RIP  Key-chain
    Serial0          ; ; ; ;      2     2                                       
    Serial1          ; ; ; ;      2     2                                       
v2  Default version control: send version 1, receive version 1
    Interface        &am p;am p;am p;nb sp;    Send  Recv  Triggered RIP  Key-chain
    Serial0          ; ; ; ;      1     1                     


---------------------------------------------
r1采用RIPv2

interface Serial0
ip address 192.1.1.1 255.255.255.0
clockrate 64000
!
interface Serial1
ip address 148.1.1.2 255.255.255.0
clockrate 64000
!
router rip
version 2
network 148.1.0.0
network 192.1.1.0
neighbor 192.1.1.2
neighbor 148.1.1.1
----
r1#ping 3.3.3.3
02:17:53: IP: s=192.1.1.1 (local), d=3.3.3.3, len 100, unroutable
02:17:55: IP: s=192.1.1.1 (local), d=3.3.3.3, len 100, unroutable
02:17:57: IP: s=192.1.1.1 (local), d=3.3.3.3, len 100, unroutable
----
r1#show ip rou
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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
C    192.1.1.0/24 is directly connected, Serial0
     148.1.0.0/24 is subnetted, 1 subnets
C       148.1.1.0 is directly connected, Serial1
----
r1#show ip pro
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 13 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
  Neighbor(s):
    192.1.1.2
    148.1.1.1
  Default version control: send version 2, receive version 2
    Interface        &am p;am p;am p;nb sp;    Send  Recv  Triggered RIP  Key-chain
    Serial0          ; ; ; ;      2     2                                       
    Serial1          ; ; ; ;      2     2                                       
  Automatic network summarization is in effect
  Routing for Networks:
    148.1.0.0
    192.1.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    148.1.1.1        &am p;am p;am p;nb sp;   120      00:43:15
    192.1.1.2        &am p;am p;am p;nb sp;   120      00:46:47
  Distance: (default is 120)
------------------------------------------------------------ ----------
r3采用RIPv1
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial0
ip address 192.1.1.2 255.255.255.0
!
router rip
version 1
network 3.0.0.0
network 192.1.1.0
neighbor 192.1.1.1
!
----
r3#ping 148.1.1.2
02:17:56: IP: s=3.3.3.3 (local), d=148.1.1.2, len 100, unroutable
02:17:58: IP: s=3.3.3.3 (local), d=148.1.1.2, len 100, unroutable
02:18:00: IP: s=3.3.3.3 (local), d=148.1.1.2, len 100, unroutable
02:18:02: IP: s=3.3.3.3 (local), d=148.1.1.2, len 100, unroutable
02:18:04: IP: s=3.3.3.3 (local), d=148.1.1.2, len 100, unroutable
----
r3#sh ip ro      
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, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
C    192.1.1.0/24 is directly connected, Serial0
----
r3#sh ip pro        
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 26 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
  Neighbor(s):
    192.1.1.1
  Default version control: send version 1, receive version 1
    Interface        &am p;am p;am p;nb sp;    Send  Recv  Triggered RIP  Key-chain
    Loopback0        &am p;am p;am p;nb sp;    1     1                                       
    Serial0          ; ; ; ;      1     1                                       
  Automatic network summarization is in effect
  Routing for Networks:
    3.0.0.0
    192.1.1.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.1.1.1        &am p;am p;am p;nb sp;   120      00:14:04
  Distance: (default is 120)
----------------------

若r1和r3都是RIPv2
则可路由
若r3 有环回口,则r3上发rip更新到环回口,但是接收的时候忽略环回口更新,因为源与目的地址相同
发送
04:01:43: RIP: sending v2 update to 224.0.0.9 via Loopback0 (3.3.3.3)
04:01:43: RIP: build update entries
04:01:43:       148.1.0.0/16 via 0.0.0.0, metric 2, tag 0
04:01:43:       192.1.1.0/24 via 0.0.0.0, metric 1, tag 0
应答
04:01:43: RIP: ignored v2 packet from 3.3.3.3 (sourced from one of our addresses)
-----------------------
v1更新是广播地址255.255.255.255
v2更新是组播地址224.0.0.9
单播需要配置neighbor [Neighbor address]
-----------------------
v2下默认自动汇总,则148.1.1.0汇总为B类地址148.1.0.0/16
03:51:46: RIP: sending v2 update to 224.0.0.9 via Serial0 (192.1.1.1)
03:51:46: RIP: build update entries
03:51:46:       148.1.0.0/16 via 0.0.0.0, metric 1, tag 0
03:51:46: RIP: sending v2 update to 192.1.1.2 via Serial0 (192.1.1.1)
03:51:46: RIP: build update entries
03:51:46:       148.1.0.0/16 via 0.0.0.0, metric 1, tag 0
若是关闭自动汇总,则148.1.1.0不进行汇总,仍为子网地址148.1.1.0/24
03:54:09: RIP: sending v2 update to 224.0.0.9 via Serial0 (192.1.1.1)
03:54:09: RIP: build update entries
03:54:09:       148.1.1.0/24 via 0.0.0.0, metric 1, tag 0
03:54:09: RIP: sending v2 update to 192.1.1.2 via Serial0 (192.1.1.1)
03:54:09: RIP: build update entries
03:54:09:       148.1.1.0/24 via 0.0.0.0, metric 1, tag 0
-----------------------
有乱码,“  ; &nbs p;”  直接看作空格就可以!

TOP

看帖是缘分!
回帖是友情!

TOP

看过了。。。。。。:)

TOP

发新话题