cisco.ios.ios_evpn_global 模块 – 配置 L2VPN EVPN 的资源模块。
注意
此模块是 cisco.ios 集合 (版本 9.0.3) 的一部分。
如果您使用的是 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.ios
。
要在剧本中使用它,请指定:cisco.ios.ios_evpn_global
。
cisco.ios 5.3.0 中的新增功能
概要
此模块提供对 Cisco IOS 网络设备上 L2VPN EVPN 的声明式管理。
别名:evpn_global
参数
参数 |
注释 |
---|---|
L2VPN 以太网虚拟专用网络 (EVPN) 配置的字典 |
|
默认网关参数 |
|
通告默认网关 MAC/IP 路由 选项
|
|
抑制广播、多播和/或未知单播数据包的泛洪 |
|
抑制地址解析和邻居发现协议数据包的泛洪 |
|
禁用泛洪抑制 选项
|
|
IP 参数 |
|
IP 本地学习 |
|
禁用 IP 本地学习 选项
|
|
复制 BUM 流量的 方法 选项
|
|
路由目标 VPN 扩展社区 |
|
自动设置路由目标 |
|
设置基于 vni 的路由目标 选项
|
|
EVPN 路由器 ID |
|
此选项仅与状态 *parsed* 一起使用。 此选项的值应为通过执行命令 **sh running-config nve | section ^l2vpn evpn$** 从 IOS 设备接收到的输出。 状态 *parsed* 从 |
|
配置应保留到的状态 选项
|
备注
注意
在具有版本 17.13.01 的 Cisco IOS-XE 设备(Cat9k on CML)上进行了测试。
此模块与连接
network_cli
一起使用。请参阅 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
示例
# Using merged
# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
# replication-type static
# router-id Loopback1
# default-gateway advertise
- name: Merge provided configuration with device configuration
cisco.ios.ios_evpn_global:
config:
replication_type: ingress
route_target:
auto:
vni: true
default_gateway:
advertise: false
ip:
local_learning:
disable: true
flooding_suppression:
address_resolution:
disable: false
state: merged
# Task Output
# -----------
#
# before:
# - replication_type: static
# router_id: Loopback1
# default_gateway:
# advertise: true
# commands:
# - l2vpn evpn
# no default-gateway advertise
# replication-type ingress
# route-target auto vni
# ip local-learning disable
# after:
# - replication_type: ingress
# router_id: Loopback1
# route_target:
# auto:
# vni: true
# ip:
# local_learning:
# disable: true
# After state:
# ------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
# replication-type ingress
# router-id Loopback1
# ip local-learning disable
# route-target auto vni
# Using replaced
# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
# replication-type ingress
# router-id Loopback1
# ip local-learning disable
# route-target auto vni
- name: Replaces device configuration for EVPN global with provided configuration
cisco.ios.ios_evpn_global:
config:
replication_type: static
router_id: Loopback2
default_gateway:
advertise: true
flooding_suppression:
address_resolution:
disable: true
state: replaced
# Task Output
# -----------
#
# before:
# - replication_type: ingress
# router_id: Loopback1
# route_target:
# auto:
# vni: true
# ip:
# local_learning:
# disable: true
# commands:
# - l2vpn evpn
# - default-gateway advertise
# - flooding-suppression address-resolution disable
# - no ip local-learning disable
# - replication-type static
# - no route-target auto vni
# - router-id Loopback2
# after:
# - replication_type: ingress
# router_id: Loopback2
# default_gateway:
# advertise: true
# flooding_suppression:
# address_resolution:
# disable: true
# After state:
# ------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
# replication-type static
# flooding-suppression address-resolution disable
# router-id Loopback2
# default-gateway advertise
# Using Deleted
# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
# replication-type static
# flooding-suppression address-resolution disable
# router-id Loopback2
# default-gateway advertise
- name: Delete EVPN global
cisco.ios.ios_evpn_global:
config:
state: deleted
# before:
# - replication_type: ingress
# router_id: Loopback2
# default_gateway:
# advertise: true
# flooding_suppression:
# address_resolution:
# disable: true
# commands:
# - no l2vpn evpn
# after:
#
# After state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
#
# Using gathered
# Before state:
# -------------
#
# Leaf-01#show running-config nve | section ^l2vpn evpn$
# l2vpn evpn
# replication-type ingress
# router-id Loopback1
# ip local-learning disable
# route-target auto vni
- name: Gather facts of l2vpn evpn
cisco.ios.ios_evpn_global:
config:
state: gathered
# Task Output:
# ------------
#
# gathered:
# - replication_type: ingress
# route_target:
# auto:
# vni: true
# router_id: Loopback1
# ip:
# local_learning:
# disable: true
# Using rendered
- name: Render the commands for provided configuration
cisco.ios.ios_evpn_global:
config:
replication_type: static
route_target:
auto:
vni: true
state: rendered
# Task Output:
# ------------
#
# rendered:
# - l2vpn evpn
# - replication-type static
# - route-target auto vni
# Using parsed
# File: parsed.cfg
# ----------------
#
# l2vpn evpn
# replication-type ingress
# router-id Loopback1
# default-gateway advertise
# route-target auto vni
- name: Parse the provided configuration
cisco.ios.ios_evpn_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task Output:
# ------------
#
# parsed:
# - replication_type: ingress
# route_target:
# auto:
# vni: true
# router_id: Loopback1
# default_gateway:
# advertise: true
返回值
常见的返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
模块执行后的结果配置。 返回:发生更改时 示例: |
|
模块执行之前的配置。 返回:当 *state* 为 示例: |
|
推送到远程设备的命令集。 返回:当 *state* 为 示例: |
|
从远程设备收集的关于网络资源的事实,作为结构化数据。 返回:当 *state* 为 示例: |
|
根据模块argspec,将running_config选项中提供的设备原生配置解析为结构化数据。 返回:当state为 示例: |
|
在任务中提供的配置以设备原生格式(离线)呈现。 返回:当state为 示例: |