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 Add-Path 匹配策略 BGP Add-Path 广告集策略 |
|
BGP Add-Path 广告所有路径 选择
|
|
BGP Add-Path 广告最佳 n 条路径 (1-3) |
|
BGP Add-Path 广告最佳路径(范围 m 到 n) |
|
BGP Add-Path 要广告的最佳路径(下限)(1-3) |
|
BGP Add-Path 要广告的最佳路径(上限)(1-3) |
|
BGP Add-Path 广告组最佳路径 选择
|
|
匹配 BGP AS 路径列表 |
|
AS 路径访问列表 请参阅供应商文档以获取有效值 |
|
设置 AS 路径列表 选择
|
|
CLNS 信息 |
|
匹配路由地址或匹配数据包 |
|
匹配路由的下一跳地址 |
|
匹配路由的广告源地址 |
|
匹配 BGP 社区列表 |
|
执行社区的精确匹配 选择
|
|
社区列表编号/社区列表名称 请参阅供应商文档以获取有效值 |
|
匹配 BGP/VPN 扩展社区列表 扩展社区列表编号 请参阅供应商文档以获取有效值 |
|
匹配路由的第一跳接口 |
|
IP 特定信息 |
|
匹配路由地址或匹配数据包 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参阅供应商文档以获取有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
匹配流规范前缀的源/目标前缀组件 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参阅供应商文档以获取有效值 |
|
匹配流规范前缀的目标前缀组件 选择
|
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
匹配流规范前缀的源前缀组件 选择
|
|
匹配路由的下一跳地址 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参阅供应商文档以获取有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
设置下一跳地址 选择
|
|
路由重分发源(仅限 EIGRP) |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参阅供应商文档以获取有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
设置重分发源 选择
|
|
匹配路由的广告源地址 |
|
匹配 ACL 的条目 IP ACL 名称/编号 请参阅供应商文档以获取有效值 |
|
匹配前缀列表的条目 IP 前缀列表名称 |
|
路由重分发源(仅限 EIGRP) 选择
|
|
设置重分发源 选择
|
|
IPv6 特定信息 |
|
匹配路由地址或匹配数据包 |
|
IPv6 访问列表名称 |
|
IPv6 前缀列表名称 |
|
匹配路由的下一跳地址 |
|
IPv6 访问列表名称 |
|
匹配流规范前缀的目标前缀组件 选择
|
|
IPv6 前缀列表名称 |
|
匹配流规范前缀的源前缀组件 选择
|
|
匹配路由的下一跳地址 |
|
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-外部路由(OSPF 类型 1/2) |
|
设置 nssa-外部路由 选择
|
|
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 的度量值 选择
|
|
手动值 |
|
为 BGP AS 路径属性添加前缀字符串 |
|
添加到 AS 路径的前缀 |
|
AS 编号 请参阅供应商文档以获取有效值 |
|
将最后一个 AS 添加到 AS 路径的前缀 最后一个 AS 添加前缀的数量 请参阅供应商文档以获取有效值 |
|
将标签设置为 AS 路径属性 选择
|
|
自动计算 TAG 值 选择
|
|
OSI 汇总地址 下一跳地址 CLNS 汇总前缀 |
|
设置 BGP 团体列表(用于删除) 团体列表名称/编号 删除匹配的团体 |
|
BGP 团体属性 |
|
添加到现有团体 选择
|
|
优雅关闭(知名团体) 选择
|
|
互联网(知名团体) 选择
|
|
不要发送到本地 AS 之外(知名团体) 选择
|
|
不要向任何对等体通告(知名团体) 选择
|
|
不要导出到下一个 AS(知名团体) 选择
|
|
无团体属性 选择
|
|
团体编号 aa:nn 格式的团体编号 请参阅供应商文档以获取有效值 |
|
设置 BGP 路由震荡抑制参数 |
|
抑制稳定路由的最大持续时间 请参阅供应商文档以获取有效值 |
|
惩罚的半衰期 请参阅供应商文档以获取有效值 |
|
开始重用路由的惩罚值 请参阅供应商文档以获取有效值 |
|
开始抑制路由的惩罚值 请参阅供应商文档以获取有效值 |
|
设置默认信息 默认输出接口 |
|
设置 BGP/VPN 扩展团体列表(用于删除) 扩展团体列表编号/名称 删除匹配的扩展团体 |
|
BGP 扩展团体属性 |
|
成本扩展团体 |
|
成本值(无偏好成本 = 2147483647) 请参阅供应商文档以获取有效值 |
|
团体 ID 请参阅供应商文档以获取有效值 |
|
比较以下 IGP 成本比较 选择
|
|
在最佳路径计算中的所有其他步骤之前进行比较 选择
|
|
路由目标扩展团体 |
|
添加到现有扩展团体 选择
|
|
VPN 扩展团体 |
|
指定扩展团体的范围 |
|
VPN 扩展团体 |
|
VPN 扩展团体 |
|
始发站点扩展团体 |
|
VPN 区分符 |
|
添加到现有扩展团体 选择
|
|
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 源站代码 |
|
local 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"
# }
# ]
返回值
常见返回值记录在此处,以下是此模块独有的字段
键 |
描述 |
---|---|
生成的配置模型调用。 返回:当更改时 示例: |
|
模型调用之前的配置。 返回:总是 示例: |
|
推送到远程设备的命令集。 返回:总是 示例: |