ensp模拟器下static-rip和static-ospf

RIP:Routing Information Protocol  (路由信息协议)

优先选择跳数小的路由做为最优路由,16跳路由表示不可达,也称为毒化路由,设备从之前收到对应路由接口再次收到此路由,并且为16跳,便将本端对应路由表中取消掉。

工作原理:依靠定时器进行收检

实验一:static+rip

R1配置

sys
sysname R1

interface GigabitEthernet0/0/0
ip address 200.1.1.1 255.255.255.0 

interface GigabitEthernet0/0/1
ip address 192.168.1.254 255.255.255.0 

interface GigabitEthernet0/0/2
ip address 15.1.1.1 255.255.255.0 

rip 1
version 2
network 192.168.1.0
network 15.0.0.0
network 200.1.1.0

ip route-static 192.168.2.0 255.255.255.0 200.1.1.2 

#可以把静态路由优先级调高一些,目的是切换到RIP协议下工作:
ip route-static 192.168.2.0 255.255.255.0 200.1.1.2 preference 200
#当然上面一条你可以不做,但是还是要配置默认路由

 R2配置

sys
sysname R2

interface GigabitEthernet0/0/0
ip address 200.1.1.2 255.255.255.0 

interface GigabitEthernet0/0/1
ip address 201.1.1.1 255.255.255.0 

ip route-static 192.168.1.0 255.255.255.0 200.1.1.1
ip route-static 192.168.2.0 255.255.255.0 201.1.1.2

R3配置

sys
sysname R3

interface GigabitEthernet0/0/0
ip address 201.1.1.2 255.255.255.0 

interface GigabitEthernet0/0/1
ip address 192.168.2.254 255.255.255.0 

interface GigabitEthernet0/0/2
ip address 35.1.1.2 255.255.255.0 

rip 1
version 2
network 192.168.2.0
network 201.1.1.0
network 35.0.0.0

ip route-static 192.168.1.0 255.255.255.0 201.1.1.1

R5配置

sys
sysname R5

interface GigabitEthernet0/0/0
ip address 15.1.1.2 255.255.255.0 

interface GigabitEthernet0/0/1
ip address 35.1.1.1 255.255.255.0 

rip 1
version 2
network 15.0.0.0
network 35.0.0.0

 实验二:static+ospf

基于第一个实验,使用undo rip 1清除之前的配置。只需要配置ospf的配置。

R1配置

ospf 1 router-id 1.1.1.1 
 area 0.0.0.0 
  network 15.1.1.0 0.0.0.255 
  network 192.168.1.0 0.0.0.255 

R3配置

ospf 1 router-id 3.3.3.3 
area 0.0.0.0 
network 35.1.1.0 0.0.0.255 
network 192.168.2.0 0.0.0.255 

R5配置

ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 15.1.1.0 0.0.0.255
network 35.1.1.0 0.0.0.255

测试

dis ospf peer drief 

dis ospf lsdb

dis ospf lsdb router 1.1.1.1

dis ospf routing

#查询路由表
dis ip routing-table

dis ip routing-table protocol ospf

dis ip routing-table | include 192.168.2.0
#以上都是查看

#pc1上做
tracert 192.168.2.1
#结果是下面这四个
#1  192.168.1.254   31 ms  47 ms  47 ms
#2    *200.1.1.2   47 ms  47 ms
#3    *201.1.1.2   62 ms  78 ms
#4    *192.168.2.1   63 ms  94 ms

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值