美文网首页
RIP手动汇总

RIP手动汇总

作者: 皮一下怎么了 | 来源:发表于2018-09-10 13:57 被阅读0次

    实验图

    实验目的

    通过手动汇总使得R4和R6动态获取到R5分配的IP地址

    实验操作

    为R1、R2、R3启用RIPv2,关闭R4、R5、R6的路由功能,R4、R6模拟内网PC,R5模拟DHCP服务器,在R2的e0/2做手动汇总

    手动汇总的原理

    如172.16.2.0/24和172.16.3.0/24
    将不同的位转换成二进制为
    172.16.00000010.0
    172.16.00000011.0

    可以发现前23位都是相同的,汇总就是找到路由条目的前缀最长匹配的那一位,前面的保持不变,后面的全部置为0
    因此172.16.2.0/24和172.16.3.0/24汇总后得到的路由条目为172.16.2.0/23

    这种汇总称为精确汇总,不会产生路由黑洞

    注:要求汇总的路由条目是连续的,汇总后得到的路由条目通过借相同的位得到的子网若与汇总前的子网相同,则称路由条目为连续的

    为路由器做手工汇总的原则:尽可能的靠近控制层面的原路由器,在控制层面路由流向的出接口进行配置,如本实验中R2是通过e0/2接口将路由条目传递给R1,因此手工汇总也应在e0/2接口进行配置

    第一步为所有路由器接口配置地址

    R1(中间路由)

    en
    conf t
    int e0/0
    ip add 12.1.1.1 255.255.255.0
    no sh
    exit
    int e0/1
    ip add 13.1.1.1 255.255.255.0
    no sh
    

    R2(中间路由)

    en
    conf t
    int e0/2
    ip add 12.1.1.2 255.255.255.0
    no sh
    exit
    int e0/1
    ip add 172.16.2.1 255.255.255.0
    no sh
    exit
    int e0/0
    ip add 172.16.3.1 255.255.255.0
    no sh
    

    R3(中间路由)

    en
    conf t
    int e0/0
    ip add 13.1.1.2 255.255.255.0
    no sh
    exit
    int e0/1
    ip add 14.1.1.1 255.255.255.0
    no sh
    

    R4(内网PC)

    en
    conf t
    no ip routing
    int e0/0
    ip add dhcp
    no sh
    

    R5(DHCP服务器)

    en
    conf t
    no ip routing
    int e0/0
    ip add 14.1.1.2 255.255.255.0
    no sh
    exit
    ip default-gateway 14.1.1.1
    

    R6(内网PC)

    en
    conf t
    no ip routing
    int e0/0
    ip add dhcp
    no sh
    

    第二步配置RIP

    R1

    conf t
    router rip
    version 2
    no auto-summary
    network 12.0.0.0
    network 13.0.0.0
    

    R2

    conf t
    router rip
    version 2
    no auto-summary
    network 12.0.0.0
    network 172.16.0.0
    

    R3

    conf t
    router rip
    version 2
    no auto-summary
    network 13.0.0.0
    network 14.0.0.0
    

    配置完后查看路由表
    R1

    R2

    R3


    可以看到都已经通过RIP获取到了路由条目

    R5配置为DHCP服务器

    conf t
    service dhcp
    ip dhcp pool server2
    network 172.16.2.0 255.255.255.0
    default-router 172.16.2.1
    dns-server 172.16.2.1
    domain-name cisco.com
    exit
    service dhcp
    ip dhcp pool server3
    network 172.16.3.0 255.255.255.0
    default-router 172.16.3.1
    dns-server 172.16.3.1
    domain-name cisco.com
    

    R2配置DHCP中继

    conf t
    int e0/0
    ip helper-address 14.1.1.2
    exit
    int e0/1
    ip helper-address 14.1.1.2
    

    此时R4和R6都已经获取到了IP地址

    R4

    R6

    但此时R1和R3对于R2后面的两个网段存在两条路由条目,下面进行汇总使其只有一条

    R2

    conf t
    int e0/2
    ip summary-address rip 172.16.2.0 255.255.254.0          //进行汇总
    

    再看R1和R3的路由表

    可以发现虽然汇总路由已经出现,但是明细路由依旧存在,这是由于RIP的计时器问题,RIP收敛较慢,需要手动进行更新路由表

    R1

    clear ip route *          //更新路由表,重新收敛
    

    R2

    clear ip route *
    

    R3

    clear ip route *
    

    再次查看R1和R3路由表

    此时已经只有汇总后的路由条目,实验完成

    相关文章

      网友评论

          本文标题:RIP手动汇总

          本文链接:https://www.haomeiwen.com/subject/rersgftx.html