HCIP之重发布

目录

重发布

作用

条件

规则

重发布配置

R1基本配置

R2(ASBR)基本配置

R3基本配置

R4基本配置

 R1配置rip协议

R2(ASBR)配置RIP协议以及ospf

R3配置ospf协议

R4配置ospf协议

 RIP协议

        A - >B:将一种动态协议发布到另一种动态的路由协议

        静态 - >B:将静态路由导入到动态路由协议中直连

        直连 - >B:将直连路由导入到动态路由协议中

ospf与rip类似

双点重发布引发的路由回馈

解决方法:路由策略

定义

执行步骤

路由策略的匹配规则

ROYTE-POLICY的配置指南


重发布

作用

        在一个网络中,若运行多种路由协议或者相同路由协议的不同进程;协议之间不能直接沟通计算把偶偶进程之间也是独立转发和运算;所以需要重发布实现陆游的共享

条件

        1.必须存在ASBR设备 --- 同时连接两种协议或者两个进程;可以同时学到两边的路由信息,之后完成路由共享。

        2.必须关注种子度量值 --- A协议和B协议之间的度量计算逻辑不通,无法直接使用。故在将A协议发布到B协议时,ASBR将不懈怠A协议的度量值到B协议,而是在共享到B协议时,有ASBR设备在路由这能怪添加一个起始度量值。

规则

        1.将A协议导入到B协议时,需要在ASBR的B协议上配置重发布

        2.将A协议发布到B协议时,是将ASBR上所有通过A协议学习到的及ASBR上宣告在A协议的所有直连路由全部共享到B协议中

        单点 --- 两个协议或者两个进程之间存在1个ASBR设备

        双点 --- 两个协议或者两个进程之间存在2个ASBR设备

        多点 --- 两个协议或者两个进程之间存在多个ASBR设备

        单向 --- 仅将A协议发布到B协议当中

        双向 --- A/B协议的路由均共享

重发布配置

R1基本配置

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.0.0.1/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         1.1.1.1/24           up         up(s)     
NULL0                             unassigned           up         up(s)  

R2(ASBR)基本配置

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              12.0.0.2/24          up         up        
GigabitEthernet0/0/1              23.0.0.2/24          up         up        
GigabitEthernet0/0/2              24.0.0.2/24          up         up        
LoopBack0                         2.2.2.2/24           up         up(s)     
NULL0                             unassigned           up         up(s)    

R3基本配置

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              23.0.0.1/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         3.3.3.3/24           up         up(s)     
NULL0                             unassigned           up         up(s)  

R4基本配置

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              24.0.0.1/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)   

 R1配置rip协议

1.启动rip协议
[R1]rip 1
[R1-rip-1]ve	
[R1-rip-1]verify-source
2.选择版本号
[R1-rip-1]version 2
3.宣告网段
[R1-rip-1]net	
[R1-rip-1]network 12.0.0.0
[R1-rip-1]q

R2(ASBR)配置RIP协议以及ospf

1.配置rip
[R2]rip 
[R2-rip-1]ve	
[R2-rip-1]version 2
[R2-rip-1]ne	
[R2-rip-1]network 12.0.0.0
[R2-rip-1]ne	
[R2-rip-1]network 2.0.0.0
2.配置ospf1
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
3.配置ospf2
[R2]ospf 2 r	
[R2]ospf 2 router-id 2.2.2.2
[R2-ospf-2]ar	
[R2-ospf-2]area 0
[R2-ospf-2-area-0.0.0.0]ne	
[R2-ospf-2-area-0.0.0.0]network 24.0.0.0 0.0.0.255

R3配置ospf协议

[R3]ospf 1 r	
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]are	
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]ne	
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]ne	
[R3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255

R4配置ospf协议

[R4]ospf 2 router-id 4.4.4.4
[R4-ospf-2]area 0 
[R4-ospf-2-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R4-ospf-2-area-0.0.0.0]ne	
[R4-ospf-2-area-0.0.0.0]network 24.0.0.0 0.0.0.255

 A -> B : 一种动态路由协议发布到另一种动态路由协议

静态 - >B:将静态路由导入到动态路由协议中

直连 - >B:将直连路由导入到动态路由协议中

 RIP协议

        A - >B:将一种动态协议发布到另一种动态的路由协议

                [R2-rip-1]import-route ospf 1

        测试:

1.插入前
[R1]display ip routing-table protocol rip 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 1        Routes : 1        

RIP routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0
2.插入后
[R1]display ip routing-table protocol rip 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 3        Routes : 3        

RIP routing table status : <Active>
         Destinations : 3        Routes : 3

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0
       23.0.0.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

        结论:

                通过重发布技术将其它协议的路由信息导入到RIP中,其赋予的默认种子度量值为0.

        修改种子度量值的方法:

                1.在进程中对全局进行修改 --- [R2-rip-1]default-cost 2

                2.针对本次重发布进行修改 --- [R2-rip-1]import-route ospf 1 cost 3

        测试:

1.在进程中对全局进行修改 --- [R2-rip-1]default-cost 2

[R1]display ip routing-table protocol rip 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 3        Routes : 3        

RIP routing table status : <Active>
         Destinations : 3        Routes : 3

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0
       23.0.0.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0
2.针对本次重发布进行修改 --- [R2-rip-1]import-route ospf 1 cost 3

[R1]display ip routing-table protocol rip 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 3        Routes : 3        

RIP routing table status : <Active>
         Destinations : 3        Routes : 3

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  4           D   12.0.0.2        GigabitEthernet
0/0/0
       23.0.0.0/24  RIP     100  4           D   12.0.0.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R1]

注意:

        当以上两条命令同时执行时,将按照第2条,匹配更精确的命令来执行

        静态 - >B:将静态路由导入到动态路由协议中直连

                [R2-rip-1]import-route static

         测试:

1.向R2中导入静态路由

[R2]ip route-static 0.0.0.0 0 LoopBack 0
[R2]ip route-static 192.168.1.0 24 LoopBack 0
[R2]ip route-static 192.168.68.0 24 LoopBack 0

2.将静态导入动态路由rip中

[R2-rip-1]import-route static 

3.查看R1中rip接受到的路由

[R1]display ip routing-table protocol rip 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 5        Routes : 5        

RIP routing table status : <Active>
         Destinations : 5        Routes : 5

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  4           D   12.0.0.2        GigabitEthernet
0/0/0
       23.0.0.0/24  RIP     100  4           D   12.0.0.2        GigabitEthernet
0/0/0
    192.168.1.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0
   192.168.68.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

 结论:

        重发发布过程中不会讲缺省路由重发布到动态路由协议中

        直连 - >B:将直连路由导入到动态路由协议中

                [R2-rip-1]import-route direct

         测试:

[R1]display ip routing-table protocol rip 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
         Destinations : 6        Routes : 6        

RIP routing table status : <Active>
         Destinations : 6        Routes : 6

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        2.2.2.0/24  RIP     100  1           D   12.0.0.2        GigabitEthernet
0/0/0
        3.3.3.3/32  RIP     100  4           D   12.0.0.2        GigabitEthernet
0/0/0
       23.0.0.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0
       24.0.0.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0
    192.168.1.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0
   192.168.68.0/24  RIP     100  3           D   12.0.0.2        GigabitEthernet
0/0/0

RIP routing table status : <Inactive>
         Destinations : 0        Routes : 0

结论:

        1.除了R1的直连网段之外,所有直连都会导入

        2.若ASBR(R2)进行了A - >B的重发布以及 直连 - > B的重发布,并且两次包含相同的路由信息,则会有限学习 直连 - >B 的涌发布信息

ospf与rip类似

        种子度量值修改

                [R2-ospf-1]default type ?
                  INTEGER<1-2>  Type value

        开销值修改 

                [R2-ospf-1]default cost ?
                  INTEGER<0-16777214>  Cost value

双点重发布引发的路由回馈

        默认RIP和OSPF协议若进行双点重发布,优于两者的优先级不同,故第一台ASBR设备重发布动作结束后,将影响其他ASBR设备的路由表。使得路由可能被回传到源协议当中,发生路由回馈 --- A协议的路由冲发布到B协议中后,又被重新发布回到A协议。路由回馈会导致选路不佳甚至出现路由环路。

        华为设备为了消除路由回馈现象,他讲OSPF内部产生的路由的优先级定义为10,而将域外导入的路由默认优先级定义为150.(150的优先级大于所有华为体系下IGP协议的默认优先级)。通过这种方式消除路由回馈

解决方法:路由策略

        由于冲发布技术的种子度量值问题,将必然导致选路不佳;只能以来路由策略来认为干涉选路

定义

        路由策略 --- 在控制层流量流动过程中,截取流量,之后修改流量再转发或者不转发;最终试下影响路由器路由表生成,干涉选录的效果

        控制层流量 --- 路由协议传递路由信息产生的流量

        数据层流量 --- 设备访问目标网段时,产生的数据流量

 

执行步骤

1.抓取流量

        1.ACL列表 --- 因为ACL列表本身设计就是为了抓取数据层流量的,所以,因为通配符的存在它可以灵活的匹配数字特征,但是,没有办法匹配路由信息中的掩码特征。所以并不擅长控制层流量的抓取

        2.IP - prefix --- 前值列表

[R1]ip ip-prefix aa(自定义前缀列表的名称) permit(允许和拒绝,仅抓取流量则可以选择permit) 192.168.1.0 24 --- 抓取的控制层流量中目标网络的信息

[R1]display ip ip-prefix aa --- 查看前缀列表信息

                前缀列表的匹配规则 --- 自上而下,主义匹配,一旦匹配上则将按照对应的规则来执行动作,不再向下匹配。末尾隐含拒绝所有的规则

                注意:前缀列表中的规则默认为以10位步调自动添加序号,便于插入和删除规则

[R1]ip ip-prefix aa index 15 permit 192.168.3.0 24

    --- 根据序号插入规则

[R1]undo ip ip-prefix aa index 15

    --- 删除插入规则

[R1]ip ip-prefix aa permit 192.168.3.0 24 less-equal 28

    --- 抓取掩码长度24-28之间的路由信息
   
[R1]ip ip-prefix aa permit 192.168.3.0 24 greater-equal 28
 
    --- 当前后矛盾时,将以后面的为主,前面的24变为前24为固定不变,匹配为掩码长度大于等于28的路由信息
    
[R1]ip ip-prefix aa permit 192.168.3.0 24 greater-equal 28 less-equal 30

    --- 前24位固定,匹配掩码长度为28-30的网段信息

[R1]ip ip-prefix aa permit 192.168.3.0 24 greater-equal 28 less-equal 28

    --- 前24位固定,匹配掩码长度为28的网段信息

[R1]ip ip-prefix aa permit 0.0.0.0 0 greater-equal 32

    --- 匹配所有主机路由

[R1]ip ip-prefix aa permit 0.0.0.0 0 
    
    --- 匹配缺省

2.路由策略

        1.RIP的merticin和merticout --- 偏移列表 --- 只针对距离矢量型协议设计应用

                1.抓取流量

[R1]ip ip-prefix aa permit 34.0.0.0 24

                2.在接口上调用

[R1-GigabitEthernet0/0/0]rip metricin ip-prefix aa 10

        2.filter-policy --- 过滤策略

                1.抓取流量

[R1]ip ip-prefix bb deny 34.0.0.0 24
[R1]ip ip-prefix bb permit 0.0.0.0 0 less-equal 32

                2.在进程中调用

[R1-rip-1]filter-policy ip-prefix bb import GigabitEthernet 0/0/0

注意:

        过滤策略本身是可以在ospf中使用的,但是,在ospf区域内使用时,因为区域内部传递的是拓扑信息,所以,无法在出方向调用,只能在入方向调用,影响自己,也不是说将LSA信息过滤掉,只是在路由信息表加表时过滤,不让其加表。在区域之间传递路由信息时可以出方向调用

3.roture - policy --- 路由策略

        1.抓取流量

[R2-acl-basic-2000]rule permit source 1.1.1.0 0

[R2-acl-basic-2001]rule permit source 2.2.2.0 0

[R2]ip ip-prefix aa permit 3.3.3.0 24

[R2]ip ip-prefix aa permit 4.4.4.0 24

        2.配置路由策略

[R2]route-policy aa deny node 10
Info: New Sequence of this List.
[R2-route-policy]if-match acl 2000

[R2]route-policy aa deny node 20
Info: New Sequence of this List.
[R2-route-policy]if-match acl 2001
[R2-route-policy]apply cost 10

[R2]route-policy aa deny node 30
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix aa
[R2-route-policy]apply cost-type type-1

[R2]route-policy aa deny node 40
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix bb
[R2-route-policy]apply cost-type type-1
[R2-route-policy]apply tag 666

注意:

        一条规则当中,如果存在多个apply或if-match,则这些需要同时满足,满足 “与” 关系

        [R2]route-policy aa deny node 50 --- 允许所有

                1.没有if-match --- 匹配所有

                2.没有appl --- 只需要按照大动作来执行

3.再重发不工程中调用路由策略

        [R2-ospf-1]import-route rip route-policy aa

路由策略的匹配规则

        自上而下,主义匹配,一旦匹配上则将按照对应的规则来执行动作,不再向下匹配。末尾隐含拒绝所有的规则

ROYTE-POLICY的配置指南

  1. 即便一个流量需要拒绝,在抓取流量的时候,也必须使用允许,之后在路由策略中进行拒绝
  2. 在一条规则中,若没有流量匹配,则代表匹配所有;做没有APPLY(小动作),则只按照大动作来执行。因此,大动作为允许的空表代表允许所有。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

White乄joker

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值