zoukankan      html  css  js  c++  java
  • rip中的连续子网以及不连续子网

    RIPv1 RIPv2
    距离矢量2 距离矢量
    最大跳计数15 最大跳计数15
    有类的 无类的
    基于广播的    基于组播224.0.09
    不支持VLSM 支持VLSM
    无认证 允许MD5认证
    不支持不连续子网 支持不连续子网

    下面我们来认识一下什么叫做有类以及无类,有类就是A类,B类,C类,D类网络,没有划分子网。无类就是划分了子网。

    我们通过一个例子来说明,比如A类的地址1.1.1.1 子网掩码 255.255.255.0 这是子网,则它的有类网络是1.0.0.0 ,掩码255.0.0.0.无类网络就是1.1.1.0,掩码255.255.255.0.

    不连续的子网?

    什么叫做不连续的子网呢,不连续的子网就是,中间有其它网络来分开。比如下面该图所显示一样

    在rip v1 关闭自动汇总,还是不能学习到172.16.10.1 和172.16.20.1的网络。

    R7

    !
    interface Loopback0
     ip address 172.16.10.1 255.255.255.0
    !
    interface GigabitEthernet0/0
     ip address 192.168.1.1 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/1
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface GigabitEthernet0/2
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    router rip
     network 172.16.0.0
     network 192.168.1.0
     no auto-summary
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    line vty 0 4
     login
    !
    !
    !
    

     R6

    ip cef
    no ipv6 cef
    !
    !
    !
    !
    license udi pid CISCO2911/K9 sn FTX1524JN31
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    spanning-tree mode pvst
    !
    !
    !
    !
    !
    !
    interface Loopback0
     ip address 1.1.1.1 255.255.255.0
    !
    interface GigabitEthernet0/0
     ip address 192.168.1.2 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/1
     ip address 192.168.2.1 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/2
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    router rip
     network 1.0.0.0
     network 192.168.1.0
     network 192.168.2.0
     no auto-summary
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    line vty 0 4
     login
    !
    !
    !
    end

    R8

    hostname Router
    !
    !
    !
    !
    !
    !
    !
    !
    ip cef
    no ipv6 cef
    !
    !
    !
    !
    license udi pid CISCO2911/K9 sn FTX1524CD62
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    spanning-tree mode pvst
    !
    !
    !
    !
    !
    !
    interface Loopback0
     ip address 172.16.30.1 255.255.255.0
    !
    interface GigabitEthernet0/0
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface GigabitEthernet0/1
     ip address 192.168.2.2 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/2
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    router rip
     network 172.16.0.0
     network 192.168.2.0
     no auto-summary
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    line vty 0 4
     login
    !
    View Code

    使用RIPv2 之后就可以支持不连续子网,这时候就能够学习到两边172.16.0.0 的子网了。

    变为RIP v2的配置

    R7

    interface Loopback0
     ip address 172.16.10.1 255.255.255.0
    !
    interface GigabitEthernet0/0
     ip address 192.168.1.1 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/1
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface GigabitEthernet0/2
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    router rip
     version 2
     network 172.16.0.0
     network 192.168.1.0
     no auto-summary
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    line vty 0 4
     login
    !
    !
    !
    end
    View Code

    R6

    interface Loopback0
     ip address 1.1.1.1 255.255.255.0
    !
    interface GigabitEthernet0/0
     ip address 192.168.1.2 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/1
     ip address 192.168.2.1 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/2
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    router rip
     version 2
     network 1.0.0.0
     network 192.168.1.0
     network 192.168.2.0
     no auto-summary
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    line con 0
    !
    line aux 0
    !
    View Code

    R8

    interface Loopback0
     ip address 172.16.30.1 255.255.255.0
    !
    interface GigabitEthernet0/0
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface GigabitEthernet0/1
     ip address 192.168.2.2 255.255.255.0
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/2
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    router rip
     version 2
     network 172.16.0.0
     network 192.168.2.0
     no auto-summary
    !
    ip classless
    !
    ip flow-export version 9
    !
    !
    !
    !
    !
    !
    !
    line con 
    View Code

    这时候你再查看路由表就可以看到所有路由都能学习到了。

  • 相关阅读:
    利用Jquery实现http长连接(LongPoll)
    使用C#把发表的时间改为几年前,几个月,几天前,几小时前,几分钟前,或几秒前
    跨域调用接口——WebClient通过get和post请求api
    Url重写——伪静态实现
    控制反转(IOC)
    文件上传之——用SWF插件实现文件异步上传和头像截取
    利用枚举展示下拉列表
    时间格式转换—将后台返回的/Date(1448954018000)/格式转换为正常的时间格式
    @RenderSection,@RenderPage,@RenderBody介绍
    简单工厂模式(转)
  • 原文地址:https://www.cnblogs.com/Hackerman/p/6596254.html
Copyright © 2011-2022 走看看