广告合作
  • 今日头条

    今日头条

  • 百度一下

    百度一下,你就知道

  • 新浪网

    新浪网 - 提供新闻线索,重大新闻爆料

  • 搜狐

    搜狐

  • 豆瓣

    豆瓣

  • 百度贴吧

    百度贴吧——全球领先的中文社区

  • 首页 尚未审核订阅工具 订阅

    cisco 路由策略:Route-map

    来源:网络收集  点击:  时间:2024-08-24
    【导读】:
    路由策略主要用于管理重发布的时候的路由,如果重发布有多条路径到达同一目的地的时候方可使用路由策略来管理路由的metic值,以meitc值来选路。Route-map1/1分步阅读

    逐级向下比对匹配每一个match语句,如果匹配,则执行SET动作,否则进入下一个条目。

    Route-map的特点1/1

    使用match命令匹配特定的分组或路由,set修改该分组或路由相关属性。

    Route-map中的语句相当于访问列表中的各行。

    Route-map默认为permit,默认序列号为10,序号不会自动递增,需要指定序列号

    末尾隐含deny any

    单条match语句包括多个条件时,使用逻辑or运算;多条match语句时,使用逻辑and运算。

    Route-map的配置1/1

    Match ip address

    匹配访问列表或前缀列表

    Match ip length

    根据分组的第三层长度进行匹配

    Match interface

    匹配器下一跳为指定接口之一的路由

    Match ip next-hop

    匹配器下一跳路由器地址获得防伪列表之一允许的路由

    Match metric

    匹配具有指定度量值的路由

    Match route-type

    匹配指定类型的路由

    Match community

    匹配BGP共同体

    Match tag

    根据路由的标记进行匹配

    Route-map(cont)

    Set metric

    设置路由协议的度量值

    Set metric-type

    设置目标路由协议的值类型

    Set default interface

    指定如何发送这样的分组

    Set interface

    指定如何发送这样的分组

    Set ip default next-hop

    指定转发的下一跳

    Set ip next-hop

    指定转发的下一跳

    Set next-hop

    指定下一跳的地址,指定BGP的下一跳

    MAP实验 1/5

    R2上有两个loopback口,当R4ping 192.168.1.1的时候往R1走,当R4ping 192.168.2.1的时候往R3走;两条链路相互冗余。

    2/5

    R1:

    interface Serial0/0

    ip address 1.1.1.1 255.255.255.0

    !

    interface Serial0/1

    ip address 4.4.4.2 255.255.255.0

    !

    router ospf 1

    log-adjacency-changes

    redistribute static subnets route-map cisco !--重发布静态地址,使用route-map

    network 4.4.4.0 0.0.0.255 area 0

    !

    ip classless

    ip route 192.168.1.0 255.255.255.0 1.1.1.2

    ip route 192.168.2.0 255.255.255.0 1.1.1.2

    !

    access-list 1 permit 192.168.1.0

    access-list 2 permit 192.168.2.0

    no cdp log mismatch duplex

    !

    route-map cisco permit 10 !--配置route-map name=cisco 优先级为10 ,越小越高

    match ip address 1 !--匹配access-list

    set metric 1 !--设置metric 值

    !

    route-map cisco permit 20 !--此条的意思是设置第二条 ,优先级为20

    match ip address 2 !--匹配access-list

    set metric 2 !--设置metric 值

    3/5

    R2:

    interface Loopback0

    ip address 192.168.1.1 255.255.255.0

    !

    interface Loopback1

    ip address 192.168.2.1 255.255.255.0

    !

    interface Serial0/0

    ip address 1.1.1.2 255.255.255.0

    !

    interface Serial0/1

    ip address 2.2.2.1 255.255.255.0

    !

    ip classless

    ip route 3.3.3.0 255.255.255.0 2.2.2.2

    ip route 3.3.3.0 255.255.255.0 1.1.1.1 2

    ip route 4.4.4.0 255.255.255.0 1.1.1.1

    ip route 4.4.4.0 255.255.255.0 2.2.2.2 2

    !

    !

    4/5

    R3:

    !

    interface Serial0/0

    ip address 2.2.2.2 255.255.255.0

    !

    interface Serial0/1

    ip address 3.3.3.1 255.255.255.0

    !

    router ospf 1

    log-adjacency-changes

    redistribute connected subnets

    redistribute static subnets route-map cisco

    network 3.3.3.0 0.0.0.255 area 0

    !

    ip classless

    ip route 192.168.1.0 255.255.255.0 2.2.2.1

    ip route 192.168.2.0 255.255.255.0 2.2.2.1

    !

    access-list 1 permit 192.168.1.0

    access-list 2 permit 192.168.2.0

    no cdp log mismatch duplex

    !

    route-map cisco permit 10

    match ip address 2

    set metric 1

    !

    route-map cisco permit 20

    match ip address 1

    set metric 2

    5/5

    R4:

    !

    interface Serial0/0

    ip address 4.4.4.1 255.255.255.0

    !

    interface Serial0/1

    ip address 3.3.3.2 255.255.255.0

    !

    router ospf 1

    log-adjacency-changes

    network 3.3.3.0 0.0.0.255 area 0

    network 4.4.4.0 0.0.0.255 area 0

    network 192.168.10.0 0.0.0.255 area 0

    !

    注意事项

    感谢你浏览(12黄奇锋)的经验,如果经验对您有帮助请为我“投票”,为经验献爱心让更多人知道请“转发”,怕找不到此经验请进行“收藏”。想了解最新动态请“关注我”。

    路由器CISCOGNS3ROUTE-MAP
    本文关键词:

    版权声明:

    1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

    2、本站仅提供信息发布平台,不承担相关法律责任。

    3、若侵犯您的版权或隐私,请联系本站管理员删除。

    4、文章链接:http://www.1haoku.cn/art_1155207.html

    相关资讯

    ©2019-2020 http://www.1haoku.cn/ 国ICP备20009186号05-06 17:52:15  耗时:0.026
    0.0257s