学过NA的都知道RIPv2版本并不是一个完全无类的协议,因为他不支持CIDR,并不能汇总主类地址,但是ripv2却可以传递CIDR汇总信息,下面我们就来验证一下:
首先搭建一个简单的拓扑图
首先在R1和R2路由之间运行RIP协议
R1配置
interface FastEthernet0/0
ip address 1.1.1.1 255.255.255.0
duplex auto
speed auto
router rip
version 2
network 1.0.0.0
no auto-summary
R2配置
interface Loopback0
ip address 172.16.1.1 255.255.255.0
!
interface Loopback1
ip address 172.16.2.1 255.255.255.0
!
interface Loopback2
ip address 172.16.3.1 255.255.255.0
!
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.0
duplex auto
speed auto
!
router rip
version 2
redistribute static
network 1.0.0.0
no auto-summary
!
no ip http server
no ip http secure-server
ip route 172.16.0.0 255.255.252.0 Null0
以上就是实验的配置,这里说下在R2上配置的一条静态汇总后的路由ip route 172.16.0.0 255.255.252.0 Null0然后再在RIP协议下使用redistribute static来重发布这条静态路由
好了 我们来看下R1学习到的路由表
R1#sh ip rou
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, FastEthernet0/0
172.16.0.0/22 is subnetted, 1 subnets
R 172.16.0.0 [120/1] via 1.1.1.2, 00:00:04, FastEthernet0/0(这就表明RIP将静态的汇总路由传递过来)