RIP 不连续子网问题以及v2 解决

标签:
ccnaciscorip |
分类: 思科路由器和交换机 |
连续子网例:
PC1 - RouterA :172.16.1.0/24
RouterA - RouterB:172.16.2/24
RouterB - PC2: 172.16.3.0/24
不连续子网例:
PC1 - RouterA :172.16.1.0/24
RouterA - RouterB:192.168.1.0/24
RouterB - PC2: 172.16.3.0/24
我们针对不连续子网进行构建:
RouterA>
RouterA>en
RouterA#show ip int brief
Interface
IP-Address
OK? Method Status
Protocol
Ethernet0/0
172.16.1.1
YES NVRAM up
up
Ethernet0/1
unassigned
YES NVRAM administratively down down
Ethernet0/2
unassigned
YES NVRAM administratively down down
Ethernet0/3
unassigned
YES NVRAM administratively down down
Serial1/0
192.168.1.1
YES NVRAM up
up
Serial1/1
unassigned
YES NVRAM administratively
down down
Serial1/2
unassigned
YES NVRAM administratively
down down
Serial1/3
unassigned
YES NVRAM administratively
down down
RouterA#conf t
Enter configuration commands, one per
line. End with CNTL/Z.
RouterA(config)#router rip
RouterA(config-router)#network
172.16.0.0
RouterA(config-router)#network
192.168.1.0
RouterA(config-router)#end
RouterA#
*Mar 9 07:23:13.553:
%SYS-5-CONFIG_I: Configured from console by console
RouterA#show ip route
Codes: L - local, C - connected, S - static, R -
RIP, M - mobile, B - BGP
Gateway of last resort is not set
C
172.16.1.0/24 is directly
connected, Ethernet0/0
L
172.16.1.1/32 is directly
connected, Ethernet0/0
C
192.168.1.0/24 is directly
connected, Serial1/0
L
192.168.1.1/32 is directly
connected, Serial1/0
RouterB>
RouterB>en
RouterB#show ip int brief
Interface
IP-Address
OK? Method Status
Protocol
Ethernet0/0
172.16.3.1
YES NVRAM up
up
Ethernet0/1
unassigned
YES NVRAM administratively down down
Ethernet0/2
unassigned
YES NVRAM administratively down down
Ethernet0/3
unassigned
YES NVRAM administratively down down
Serial1/0
192.168.1.2
YES NVRAM up
up
Serial1/1
unassigned
YES NVRAM administratively
down down
Serial1/2
unassigned
YES NVRAM administratively
down down
Serial1/3
unassigned
YES NVRAM administratively
down down
RouterB#conf t
Enter configuration commands, one per
line. End with CNTL/Z.
RouterB(config)#router rip
RouterB(config-router)#network
172.16.0.0
RouterB(config-router)#network
192.168.1.1
RouterB(config-router)#end
RouterB#
*Mar 9 07:23:55.464:
%SYS-5-CONFIG_I: Configured from console by console
RouterB#show ip route
Codes: L - local, C - connected, S - static, R -
RIP, M - mobile, B - BGP
Gateway of last resort is not set
C
172.16.3.0/24 is directly
connected, Ethernet0/0
L
172.16.3.1/32 is directly
connected, Ethernet0/0
C
192.168.1.0/24 is directly
connected, Serial1/0
L
192.168.1.2/32 is directly
connected, Serial1/0
RouterB#
我们发现RouterA里没有172.16.3.0/24的路由信息
RouterB里也没有172.16.1.0/24的路由信息。
也就是说RIPv1 不支持不连续子网的路由
我们看看v2如何
RouterA(config)#router rip
RouterA(config-router)#version 2
RouterA(config-router)#exit
RouterA(config)#ip classless
RouterA(config)#end
RouterA#show ip route
Codes: L - local, C - connected, S - static, R -
RIP, M - mobile, B - BGP
Gateway of last resort is not set
R
172.16.0.0/16 [120/1] via
192.168.1.2, 00:00:19, Serial1/0
C
172.16.1.0/24 is directly
connected, Ethernet0/0
L
172.16.1.1/32 is directly
connected, Ethernet0/0
C
192.168.1.0/24 is directly
connected, Serial1/0
L
192.168.1.1/32 is directly
connected, Serial1/0
RouterB(config)#router rip
RouterB(config-router)#version 2
RouterB(config-router)#exit
RouterB(config)#ip classless
RouterB(config)#end
*Mar 9 07:28:45.504:
%SYS-5-CONFIG_I: Configured from console by console
RouterB#show ip route
Codes: L - local, C - connected, S - static, R -
RIP, M - mobile, B - BGP
Gateway of last resort is not set
R
172.16.0.0/16 [120/1] via
192.168.1.1, 00:00:03, Serial1/0
C
172.16.3.0/24 is directly
connected, Ethernet0/0
L
172.16.3.1/32 is directly
connected, Ethernet0/0
C
192.168.1.0/24 is directly
connected, Serial1/0
L
192.168.1.2/32 is directly
connected, Serial1/0
PC1#ping 172.16.3.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.2,
timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip
min/avg/max = 10/10/10 ms
PC1#
RIPv1 特性:
1.Update 信息不包含子网掩码。
2.Update信息通过Broadcast给255.255.255.0
来更新
3.没有认证
4.不支持CIDR和VLSM.
RIPv2 特性:
1.Update 信息包含子网掩码
2.Update信息通过Broadcast给224.0.0.9来更新
3.支持认证
5.支持CIFR和VLSM
RIPv1和RIPv2 共同特性:
1.metric的hopcount数不能超过16
2.距离矢量(Distance
Vector)型路由协议