HCIP第八条作业----路由策略

实验涉及路由器R1、R2和R4的配置,包括基本接口IP地址设置,RIP和OSPF动态路由协议的启用,以及路由重发布。R2和R4使用路由策略调整OSPF的路由成本。实验结果显示,R1和R3的路由表成功包含了RIP和OSPF路由信息。
摘要由CSDN通过智能技术生成

实验要求

 

实验步骤

1.基本配置

R1

interface Serial4/0/0
 link-protocol ppp
 ip address 12.1.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 14.1.1.1 255.255.255.0 
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.0 

动态路由配置

R1

rip 1
 version 2
 network 12.0.0.0
 network 14.0.0.0
 network 1.0.0.0

R2

ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 3.3.3.0 0.0.0.255 
  network 23.1.1.0 0.0.0.255 
  network 34.1.1.0 0.0.0.255 

重发布

R2

ospf 1 router-id 2.2.2.2 
 import-route rip 1 route-policy aa
 area 0.0.0.0 
  network 23.1.1.0 0.0.0.255 
#
ospf 12 
#
rip 1
 version 2
 network 2.0.0.0
 network 12.0.0.0
 import-route ospf 1

R4

ospf 1 router-id 4.4.4.4 
 import-route rip 1 route-policy aa
 area 0.0.0.0 
  network 4.4.4.0 0.0.0.255 
  network 34.1.1.0 0.0.0.255 
#
rip 1
 version 2
 network 14.0.0.0
 import-route ospf 1

路由策略

RIP

偏移列表

R1

#
ip ip-prefix a index 5 permit 23.1.1.0 24
ip ip-prefix a index 10 permit 4.4.4.0 24
ip ip-prefix aa index 10 permit 34.1.1.0 24
#
interface GigabitEthernet0/0/1
 ip address 14.1.1.1 255.255.255.0 
 rip metricin ip-prefix a 10

OSPF

router-policy---路由策略
R2
#
route-policy aa permit node 10 
 if-match ip-prefix a 
 apply cost-type type-1 
#
route-policy aa permit node 20 
 if-match ip-prefix b 
 apply cost-type type-1 
#
route-policy aa permit node 30 
#
ip ip-prefix b index 10 permit 12.1.1.0 24
ip ip-prefix a index 10 permit 2.2.2.0 24
#
ospf 1 router-id 2.2.2.2 
 import-route rip 1 route-policy aa

R4

#
route-policy aa permit node 10 
 if-match ip-prefix a 
 apply cost-type type-1 
#
route-policy aa permit node 20 
#
ip ip-prefix a index 10 permit 14.1.1.0 24
#
ospf 1 router-id 4.4.4.4 
 import-route rip 1 route-policy aa

实验效果

R1

Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 19       Routes : 20       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
      1.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.0/24  RIP     100  1           D   12.1.1.2        Serial4/0/0
        3.3.3.3/32  RIP     100  1           D   12.1.1.2        Serial4/0/0
                    RIP     100  1           D   14.1.1.4        GigabitEthernet
0/0/1
        4.4.4.0/24  RIP     100  1           D   12.1.1.2        Serial4/0/0
       12.1.1.0/24  Direct  0    0           D   12.1.1.1        Serial4/0/0
       12.1.1.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
       12.1.1.2/32  Direct  0    0           D   12.1.1.2        Serial4/0/0
     12.1.1.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
       14.1.1.0/24  Direct  0    0           D   14.1.1.1        GigabitEthernet
0/0/1
       14.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
     14.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
       23.1.1.0/24  RIP     100  1           D   12.1.1.2        Serial4/0/0
       34.1.1.0/24  RIP     100  1           D   14.1.1.4        GigabitEthernet
0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

R3

 

Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 20       Routes : 21       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  O_ASE   150  1           D   23.1.1.2        Serial4/0/0
                    O_ASE   150  1           D   34.1.1.4        Serial4/0/1
        2.2.2.0/24  O_ASE   150  49          D   23.1.1.2        Serial4/0/0
        3.3.3.0/24  Direct  0    0           D   3.3.3.3         LoopBack0
        3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
      3.3.3.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
        4.4.4.0/24  OSPF    10   48          D   34.1.1.4        Serial4/0/1
       12.1.1.0/24  O_ASE   150  49          D   23.1.1.2        Serial4/0/0
       14.1.1.0/24  O_ASE   150  49          D   34.1.1.4        Serial4/0/1
       23.1.1.0/24  Direct  0    0           D   23.1.1.3        Serial4/0/0
       23.1.1.2/32  Direct  0    0           D   23.1.1.2        Serial4/0/0
       23.1.1.3/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
     23.1.1.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
       34.1.1.0/24  Direct  0    0           D   34.1.1.3        Serial4/0/1
       34.1.1.3/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
       34.1.1.4/32  Direct  0    0           D   34.1.1.4        Serial4/0/1
     34.1.1.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值