cisco.ios.ios_route_maps 模块 – 配置路由映射的资源模块。
注意
此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install cisco.ios
。
要在 playbook 中使用它,请指定: cisco.ios.ios_route_maps
。
cisco.ios 2.1.0 中的新增功能
概要
此模块配置和管理 Cisco IOS 上路由映射的属性。
参数
参数 |
注释 |
---|---|
路由映射配置的列表。 |
|
路由映射配置条目的列表。 |
|
路由映射设置操作 选项
|
|
继续路由映射中的不同条目 |
|
路由映射条目序号 请参考厂商文档以了解有效值 |
|
设置继续 选项
|
|
路由映射注释 |
|
匹配路由表中的值 |
|
BGP 添加路径匹配策略 BGP 添加路径通告设置策略 |
|
BGP 添加路径通告所有路径 选项
|
|
BGP 添加路径通告最佳 n 条路径 (1-3) |
|
BGP 添加路径通告最佳路径 (范围 m 到 n) |
|
BGP 添加路径通告最佳路径 (下限) (1-3) |
|
BGP 添加路径通告最佳路径 (上限) (1-3) |
|
BGP 添加路径通告组最佳路径 选项
|
|
匹配 BGP AS 路径列表 |
|
AS 路径访问列表 请参考厂商文档以了解有效值 |
|
设置 AS 路径列表 选项
|
|
CLNS 信息 |
|
匹配路由地址或匹配数据包 |
|
匹配路由的下一跳地址 |
|
匹配路由的通告源地址 |
|
匹配 BGP 社区列表 |
|
对社区进行精确匹配 选项
|
|
社区列表编号/社区列表名称 请参考厂商文档以了解有效值 |
|
匹配 BGP/VPN 扩展社区列表 扩展社区列表编号 请参考厂商文档以了解有效值 |
|
匹配路由的首跳接口 |
|
IP 特定信息 |
|
匹配路由地址或匹配数据包 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参考厂商文档以了解有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
匹配 flowspec 前缀的源/目标前缀组件 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参考厂商文档以了解有效值 |
|
匹配 flowspec 前缀的目标前缀组件 选项
|
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
匹配 flowspec 前缀的源前缀组件 选项
|
|
匹配路由的下一跳地址 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参考厂商文档以了解有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
设置下一跳地址 选项
|
|
路由重分发源 (仅限 EIGRP) |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参考厂商文档以了解有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
设置重分发源 选项
|
|
匹配路由的通告源地址 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参考厂商文档以了解有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
路由重分发源 (仅限 EIGRP) 选项
|
|
设置重分发源 选项
|
|
IPv6 特定信息 |
|
匹配路由地址或匹配数据包 |
|
IPv6 访问列表名称 |
|
IPv6 前缀列表名称 |
|
匹配路由的下一跳地址 |
|
IPv6 访问列表名称 |
|
匹配 flowspec 前缀的目标前缀组件 选项
|
|
IPv6 前缀列表名称 |
|
匹配 flowspec 前缀的源前缀组件 选项
|
|
匹配路由的下一跳地址 |
|
IPv6 访问列表名称 |
|
IPv6 前缀列表名称 |
|
匹配路由的通告源地址 |
|
IPv6 访问列表名称 |
|
IPv6 前缀列表名称 |
|
数据包长度 |
|
最大数据包长度 请参考厂商文档以了解有效值 |
|
最小数据包长度 请参考厂商文档以了解有效值 |
|
路由的本地首选 |
|
设置路由的本地首选 选项
|
|
本地首选值 请参考厂商文档以了解有效值 |
|
匹配与 MDT 组对应的路由 |
|
IP 访问列表编号/IP 标准访问列表名称 请参考厂商文档以了解有效值 |
|
设置和匹配与 MDT 组对应的路由 选项
|
|
匹配路由的度量 |
|
用于在一个范围内匹配度量的偏差选项 选项
|
|
偏差值,500 +- 10 创建范围 490 - 510 请参考厂商文档以了解有效值 |
|
使用外部协议度量匹配路由 选项
|
|
度量值 请参考厂商文档以了解有效值 |
|
匹配具有 MPLS 标签的路由 选项
|
|
匹配 IP 策略列表 |
|
匹配路由的路由类型 |
|
外部路由 (BGP、EIGRP 和 OSPF 类型 1/2) |
|
设置外部路由 选项
|
|
OSPF 外部类型 1 路由 选项
|
|
OSPF 外部类型 2 路由 选项
|
|
内部路由 (包括 OSPF 内部/区域间) 选项
|
|
IS-IS 级别 1 路由 选项
|
|
IS-IS 级别 2 路由 选项
|
|
本地生成的路由 选项
|
|
nssa-external 路由 (OSPF 类型 1/2) |
|
设置 nssa-external 路由 选项
|
|
OSPF 外部类型 1 路由 选项
|
|
OSPF 外部类型 2 路由 选项
|
|
匹配路由的 RPKI 状态 |
|
RPKI 无效状态 选项
|
|
RPKI 未找到状态 选项
|
|
RPKI 有效状态 选项
|
|
安全组 |
|
目标安全组,目标安全标签 请参考厂商文档以了解有效值 |
|
源安全组,源安全标签 请参考厂商文档以了解有效值 |
|
匹配路由的源协议 |
|
边界网关协议 (BGP) 自治系统编号 请参考厂商文档以了解有效值 |
|
直连 选项
|
|
增强型内部网关路由协议 (EIGRP) 自治系统编号 请参考厂商文档以了解有效值 |
|
ISO IS-IS 选项
|
|
定位器ID分离协议 (LISP) 选项
|
|
移动路由 选项
|
|
开放最短路径优先 (OSPF) 进程ID 请参考厂商文档以了解有效值 |
|
OSPFv3 进程ID 请参考厂商文档以了解有效值 |
|
路由信息协议 (RIP) 选项
|
|
静态路由 选项
|
|
匹配路由的标签 |
|
路由标签列表/标签列表名称 |
|
标签值/点分十进制表示的标签,例如 10.10.10.10 |
|
跟踪对象 |
|
插入到/从现有路由映射条目中删除的序列 请参考厂商文档以了解有效值 |
|
匹配路由的源协议 |
|
累积度量值 |
|
来自RIB的度量值 选项
|
|
manual value |
|
BGP AS路径属性的前缀字符串 |
|
添加到AS路径 |
|
AS号 请参考厂商文档以了解有效值 |
|
将最后一个AS添加到AS路径 最后一个AS前缀的个数 请参考厂商文档以了解有效值 |
|
将标签设置为AS路径属性 选项
|
|
自动计算TAG值 选项
|
|
OSI概要地址 下一跳地址 CLNS概要前缀 |
|
设置BGP社区列表(用于删除) 社区列表名称/编号 删除匹配的社区 |
|
BGP社区属性 |
|
添加到现有社区 选项
|
|
优雅关机(众所周知的社区) 选项
|
|
互联网(众所周知的社区) 选项
|
|
不要发送到本地AS外部(众所周知的社区) 选项
|
|
不要向任何对等体通告(众所周知的社区) 选项
|
|
不要导出到下一个AS(众所周知的社区) 选项
|
|
没有社区属性 选项
|
|
社区编号 aa:nn格式的社区编号 请参考厂商文档以了解有效值 |
|
设置BGP路由抖动抑制参数 |
|
抑制稳定路由的最大持续时间 请参考厂商文档以了解有效值 |
|
惩罚的半衰期 请参考厂商文档以了解有效值 |
|
开始重用路由的惩罚 请参考厂商文档以了解有效值 |
|
开始抑制路由的惩罚 请参考厂商文档以了解有效值 |
|
设置默认信息 默认输出接口 |
|
设置BGP/VPN扩展社区列表(用于删除) 扩展社区列表编号/名称 删除匹配的扩展社区 |
|
BGP扩展社区属性 |
|
成本扩展社区 |
|
成本值(无优先级成本 = 2147483647) 请参考厂商文档以了解有效值 |
|
社区ID 请参考厂商文档以了解有效值 |
|
比较以下IGP成本比较 选项
|
|
在最佳路径计算中的所有其他步骤之前进行比较 选项
|
|
路由目标扩展社区 |
|
添加到现有extcommunity 选项
|
|
VPN扩展社区 |
|
指定一个扩展社区范围 |
|
VPN扩展社区 |
|
VPN扩展社区 |
|
源站点扩展社区 |
|
VPN区分器 |
|
添加到现有extcommunity 选项
|
|
VPN扩展社区 |
|
指定一个扩展社区范围 |
|
VPN扩展社区 |
|
VPN扩展社区 |
|
设置为全局路由表 选项
|
|
输出接口 |
|
IP 特定信息 |
|
指定IP地址 用于设置IP地址的前缀列表名称 |
|
设置DF位 选项
|
|
全局路由表 |
|
下一跳的IP地址 |
|
验证下一跳是否可达 |
|
下一跳的IP地址 |
|
要插入到下一跳列表中的序列 请参考厂商文档以了解有效值 |
|
根据跟踪对象的状态设置下一跳 跟踪对象编号 请参考厂商文档以了解有效值 |
|
下一跳地址 |
|
下一跳的IP地址 |
|
应用程序动态设置下一跳 DHCP学习到的下一跳 选项
|
|
VPN下一跳的封装配置文件 L3VPN 封装配置文件名称 |
|
使用对等体地址(仅限BGP) 选项
|
|
递归下一跳 |
|
递归下一跳的IP地址 |
|
全局路由表 选项
|
|
VRF |
|
使用自身地址(仅限BGP) 选项
|
|
验证下一跳是否可达 |
|
下一跳的IP地址 |
|
要插入到下一跳列表中的序列 请参考厂商文档以了解有效值 |
|
设置并验证下一跳是否可达 选项
|
|
根据跟踪对象的状态设置下一跳 跟踪对象编号 请参考厂商文档以了解有效值 |
|
设置优先级字段 |
|
设置关键优先级 (5) 选项
|
|
设置闪存优先级 (3) 选项
|
|
设置闪存覆盖优先级 (4) 选项
|
|
设置立即优先级 (2) 选项
|
|
设置网络互连控制优先级 (6) 选项
|
|
设置网络控制优先级 (7) 选项
|
|
设置优先级优先级 (1) 选项
|
|
设置常规优先级 (0) 选项
|
|
只设置优先级字段 选项
|
|
设置QoS组ID 请参考厂商文档以了解有效值 |
|
设置服务类型字段 |
|
设置最大可靠TOS (2) 选项
|
|
设置最大吞吐量TOS (4) 选项
|
|
设置最小延迟TOS (8) 选项
|
|
设置最小货币成本TOS (1) 选项
|
|
设置普通TOS (0) 选项
|
|
只设置服务类型字段 选项
|
|
VRF |
|
下一跳的IP地址 |
|
VRF名称 |
|
验证下一跳是否可达 |
|
下一跳的IP地址 |
|
要插入到下一跳列表中的序列 请参考厂商文档以了解有效值 |
|
设置并验证下一跳是否可达 选项
|
|
根据跟踪对象的状态设置下一跳 跟踪对象编号 请参考厂商文档以了解有效值 |
|
IPv6 特定信息 |
|
IPv6地址 IPv6前缀列表 |
|
设置默认信息 选项
|
|
全局路由表 |
|
下一跳地址 (X:X:X:X::X) |
|
验证下一跳是否可达 |
|
下一跳地址 (X:X:X:X::X) |
|
要插入到下一跳列表中的序列 请参考厂商文档以了解有效值 |
|
根据跟踪对象的状态设置下一跳 跟踪对象编号 请参考厂商文档以了解有效值 |
|
IPv6下一跳 |
|
下一跳地址 (X:X:X:X::X) |
|
VPN下一跳的封装配置文件 L3VPN 封装配置文件名称 |
|
使用对等体地址(仅限BGP) 选项
|
|
递归下一跳 递归下一跳的IPv6地址 |
|
设置优先级字段 优先级值 请参考厂商文档以了解有效值 |
|
VRF名称 |
|
VRF名称 |
|
验证下一跳是否可达 |
|
下一跳的IPv6地址 |
|
要插入到下一跳列表中的序列 请参考厂商文档以了解有效值 |
|
根据跟踪对象的状态设置下一跳 跟踪对象编号 请参考厂商文档以了解有效值 |
|
导入路由的位置 |
|
导入到级别1区域 选项
|
|
导入到级别1和级别2 选项
|
|
导入到级别2子域 选项
|
|
仅导入到OSPF NSSA区域,并且不传播 选项
|
|
定位器ID分离协议特定信息 指定在LISP路由导入中使用的定位器集 定位器集的名称 |
|
BGP本地优先级路径属性 请参考厂商文档以了解有效值 |
|
目标路由协议的度量值 |
|
添加或减去度量 选项
|
|
EIGRP延迟度量,以10微秒为单位 请参考厂商文档以了解有效值 |
|
EIGRP有效带宽度量(负载),其中255表示100%负载 请参考厂商文档以了解有效值 |
|
EIGRP可靠性度量,其中255表示100%可靠 请参考厂商文档以了解有效值 |
|
度量值或以千比特每秒为单位的带宽 请参考厂商文档以了解有效值 |
|
路径的EIGRP MTU 请参考厂商文档以了解有效值 |
|
目标路由协议的度量类型 |
|
IS-IS外部度量 选项
|
|
IS-IS内部度量或使用IGP度量作为BGP的MED 选项
|
|
OSPF外部类型1度量 选项
|
|
OSPF外部类型2度量 选项
|
|
为前缀设置MPLS标签 选项
|
|
BGP来源代码 |
|
本地IGP 选项
|
|
未知来源 选项
|
|
目标路由协议的标签值 标签值 A.B.C.D(点分十进制格式)/标签值 |
|
用于会计的BGP流量分类编号 请参考厂商文档以了解有效值 |
|
定义VRF名称 VPN路由/转发实例名称 |
|
路由表的BGP权重 请参考厂商文档以了解有效值 |
|
路由映射标签/名称 |
|
此选项仅与状态 *parsed* 一起使用。 此选项的值应为通过执行命令 **sh running-config | section ^route-map** 从IOS设备接收到的输出。 状态 *parsed* 从` |
|
配置应保留的状态 状态 *rendered*、*gathered* 和 *parsed* 不会对设备进行任何更改。 状态 *rendered* 将` 状态 *gathered* 将从设备获取运行配置,并将其转换为按照资源模块argspec格式的结构化数据,并将值返回在结果中的 *gathered* 密钥中。 状态 *parsed* 从` 选项
|
注释
注意
在CML上的Cisco IOSXE 17.3版本上进行了测试。
此模块与连接`
network_cli
` 一起使用。参见 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
示例
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Delete provided Route maps config
cisco.ios.ios_route_maps:
config:
- route_map: test_1
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using deleted without any config passed (NOTE: This will delete all Route maps configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Delete all Route maps config
cisco.ios.ios_route_maps:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_1",
# "no route-map test_2"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# router-ios#
- name: Merge provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is test route
match:
ip:
next_hop:
prefix_lists:
- test_1_new
- test_2_new
route_source:
acls:
- 10
security_group:
source:
- 10
- 20
local_preference:
value:
- 50
- 100
mpls_label: true
- sequence: 20
action: deny
continue_entry:
entry_sequence: 100
match:
additional_paths:
all: true
group_best: true
as_path:
acls:
- 100
- 200
ipv6:
address:
acl: test_acl_20
route_type:
level_1: true
tag:
tag_list:
- test_match_tag
track: 105
- route_map: test_2
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_ip_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 10
- 20
local_preference:
value:
- 55
- 105
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.51.110.1
verify_availability:
address: 198.51.111.1
sequence: 100
track: 10
precedence:
critical: true
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "route-map test_2 deny 10",
# "match security-group source tag 10 20",
# "match local-preference 55 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_ip_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.51.110.1",
# "set ip next-hop verify-availability 198.51.111.1 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 20",
# "continue 100",
# "match track 105",
# "match tag list test_match_tag",
# "match ipv6 address test_acl_20",
# "match route-type level-1",
# "match as-path 200 100",
# "match additional-paths advertise-set all group-best",
# "route-map test_1 deny 10",
# "description this is test route",
# "match security-group source tag 10 20",
# "match ip next-hop prefix-list test_2_new test_1_new",
# "match ip route-source 10",
# "match local-preference 100 50",
# "match mpls-label"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Override provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is override route
match:
ip:
next_hop:
acls:
- 10
- test1_acl
flowspec:
dest_pfx: true
acls:
- test_acl_1
- test_acl_2
length:
minimum: 10
maximum: 100
metric:
value: 10
external: true
security_group:
source:
- 10
- 20
mpls_label: true
set:
extcommunity:
vpn_distinguisher:
address: 192.0.2.1:12
additive: true
metric:
metric_value: 100
deviation: plus
eigrp_delay: 100
metric_reliability: 10
metric_bandwidth: 20
mtu: 30
- route_map: test_override
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 15
- 20
local_preference:
value:
- 105
- 110
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.110.51.1
verify_availability:
address: 198.110.51.2
sequence: 100
track: 10
precedence:
critical: true
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_2",
# "route-map test_override deny 10",
# "match security-group source tag 15 20",
# "match local-preference 110 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.110.51.1",
# "set ip next-hop verify-availability 198.110.51.2 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 10",
# "no description this is test route",
# "description this is override route",
# "match ip flowspec dest-pfx test_acl_1 test_acl_2",
# "no match ip next-hop prefix-list test_2_new test_1_new",
# "match ip next-hop test1_acl 10",
# "no match ip route-source 10",
# "match metric external 10",
# "match length 10 100",
# "no match local-preference 100 50",
# "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
# "set metric 100 +100 10 20 30",
# "no route-map test_1 deny 20"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_override deny 10
# match security-group source tag 15 20
# match local-preference 110 105
# match mpls-label
# match ipv6 address test_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.110.51.2 100 track 10
# set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
# description this is override route
# match ip flowspec dest-pfx test_acl_1 test_acl_2
# match ip next-hop test1_acl 10
# match security-group source tag 10 20
# match metric external 10
# match mpls-label
# match length 10 100
# set metric 100 +100 10 20 30
# set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Replaced provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is replaced route
match:
ip:
next_hop:
acls:
- 10
- test1_acl
flowspec:
dest_pfx: true
acls:
- test_acl_1
- test_acl_2
length:
minimum: 10
maximum: 100
metric:
value: 10
external: true
security_group:
source:
- 10
- 20
mpls_label: true
set:
extcommunity:
vpn_distinguisher:
address: 192.0.2.1:12
additive: true
metric:
metric_value: 100
deviation: plus
eigrp_delay: 100
metric_reliability: 10
metric_bandwidth: 20
mtu: 30
- route_map: test_replaced
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 15
- 20
local_preference:
value:
- 105
- 110
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.110.51.1
verify_availability:
address: 198.110.51.2
sequence: 100
track: 10
precedence:
critical: true
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "route-map test_replaced deny 10",
# "match security-group source tag 15 20",
# "match local-preference 110 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.110.51.1",
# "set ip next-hop verify-availability 198.110.51.2 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 10",
# "no description this is test route",
# "description this is replaced route",
# "match ip flowspec dest-pfx test_acl_1 test_acl_2",
# "no match ip next-hop prefix-list test_2_new test_1_new",
# "match ip next-hop test1_acl 10",
# "no match ip route-source 10",
# "match metric external 10",
# "match length 10 100",
# "no match local-preference 100 50",
# "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
# "set metric 100 +100 10 20 30",
# "no route-map test_1 deny 20"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_replaced deny 10
# match security-group source tag 15 20
# match local-preference 110 105
# match mpls-label
# match ipv6 address test_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.110.51.2 100 track 10
# set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
# description this is replaced route
# match ip flowspec dest-pfx test_acl_1 test_acl_2
# match ip next-hop test1_acl 10
# match security-group source tag 10 20
# match metric external 10
# match mpls-label
# match length 10 100
# set metric 100 +100 10 20 30
# set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Gather Route maps provided configurations
cisco.ios.ios_route_maps:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "entries": [
# {
# "action": "deny",
# "description": "this is test route",
# "match": {
# "ip": {
# "next_hop": {
# "prefix_lists": [
# "test_2_new",
# "test_1_new"
# ]
# },
# "route_source": {
# "acls": [
# "10"
# ]
# }
# },
# "local_preference": {
# "value": [
# "100",
# "50"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_entry": {
# "entry_sequence": 100
# },
# "match": {
# "additional_paths": {
# "all": true,
# "group_best": true
# },
# "as_path": {
# "acls": [
# 200,
# 100
# ]
# },
# "ipv6": {
# "address": {
# "acl": "test_acl_20"
# }
# },
# "route_type": {
# "external": {
# "set": true
# },
# "level_1": true,
# "nssa_external": {
# "set": true
# }
# },
# "tag": {
# "tag_list": [
# "test_match_tag"
# ]
# },
# "track": 105
# },
# "sequence": 20
# }
# ],
# "route_map": "test_1"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "address": {
# "acl": "test_ip_acl"
# },
# "next_hop": {
# "prefix_list": "test_new"
# },
# "route_source": {
# "acl": "route_src_acl"
# }
# },
# "local_preference": {
# "value": [
# "55",
# "105"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10,
# "set": {
# "aigp_metric": {
# "value": 100
# },
# "automatic_tag": true,
# "extcommunity": {
# "cost": {
# "cost_value": 100,
# "id": "10",
# "pre_bestpath": true
# }
# },
# "ip": {
# "address": "192.0.2.1",
# "df": 1,
# "next_hop": {
# "recursive": {
# "address": "198.51.110.1",
# "global_route": true
# },
# "verify_availability": {
# "address": "198.51.111.1",
# "sequence": 100,
# "track": 10
# }
# },
# "precedence": {
# "critical": true
# }
# }
# }
# }
# ],
# "route_map": "test_2"
# }
# ]
# After state:
# ------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is test route
match:
ip:
next_hop:
prefix_lists:
- test_1_new
- test_2_new
route_source:
acls:
- 10
security_group:
source:
- 10
- 20
local_preference:
value:
- 50
- 100
mpls_label: true
- sequence: 20
action: deny
continue_entry:
entry_sequence: 100
match:
additional_paths:
all: true
group_best: true
as_path:
acls:
- 100
- 200
ipv6:
address:
acl: test_acl_20
route_type:
level_1: true
tag:
tag_list:
- test_match_tag
track: 105
- route_map: test_2
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_ip_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 10
- 20
local_preference:
value:
- 55
- 105
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.51.110.1
verify_availability:
address: 198.51.111.1
sequence: 100
track: 10
precedence:
critical: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "route-map test_2 deny 10",
# "match security-group source tag 10 20",
# "match local-preference 55 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_ip_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.51.110.1",
# "set ip next-hop verify-availability 198.51.111.1 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 20",
# "continue 100",
# "match track 105",
# "match tag list test_match_tag",
# "match ipv6 address test_acl_20",
# "match route-type level-1",
# "match as-path 200 100",
# "match additional-paths advertise-set all group-best",
# "route-map test_1 deny 10",
# "description this is test route",
# "match security-group source tag 10 20",
# "match ip next-hop prefix-list test_2_new test_1_new",
# "match ip route-source 10",
# "match local-preference 100 50",
# "match mpls-label"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_route_maps:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "entries": [
# {
# "action": "deny",
# "description": "this is test route",
# "match": {
# "ip": {
# "next_hop": {
# "prefix_lists": [
# "test_2_new",
# "test_1_new"
# ]
# },
# "route_source": {
# "acls": [
# "10"
# ]
# }
# },
# "local_preference": {
# "value": [
# "100",
# "50"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_entry": {
# "entry_sequence": 100
# },
# "match": {
# "additional_paths": {
# "all": true,
# "group_best": true
# },
# "as_path": {
# "acls": [
# 200,
# 100
# ]
# },
# "ipv6": {
# "address": {
# "acl": "test_acl_20"
# }
# },
# "route_type": {
# "external": {
# "set": true
# },
# "level_1": true,
# "nssa_external": {
# "set": true
# }
# },
# "tag": {
# "tag_list": [
# "test_match_tag"
# ]
# },
# "track": 105
# },
# "sequence": 20
# }
# ],
# "route_map": "test_1"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "address": {
# "acl": "test_ip_acl"
# },
# "next_hop": {
# "prefix_list": "test_new"
# },
# "route_source": {
# "acl": "route_src_acl"
# }
# },
# "local_preference": {
# "value": [
# "55",
# "105"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10,
# "set": {
# "aigp_metric": {
# "value": 100
# },
# "automatic_tag": true,
# "extcommunity": {
# "cost": {
# "cost_value": 100,
# "id": "10",
# "pre_bestpath": true
# }
# },
# "ip": {
# "address": "192.0.2.1",
# "df": 1,
# "next_hop": {
# "recursive": {
# "address": "198.51.110.1",
# "global_route": true
# },
# "verify_availability": {
# "address": "198.51.111.1",
# "sequence": 100,
# "track": 10
# }
# },
# "precedence": {
# "critical": true
# }
# }
# }
# }
# ],
# "route_map": "test_2"
# }
# ]
返回值
常见的返回值在此处有说明 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
生成的配置模型调用。 返回:发生更改时 示例: |
|
模型调用之前的配置。 返回:始终返回 示例: |
|
推送到远程设备的命令集。 返回:始终返回 示例: |