arista.eos.eos_route_maps 模块 – 管理路由映射资源模块
注意
此模块是 arista.eos 集合 (版本 10.0.1) 的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install arista.eos
。
要在剧本中使用它,请指定:arista.eos.eos_route_maps
。
arista.eos 2.1.0 中的新增功能
摘要
此模块配置和管理 Arista EOS 平台上路由映射的属性。
参数
参数 |
注释 |
---|---|
路由映射选项列表 |
|
路由映射条目。 |
|
匹配路由的操作 选项
|
|
路由映射条目序号。 |
|
路由映射的描述。 |
|
路由映射匹配规则。 |
|
BGP 贡献者聚合关系中的角色。 |
|
BGP 聚合的贡献者。 选项
|
|
应用于聚合路由的路由映射。 |
|
BGP AS 号。 |
|
设置 AS 路径。 |
|
指定 AS 路径长度(使用比较运算符,例如 <= 60 和 >= 40)。 |
|
AS 路径列表名称。 |
|
BGP 社区属性。 |
|
社区名称列表(以 CSV 格式)。 |
|
进行社区的精确匹配。 选项
|
|
匹配社区实例的数量(使用比较运算符,例如 <= 60 和 >= 40)。 |
|
扩展社区列表名称。 |
|
社区名称列表(以 CSV 格式)。 |
|
进行社区的精确匹配。 选项
|
|
接口名称。 |
|
反转匹配结果。 |
|
BGP 贡献者聚合关系中的角色。 |
|
BGP 聚合的贡献者。 选项
|
|
应用于聚合路由的路由映射。 |
|
设置 AS 路径。 |
|
指定 AS 路径长度(使用比较运算符,例如 <= 60 和 >= 40)。 |
|
AS 路径列表名称。 |
|
BGP 社区属性。 |
|
社区名称列表(以 CSV 格式)。 |
|
进行社区的精确匹配。 选项
|
|
匹配社区实例的数量(使用比较运算符,例如 <= 60 和 >= 40)。 |
|
扩展社区列表名称。 |
|
社区名称列表(以 CSV 格式)。 |
|
进行社区的精确匹配。 选项
|
|
扩展社区列表名称。 |
|
社区名称列表(以 CSV 格式)。 |
|
进行社区的精确匹配。 选项
|
|
设置 IP 特定信息。 |
|
下一跳目标。 |
|
IP 访问列表。 |
|
配置动态前缀列表。 选项
|
|
前缀列表。 |
|
下一跳前缀列表。 |
|
路由解析的前缀列表。 |
|
设置 IPv6 特定信息。 |
|
下一跳目标。 |
|
IP 访问列表。 |
|
配置动态前缀列表。 选项
|
|
前缀列表。 |
|
下一跳前缀列表。 |
|
路由解析的前缀列表。 |
|
IS-IS 层次。 |
|
扩展社区列表名称。 |
|
社区名称列表(以 CSV 格式)。 |
|
进行社区的精确匹配。 选项
|
|
BGP 本地优先级。 |
|
路由度量。 |
|
路由度量类型。 选项
|
|
路由类型 |
|
路由器 ID。 |
|
源路由协议, |
|
路由标签 |
|
序列中的索引。 |
|
设置路由属性。 |
|
设置 AS 路径。 |
|
匹配整个 AS 路径。 |
|
要使用的 AS 号(包括 auto;以 CSV 格式) |
|
删除匹配的 AS 号 选项
|
|
添加到 AS 路径。 |
|
要添加的 AS 号(包括 auto;以 CSV 格式) |
|
添加最后一个 AS 号的次数。 |
|
BGP AS 路径多路径权重。 |
|
BGP 社区属性。 |
|
社区属性。 |
|
添加到现有社区。 选项
|
|
删除匹配的社区。 选项
|
|
优雅关机。 选项
|
|
Internet 社区 选项
|
|
社区列表名称。 |
|
不要发送到本地 AS 外部。 选项
|
|
不要向任何对等体通告。 选项
|
|
不要导出到下一个 AS。 选项
|
|
社区编号(以 CSV 格式)。 |
|
优雅关机 选项
|
|
无社区属性。 选项
|
|
设置协议无关距离。 |
|
向 eBGP 对等体通告时保留下一跳。 选项
|
|
BGP 扩展社区属性。 |
|
链路带宽值。 |
|
聚合链路带宽。 选项
|
|
划分链路带宽。 选项
|
|
链路带宽扩展社区值。 |
|
无属性。 选项
|
|
路由目标扩展社区 |
|
添加到现有社区。 选项
|
|
删除匹配的社区。 选项
|
|
VPN 扩展社区。 |
|
站点起源扩展社区。 |
|
添加到现有社区。 选项
|
|
删除匹配的社区。 选项
|
|
VPN 扩展社区。 |
|
设置 IP 特定信息。 |
|
下一跳地址。 |
|
使用 BGP 对等地址作为下一跳。 选项
|
|
向 eBGP 对等体通告时保留下一跳 选项
|
|
设置 IPv6 特定信息。 |
|
下一跳地址。 |
|
使用 BGP 对等地址作为下一跳。 选项
|
|
向 eBGP 对等体通告时保留下一跳 选项
|
|
IS-IS 层次。 |
|
BGP 本地优先级。 |
|
路由度量。 |
|
添加 igp-metric / igp-nexthop-cost 选项
|
|
IGP 参数 选项
|
|
要添加或减去的度量值(带 +/- 符号)。 |
|
路由度量类型。 选项
|
|
路由下一跳。 |
|
设置 IGP 最大度量值。 选项
|
|
IGP 度量值。 |
|
设置 bgp 原点。 选项
|
|
MPLS 分段路由分段索引。 |
|
路由标签 |
|
BGP 权重。 |
|
重命名/复制配置 |
|
重命名或复制配置 选项
|
|
如果为 true,则覆盖现有配置。 选项
|
|
源路由映射名称。 |
|
语句名称 |
|
子路由映射 |
|
反转子路由映射结果 选项
|
|
子路由映射名称 |
|
路由映射名称。 |
|
此选项仅在 state 为 *parsed* 时使用。 此选项的值应是从 EOS 设备通过执行命令 **show running-config | section route-map** 收到的输出。 已解析的`state`从` |
|
配置应保留的状态。 选项
|
备注
注意
已在Arista EOS 4.24.6F上测试。
此模块与连接`
network_cli
一起使用。 请参见EOS平台选项。
示例
# Using merged
# Before state
# veos#show running-config | section route-map
# veos#
- name: Merge provided configuration with device configuration
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- description: "merged_map"
action: "permit"
sequence: 10
match:
router_id: 22
- description: "newmap"
action: "deny"
sequence: 25
continue_sequence: 45
match:
interface: "Ethernet1"
- route_map: "mapmerge2"
entries:
- sub_route_map:
name: "mapmerge"
action: "deny"
sequence: 45
set:
metric:
value: 25
add: "igp-metric"
as_path:
prepend:
last_as: 2
match:
ipv6:
resolved_next_hop: "list1"
state: merged
# After State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
# route-map test permit 10
# veos#
# Module Execution:
# "after": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "before": {},
# "changed": true,
# "commands": [
# "route-map mapmerge permit 10",
# "match router-id prefix-list 22",
# "description merged_map",
# "route-map mapmerge deny 25",
# "match interface Ethernet1",
# "description newmap",
# "continue 45",
# "route-map mapmerge2 deny 45",
# "match ipv6 resolved-next-hop prefix-list list1",
# "set metric 25 +igp-metric",
# "set as-path prepend last-as 2",
# "sub-route-map mapmerge"
# ],
#
# Using replaced:
# Before State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
# veos#
- name: Replace
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- action: "permit"
sequence: 10
match:
ipv6:
resolved_next_hop: "listr"
- action: "deny"
sequence: 90
set:
extcommunity:
rt:
vpn: "22:11"
delete: true
ip:
unchanged: true
state: replaced
# After State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge deny 90
# set ip next-hop unchanged
# set extcommunity rt 22:11 delete
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
#
# Module Execution:
#
# "after": [
# {
# "entries": [
# {
# "action": "permit",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "extcommunity": {
# "rt": {
# "delete": true,
# "vpn": "22:11"
# }
# },
# "ip": {
# "unchanged": true
# }
# }
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# },
# {
# "entries": [
# {
# "action": "permit",
# "sequence": 10
# }
# ],
# "route_map": "test"
# }
# ],
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "changed": true,
# "commands": [
# "route-map mapmerge permit 10",
# "match ipv6 resolved-next-hop prefix-list listr",
# "no match router-id prefix-list 22",
# "no description",
# "route-map mapmerge deny 90",
# "set extcommunity rt 22:11 delete",
# "set ip next-hop unchanged"
# ],
#
#
# Using Overridden:
# Before state:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge deny 90
# set ip next-hop unchanged
# set extcommunity rt 22:11 delete
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# !
# route-map test permit 10
# veos#
- name: Override
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- action: "permit"
sequence: 10
match:
ipv6:
resolved_next_hop: "listr"
- action: "deny"
sequence: 90
set:
metric:
igp_param: "igp-nexthop-cost"
state: overridden
# After State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 90
# set metric igp-nexthop-cost
# veos#
#
#
# "after": [
# {
# "entries": [
# {
# "action": "permit",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "metric": {
# "igp_param": "igp-nexthop-cost"
# }
# }
# }
# ],
# "route_map": "mapmerge"
# }
# ],
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "extcommunity": {
# "rt": {
# "delete": true,
# "vpn": "22:11"
# }
# },
# "ip": {
# "unchanged": true
# }
# }
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# },
# {
# "entries": [
# {
# "action": "permit",
# "sequence": 10
# }
# ],
# "route_map": "test"
# }
# ],
# "changed": true,
# "commands": [
# "no route-map mapmerge deny 25",
# "no route-map mapmerge2 deny 45",
# "no route-map test permit 10",
# "route-map mapmerge deny 90",
# "set metric igp-nexthop-cost",
# "no set ip next-hop unchanged",
# "no set extcommunity rt 22:11 delete"
# ],
#
# Using deleted:
# Before State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# match ipv6 resolved-next-hop prefix-list listr
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge deny 90
# set metric igp-nexthop-cost
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
- name: Delete route-map
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
state: deleted
become: true
tags:
- deleted1
# After State:
# veos#show running-config | section route-map
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
#
# Module Execution:
#
# "after": [
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "ipv6": {
# "resolved_next_hop": "listr"
# },
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# },
# {
# "action": "deny",
# "sequence": 90,
# "set": {
# "metric": {
# "igp_param": "igp-nexthop-cost"
# }
# }
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "changed": true,
# "commands": [
# "no route-map mapmerge"
# ],
# Using deleted to delete all route-maps:
# Before State:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
- name: Delete all route-maps
arista.eos.eos_route_maps:
state: deleted
# After State:
# ------------
# veos#show running-config | section route-map
# veos#
#
# Module Execution:
#
# "after": {},
# "before": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# "changed": true,
# "commands": [
# "no route-map mapmerge",
# "no route-map mapmerge2"
# ],
# Using gathered:
# Device configs:
# veos#show running-config | section route-map
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
# veos#
- name: gather configs
arista.eos.eos_route_maps:
state: gathered
# Module Execution:
# "gathered": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ],
# Using rendered:
- name: Render provided configuration
arista.eos.eos_route_maps:
config:
- route_map: "mapmerge"
entries:
- description: "merged_map"
action: "permit"
sequence: 10
match:
router_id: 22
set:
bgp: 20
- description: "newmap"
action: "deny"
sequence: 25
continue_sequence: 45
match:
interface: "Ethernet1"
- route_map: "mapmerge2"
entries:
- sub_route_map:
name: "mapmerge"
action: "deny"
sequence: 45
set:
metric:
value: 25
add: "igp-metric"
as_path:
prepend:
last_as: 2
match:
ipv6:
resolved_next_hop: "list1"
state: rendered
# Task output:
# ------------
# "rendered": [
# "route-map mapmerge permit 10",
# "match router-id prefix-list 22",
# "set bgp bestpath as-path weight 20",
# "description merged_map",
# "route-map mapmerge deny 25",
# "match interface Ethernet1",
# "description newmap",
# "continue 45",
# "route-map mapmerge2 deny 45",
# "match ipv6 resolved-next-hop prefix-list list1",
# "set metric 25 +igp-metric",
# "set as-path prepend last-as 2",
# "sub-route-map mapmerge"
# ]
# Using parsed:
# parsed.cfg
# route-map mapmerge permit 10
# description merged_map
# match router-id prefix-list 22
# set bgp bestpath as-path weight 20
# !
# route-map mapmerge deny 25
# description newmap
# match interface Ethernet1
# continue 45
# !
# route-map mapmerge2 deny 45
# match ipv6 resolved-next-hop prefix-list list1
# sub-route-map mapmerge
# set metric 25 +igp-metric
# set as-path prepend last-as 2
- name: parse configs
arista.eos.eos_route_maps:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
# Module Execution:
# "parsed": [
# {
# "entries": [
# {
# "action": "permit",
# "description": "merged_map",
# "match": {
# "router_id": "22"
# },
# "sequence": 10,
# "set": {
# "bgp": 20
# }
# },
# {
# "action": "deny",
# "continue_sequence": 45,
# "description": "newmap",
# "match": {
# "interface": "Ethernet1"
# },
# "sequence": 25
# }
# ],
# "route_map": "mapmerge"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "resolved_next_hop": "list1"
# }
# },
# "sequence": 45,
# "set": {
# "as_path": {
# "prepend": {
# "last_as": 2
# }
# },
# "metric": {
# "add": "igp-metric",
# "value": "25"
# }
# },
# "sub_route_map": {
# "name": "mapmerge"
# }
# }
# ],
# "route_map": "mapmerge2"
# }
# ]