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 间隔 |
|
检测乘数 |
|
指定接口成本 |
|
当累积带宽低于阈值时指定成本 |
|
根据累积带宽指定成本 |
|
应用 cost-fallback 时的阈值带宽 |
|
在同步和泛洪期间过滤 OSPF LSA。 |
|
过滤所有传出的 LSA 选项
|
|
指定声明邻居失效后的间隔 |
|
启用/禁用按需电路 选项
|
|
指定 IP 快速重路由 |
|
禁用 IP 快速重路由 选项
|
|
指定每前缀计算 |
|
指定每链路 LFA 排除或 FRR LFA 候选信息 选项
|
|
指定每链路 LFA 排除信息 |
|
指定聚合以太网接口 |
|
指定接口 ID |
|
指定桥接组虚拟接口 |
|
指定接口 ID |
|
指定 FastEthernet/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 FiftyGigE/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 FortyGigE/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 FourHundredGigE/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 GigabitEthernet/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 HundredGigE/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 MgmtEth/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定多链路网络接口 |
|
指定接口 ID |
|
指定网络虚拟化端点接口 |
|
指定接口 ID |
|
指定聚合 pos 接口 |
|
指定接口 ID |
|
指定 PWHE 以太网接口 |
|
指定接口 ID |
|
指定 PWHE VC11 IP 互通接口 |
|
指定接口 ID |
|
指定串行网络接口 |
|
指定接口 ID |
|
指定 SRP 接口 |
|
指定接口 ID |
|
指定 TenGigabitEthernet/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 GRE/IPinIP 隧道接口 |
|
指定接口 ID |
|
指定 IPSec 隧道接口 |
|
指定接口 ID |
|
MPLS 传输协议隧道接口 |
|
指定接口 ID |
|
指定 MPLS 交通工程 P2MP 隧道接口 |
|
指定接口 ID |
|
指定 TwentyFiveGigabitEthernet/IEEE 802.3 接口 |
|
指定接口 ID |
|
指定 TwoHundredGigE/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* 为 示例: |
|
根据模块argspec将 *running_config* 选项中提供的设备原生配置解析为结构化数据。 返回:当 *state* 为 示例: |
|
以设备原生格式(离线)呈现任务中提供的配置。 返回:当 *state* 为 示例: |