rip中的连续子网以及不连续子网

RIPv1RIPv2
距离矢量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

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

 

转载于:https://www.cnblogs.com/Hackerman/p/6596254.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值