cisco.iosxr.iosxr_ospf_interfaces 模块 – 用于配置 OSPF 接口的资源模块。
注意
此模块是 cisco.iosxr 集合(版本 10.2.2)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.iosxr
。
要在 playbook 中使用它,请指定:cisco.iosxr.iosxr_ospf_interfaces
。
cisco.iosxr 1.2.0 中的新增功能
概要
此模块管理运行 Cisco IOS-XR 的设备上接口的 OSPF(v2/v3) 配置。
参数
参数 |
注释 |
---|---|
接口的 OSPF 配置列表。 |
|
地址族上下文中接口的 OSPF 设置。 |
|
接口上 OSPF 设置的地址族标识符 (AFI)。 选择
|
|
指定来自组的配置 |
|
指定组的名称 |
|
指定组配置操作 选择
|
|
启用身份验证 |
|
使用消息摘要身份验证 |
|
指定密钥链名称 |
|
不使用身份验证 选择
|
|
指定身份验证密码(密钥) |
|
指定将跟随未加密的密码(密钥) |
|
指定将跟随加密的密码(密钥) |
|
OSPFv2 密码(密钥) |
|
配置 BFD 参数 |
|
配置快速检测 |
|
仅启用快速检测 选择
|
|
保持邻居会话,直到 BFD 会话启动 选择
|
|
毫秒为单位的 Hello 间隔 |
|
检测乘数 |
|
指定接口成本 |
|
当累积带宽低于阈值时指定成本 |
|
指定与累积带宽相关的成本 |
|
指定应用成本回退时的阈值带宽 |
|
在同步和泛洪期间筛选 OSPF LSA |
|
筛选所有传出 LSA 选择
|
|
指定在宣布邻居死亡后的间隔 |
|
启用/禁用按需电路 选择
|
|
指定 IP 快速重路由 |
|
禁用 IP 快速重路由 选择
|
|
指定每个前缀计算 |
|
指定每个链路的 LFA 排除或 FRR LFA 候选信息 选择
|
|
指定每个链路的 LFA 排除信息 |
|
指定聚合以太网接口 |
|
指定接口 ID |
|
指定桥组虚拟接口 |
|
指定接口 ID |
|
指定快速以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定五十千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定四十千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定四百千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定百千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 MgmtEth/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定多链路网络接口 |
|
指定接口 ID |
|
指定网络虚拟化端点接口 |
|
指定接口 ID |
|
指定聚合 POS 接口 |
|
指定接口 ID |
|
指定 PWHE 以太网接口 |
|
指定接口 ID |
|
指定 PWHE VC11 IP 互通接口 |
|
指定接口 ID |
|
指定串行网络接口 |
|
指定接口 ID |
|
指定 SRP 接口 |
|
指定接口 ID |
|
指定万兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 GRE/IPinIP 隧道接口 |
|
指定接口 ID |
|
指定 IPSec 隧道接口 |
|
指定接口 ID |
|
MPLS 传输协议隧道接口 |
|
指定接口 ID |
|
指定 MPLS 流量工程 P2MP 隧道接口 |
|
指定接口 ID |
|
指定二十五千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定二百千兆以太网/IEEE 802.3 接口 |
|
指定接口 ID |
|
仅启用/禁用从候选列表的备份选择 选择
|
|
启用/禁用泛洪减少 选择
|
|
指定 HELLO 数据包之间的时间 |
|
配置接口关闭参数 选择
|
|
消息摘要身份验证密码(密钥) |
|
密钥 ID |
|
使用 MD5 算法 |
|
指定将跟随未加密的密码(密钥) 选择
|
|
指定将跟随加密的密码(密钥) 选择
|
|
OSPFv2 密码(密钥) |
|
启用/禁用 MPLS LDP 同步 选择
|
|
启用/禁用在 DBD 数据包中忽略 MTU 选择
|
|
指定邻居路由器 |
|
指定点对多点邻居的 OSPF 开销 |
|
指定在点对多点邻居的同步和泛洪期间过滤 OSPF LSA 选择
|
|
指定邻居地址(名称) |
|
指定 OSPF 死路由器轮询间隔 |
|
指定非广播邻居的 OSPF 优先级 |
|
指定网络类型 选择
|
|
自定义 OSPF 数据包大小,最大到 MTU |
|
启用/禁用被动模式 选择
|
|
禁止通告前缀 选择
|
|
指定路由器优先级 |
|
OSPF 进程的接口配置。 |
|
指定区域 ID |
|
OSPF 接口区域 ID,以十进制值表示。请参考供应商文档以获取有效值。 OSPF 接口区域 ID,以 IP 地址格式表示 (例如,A.B.C.D) |
|
OSPF 进程标签。 |
|
指定重传丢失的链路状态通告的时间间隔 |
|
启用安全 |
|
允许的最大 IP 跳数 <1-254> |
|
启用 TTL 安全 选择
|
|
指定发送链路状态更新数据包所需的估计时间 |
|
接口的名称/标识符。 |
|
接口类型。 |
|
此选项仅在状态为parsed时使用。 此选项的值应是通过执行命令 show running-config router ospf’ 从 IOS-XR 设备接收到的输出。 状态 parsed 从 |
|
配置应处于的状态。 选择
|
备注
注意
此模块使用
network_cli
连接。请参阅 IOS-XR 平台选项
示例
# Using merged
# Before state:
# -------------
#
# RP/0/RP0/CPU0:anton#show running-config router ospf
# % No such configuration item(s)
#
- name: Merge provided OSPF interfaces configuration with the existing configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/0
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: LAB3
area:
area_id: 0.0.0.3
cost: 20
authentication:
message_digest:
keychain: cisco
- afi: ipv6
processes:
- process_id: LAB3
area:
area_id: 0.0.0.2
cost: 30
state: merged
#
#
# Task Output:
# ------------
#
# before: []
#
# commands:
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 20
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest keychain cisco
# - router ospfv3 LAB3 area 0.0.0.2 interface GigabitEthernet 0/0/0/0 cost 30
#
# after:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: cisco
# cost: 20
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
#
# After state:
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:00:57.217 UTC
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospfv3 LAB3
# area 0.0.0.2
# interface GigabitEthernet0/0/0/0
# cost 30
# !
# !
# !
# Using replaced
#
# Before state:
# -------------
#
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:00:57.217 UTC
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospfv3 LAB3
# area 0.0.0.2
# interface GigabitEthernet0/0/0/0
# cost 30
# !
# !
# !
- name: Replace OSPF interfaces configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/0
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: LAB3
area:
area_id: 0.0.0.3
cost: 30
authentication:
message_digest:
keychain: ciscoiosxr
- afi: ipv6
processes:
- process_id: LAB3
area:
area_id: 0.0.0.2
cost: 30
state: replaced
#
# Task Output:
# ------------
#
# before:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: cisco
# cost: 20
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
#
# commands:
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 30
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest keychain ciscoiosxr
#
# after:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: ciscoiosxr
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
#
# After state:
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:10:39.827 UTC
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 30
# authentication message-digest keychain ciscoiosxr
# !
# router ospfv3 LAB3
# area 0.0.0.2
# interface GigabitEthernet0/0/0/0
# cost 30
# !
# !
# !
# Using overridden
#
# Before state
# ------------
#
- name: Override existing OSPF interfaces configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/1
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: LAB1
area:
area_id: 0.0.0.3
cost: 10
authentication:
message_digest:
keychain: iosxr
state: overridden
#
#
# Task Output:
# ------------
#
# before:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: ciscoiosxr
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
#
# commands:
# - no router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0
# - no router ospfv3 LAB3 area 0.0.0.2 interface GigabitEthernet 0/0/0/0
# - router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1 cost 10
# - router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1 authentication message-digest
# - router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1 authentication message-digest keychain iosxr
#
# after:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: iosxr
# cost: 10
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB1
# name: GigabitEthernet0/0/0/1
# type: gigabitethernet
#
# After state:
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:28:15.025 UTC
# router ospf LAB1
# area 0.0.0.3
# interface GigabitEthernet0/0/0/1
# cost 10
# authentication message-digest keychain iosxr
# !
# !
# !
# router ospf LAB3
# area 0.0.0.3
# !
# !
# router ospfv3 LAB3
# area 0.0.0.2
# !
# !
# Using deleted
#
# Before state:
# -------------
#
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:28:15.025 UTC
# router ospf LAB1
# area 0.0.0.3
# interface GigabitEthernet0/0/0/1
# cost 10
# authentication message-digest keychain iosxr
# !
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospfv3 LAB3
# area 0.0.0.2
# interface GigabitEthernet0/0/0/0
# cost 30
# !
# !
# !
- name: Deleted existing OSPF interfaces from the device
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/1
type: gigabitethernet
state: deleted
#
# Task Output:
# ------------
#
# before:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: iosxr
# cost: 10
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB1
# name: GigabitEthernet0/0/0/1
# type: gigabitethernet
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: cisco
# cost: 20
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
#
# commands:
# - no router ospf LAB1 area 0.0.0.3 interface GigabitEthernet 0/0/0/1]
#
# after:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: cisco
# cost: 20
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
#
# After state:
# ------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:34:38.319 UTC
# router ospf LAB1
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospfv3 LAB3
# area 0.0.0.2
# interface GigabitEthernet0/0/0/0
# cost 30
# !
# !
# !
# Using parsed
#
# parsed.cfg
# ------------
# router ospf LAB
# area 0.0.0.0
# !
# area 0.0.0.9
# !
# !
# router ospf LAB1
# area 0.0.0.1
# !
# area 0.0.0.3
# !
# !
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospf ipv4
# !
- name: Parsed running config and display structured facts.
cisco.iosxr.iosxr_ospf_interfaces:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
#
# Task Output:
# ------------
#
# parsed:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: cisco
# cost: 20
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
# Using rendered
#
- name: Render the commands for provided configuration
cisco.iosxr.iosxr_ospf_interfaces:
config:
- name: GigabitEthernet0/0/0/0
type: gigabitethernet
address_family:
- afi: ipv4
processes:
- process_id: LAB3
area:
area_id: 0.0.0.3
cost: 20
authentication:
message_digest:
keychain: cisco
- afi: ipv6
processes:
- process_id: LAB3
area:
area_id: 0.0.0.2
cost: 30
state: rendered
#
# Task Output:
# ------------
#
# rendered:
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 cost 20
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest
# - router ospf LAB3 area 0.0.0.3 interface GigabitEthernet 0/0/0/0 authentication message-digest keychain cisco
# - router ospfv3 LAB3 area 0.0.0.2 interface GigabitEthernet 0/0/0/0 cost 30
# Using gathered
#
# Before state:
# -------------
#
# RP/0/0/CPU0:an-iosxr-02#show running-config router ospf
# Thu Oct 23 06:50:38.743 UTC
# router ospf LAB3
# area 0.0.0.3
# interface GigabitEthernet0/0/0/0
# cost 20
# authentication message-digest keychain cisco
# !
# !
# !
# router ospfv3 LAB3
# area 0.0.0.2
# interface GigabitEthernet0/0/0/0
# cost 30
# !
# !
# !
- name: Gather ospf_interfaces routes configuration
cisco.iosxr.iosxr_ospf_interfaces:
state: gathered
#
# Task Output:
# ------------
#
# gathered:
# - address_family:
# - afi: ipv4
# authentication:
# message_digest:
# keychain: cisco
# cost: 20
# processes:
# - area:
# area_id: 0.0.0.3
# process_id: LAB3
# - afi: ipv6
# cost: 30
# processes:
# - area:
# area_id: 0.0.0.2
# process_id: LAB3
# name: GigabitEthernet0/0/0/0
# type: gigabitethernet
返回值
通用返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
生成的配置模型调用。 返回值: 当更改时 示例: |
|
模型调用之前的配置。 返回值: 总是返回 示例: |
|
推送到远程设备的命令集。 返回值: 总是返回 示例: |
|
从远程设备收集的关于网络资源的结构化数据的事实。 返回值: 当 state 为 示例: |
|
在 running_config 选项中提供的设备原生配置,根据模块 argspec 解析为结构化数据。 返回值: 当 state 为 示例: |
|
在任务中提供的配置,以设备原生格式渲染(离线)。 返回值: 当 state 为 示例: |