cisco.ios.ios_ospfv2 模块 – 用于配置 OSPFv2 的资源模块。
注意
此模块是 cisco.ios 集合(版本 9.0.3)的一部分。
如果您使用的是 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.ios
。
要在 playbook 中使用它,请指定:cisco.ios.ios_ospfv2
。
cisco.ios 1.0.0 中的新增功能
概要
此模块在 IOS 平台上配置和管理开放最短路径优先(OSPF)版本 2。
参数
参数 |
注释 |
---|---|
OSPF 选项的字典。 |
|
OSPF 实例配置的列表。 |
|
路由器地址族配置模式 |
|
将命令设置为其默认值 选择
|
|
修改 snmp 参数 配置 SNMP 上下文名称 |
|
将路由协议与拓扑实例关联 |
|
进入路由器拓扑子模式 选择
|
|
路由拓扑实例名称 |
|
配置路由协议拓扑 tid 请参考供应商文档以获取有效值 选择
|
|
配置控制邻接关系形成 |
|
允许形成的最大邻接关系数 请参考供应商文档以获取有效值 |
|
允许在区域中形成的初始邻接关系数 请参考供应商文档以获取有效值 |
|
无初始 选择
|
|
OSPF 区域参数 |
|
OSPF 区域 ID,为十进制值。请参考供应商文档以获取有效值。 OSPF 区域 ID,采用 IP 地址格式(例如 A.B.C.D) |
|
区域身份验证 |
|
启用区域身份验证 选择
|
|
使用 IPsec 身份验证 选择
|
|
启用区域特定功能 启用从基本拓扑中排除链接 选择
|
|
设置 NSSA/stub 区域的摘要默认成本 Stub 的通告外部路由指标 请参考供应商文档以获取相应的有效值 |
|
在 OSPF 区域之间过滤网络 |
|
应用于发送到此区域和从此区域发送的过滤网络的方向。 选择
|
|
IP 前缀列表的名称 |
|
指定 NSSA 区域 |
|
将类型 7 默认路由发起到 NSSA 区域 |
|
OSPF 默认指标 |
|
默认路由的 OSPF 指标类型 OSPF 链路状态类型 选择
|
|
将默认通告限制为此 NSSA 区域 选择
|
|
不要将域特定功能发送到 NSSA 选择
|
|
不重新分发到此 NSSA 区域 选择
|
|
不要将摘要 LSA 发送到 NSSA 选择
|
|
启用 NSSA 区域 选择
|
|
转换 LSA 始终在此 ABR 上转换 LSA 在转换后的 LSA 中禁止转发地址 选择
|
|
汇总与地址/掩码匹配的路由(仅限边界路由器) |
|
要匹配的 IP 地址 |
|
通告此范围(默认) 由于启用时通告不会显示在运行配置中,因此在 playbook 的第二次或下一次运行时,不会保持该 playbook 的幂等性。 选择
|
|
此范围的用户指定指标 |
|
地址的 IP 掩码 |
|
不通告此范围 选择
|
|
定义虚拟链路及其参数 |
|
将成本与虚拟链路关联 虚拟链路的成本 请参考供应商文档以获取相应的有效值 |
|
与虚拟链路目标关联的 IP 地址 (A.B.C.D) |
|
与虚拟链路源关联的 IP 地址 (A.B.C.D) |
|
TTL 安全检查 允许的最大 IP 跳数 |
|
指定 stub 区域 骨干网不能配置为 stub 区域 |
|
不要将域特定功能发送到 stub 区域 选择
|
|
不要将摘要 LSA 发送到 stub 区域 选择
|
|
启用 stub 区域 选择
|
|
根据带宽计算 OSPF 接口成本 |
|
使用参考带宽方法分配 OSPF 成本 请参考供应商文档以获取相应的有效值 |
|
启用 OSPF 自动成本 选择
|
|
BFD 配置命令 在所有接口上启用 BFD 选择
|
|
启用特定的 OSPF 功能 |
|
链路本地信令 (LLS) 支持 选择
|
|
不透明 LSA 选择
|
|
传输区域 选择
|
|
不执行 PE 特定检查 选择
|
|
OSPF 路由器兼容性列表 |
|
与 RFC 1583 兼容 选择
|
|
与 RFC 1587 兼容 选择
|
|
支持 DBD 交换优化 选择
|
|
控制默认信息的分配 |
|
始终通告默认路由 选择
|
|
OSPF 默认指标 请参考供应商文档以获取相应的有效值 |
|
默认路由的 OSPF 指标类型 请参考供应商文档以获取相应的有效范围 |
|
分配默认路由 选择
|
|
路由图参考名称 |
|
设置重新分发路由的指标 |
|
启用或禁用丢弃路由安装 |
|
丢弃重新分发汇总路由的路由 重新分发汇总路由的管理距离 请参考供应商文档以获取相应的有效范围 |
|
丢弃汇总内部路由的路由 汇总内部路由的管理距离 请参考供应商文档以获取相应的有效范围 |
|
启用丢弃路由安装 选择
|
|
定义管理距离 |
|
OSPF 管理距离 |
|
访问列表名称/编号 |
|
IP 源地址 |
|
管理距离 |
|
通配符位 |
|
OSPF 距离 |
|
外部类型 5 和类型 7 路由 |
|
区域间路由 |
|
区域内路由 |
|
在路由更新中过滤网络 |
|
IP 访问列表 |
|
过滤传入和传出的路由更新。 选择
|
|
接口配置(千兆以太网 A/B) 对传入流量有效 |
|
IP 访问列表名称/编号 |
|
协议配置(bgp 1)。 对传出流量有效 |
|
在路由更新中过滤前缀 |
|
过滤传入和传出的路由更新。 选择
|
|
用于根据网关过滤传入更新的网关名称 |
|
接口配置(千兆以太网 A/B) 对传入流量有效 |
|
IP 前缀列表的名称 |
|
协议配置(bgp 1)。 对传出流量有效 |
|
在路由更新中过滤前缀 |
|
路由映射名称 |
|
OSPF 域 ID |
|
IP 地址 |
|
IP 地址格式的 OSPF 域 ID |
|
辅助域 ID 选择
|
|
空域 ID 选择
|
|
OSPF 域标签,即 OSPF 域标签 - 32 位值 请参考供应商文档以获取相应的有效范围 |
|
事件日志记录 |
|
启用事件日志记录 选择
|
|
当日志缓冲区满时禁用日志记录 选择
|
|
暂停事件日志记录 选择
|
|
事件日志中存储的最大事件数 请参考供应商文档以获取相应的有效值 |
|
交互式帮助系统的描述 选择
|
|
不要抱怨特定事件 收到指定类型的 LSA(MOSPF 类型 6 LSA)时,不要抱怨 选择
|
|
接口 ID 的来源 SNMP MIB ifIndex 选择
|
|
启用增量 SPF 计算 选择
|
|
限制特定的 OSPF 功能以及 LS 更新、DBD 和 LS 请求重传 |
|
按需电路重传 |
|
禁用该功能 选择
|
|
最大重传次数 |
|
非按需电路重传 |
|
禁用该功能 选择
|
|
最大重传次数 |
|
启用或禁用将本地 RIB 用作路由标准 |
|
启用将本地 RIB 用作路由标准 选择
|
|
本地 RIB 用于验证外部/NSSA 转发地址 选择
|
|
本地 RIB 用作区域间摘要的标准 选择
|
|
本地 RIB 用作 NSSA 转换的标准 选择
|
|
记录邻接关系状态的变化 |
|
记录所有状态更改 选择
|
|
记录邻接关系状态的变化 选择
|
|
要接受的最大非自生成 LSA 数 |
|
可以抑制邻接关系的最大次数 请参考供应商文档以获取相应的有效值 |
|
所有邻接关系被抑制的分钟数 请参考供应商文档以获取相应的有效值 |
|
要接受的最大非自生成 LSA 数 请参考供应商文档以获取相应的有效值 |
|
忽略计数重置为零后的分钟数 请参考供应商文档以获取相应的有效值 |
|
生成警告消息的阈值 (%) 请参考供应商文档以获取相应的有效值 |
|
仅在超出限制时发出警告消息 选择
|
|
设置最大度量 |
|
使用最大度量值覆盖外部 LSA 度量 覆盖外部 LSA 中的度量 请参考供应商文档以获取相应的有效值 |
|
为路由器 LSA 中的存根链路设置最大度量 选择
|
|
在重新启动后临时设置最大度量 |
|
以秒为单位,路由器 LSA 以最大度量发起的时间 请参考供应商文档以获取相应的有效范围 |
|
让 BGP 决定何时使用正常度量发起路由器 LSA 选择
|
|
自生成的路由器 LSA 中的最大度量 选择
|
|
使用最大度量值覆盖摘要 LSA 度量 请参考供应商文档以获取相应的有效范围 |
|
通过多条路径转发数据包 路径数 |
|
配置 MPLS 路由协议参数 |
|
用于 MPLS LDP 的路由协议命令 |
|
用于 MPLS LDP 的路由协议命令 |
|
配置 OSPF 区域以运行 MPLS LDP |
|
配置 LDP 自动配置并设置配置 选择
|
|
配置 LDP-IGP 同步 选择
|
|
让 BGP 决定何时使用正常度量发起路由器 LSA |
|
配置 OSPF 区域以运行 MPLS 流量工程 OSPF 区域 ID,以十进制值或 IP 地址格式表示 |
|
MPLS TE 自动路由排除 根据 IP 前缀列表的名称过滤前缀 |
|
此 OSPF 进程的 MPLS TE 接口配置 |
|
将此接口的 MPLS TE 信息通告到区域中 OSPF 区域 ID,以十进制值表示 |
|
TE 接口配置(千兆以太网 A/B) |
|
流量工程网状组通告 |
|
将泛洪范围配置为区域 |
|
网状组 ID |
|
接口配置(千兆以太网 A/B) |
|
MPLS TE 和 PIM 交互 选择
|
|
路由器接口配置(千兆以太网 A/B) |
|
指定邻居路由器 |
|
邻居地址 (A.B.C.D) |
|
点对多点邻居度量的 OSPF 开销 请参考供应商文档以获取相应的有效范围 |
|
在点对多点邻居的同步和泛洪期间过滤 OSPF LSA 过滤所有传出的 LSA 选择
|
|
非广播邻居的 OSPF 死路由器轮询间隔(秒) |
|
非广播邻居优先级的 OSPF 优先级 |
|
在 IP 网络上启用路由 |
|
网络号 |
|
设置 OSPF 区域 ID |
|
OSPF 通配符位 |
|
不间断转发 |
|
思科不间断转发 |
|
禁用助手支持 选择
|
|
助手支持 选择
|
|
IETF 平滑重启 |
|
禁用助手支持 选择
|
|
助手支持 选择
|
|
启用助手严格 LSA 检查 选择
|
|
禁止在接口(千兆以太网 A/B)上进行路由更新 带有相应接口编号的接口名称 被动接口参数已弃用,并引入了具有附加功能的新参数 passive_interfaces,此属性将在 2026-07-18 之后删除。 |
|
禁止在接口上进行路由更新 |
|
禁止在所有接口上进行路由更新 选择
|
|
禁止/取消禁止在接口上进行路由更新 |
|
接口名称(千兆以太网 A/B) |
|
禁止/取消禁止路由更新 选择
|
|
启用前缀抑制 选择
|
|
OSPF 拓扑优先级 请参考供应商文档以获取相应的有效值 |
|
进程 ID |
|
Hello/路由器进程队列深度 |
|
OSPF Hello 进程队列深度 |
|
队列中的最大数据包数 |
|
无限队列深度 选择
|
|
OSPF 路由器进程队列深度 |
|
队列中的最大数据包数 |
|
无限队列深度 选择
|
|
此 OSPF 进程的路由器 ID 地址 IP 地址格式的 OSPF 路由器 ID (A.B.C.D) |
|
关闭路由器进程 选择
|
|
配置 IP 地址摘要 |
|
IP 摘要地址 |
|
IP 摘要掩码 |
|
不通告或转换 选择
|
|
将摘要限制为 NSSA 区域 选择
|
|
设置标签 |
|
调整路由计时器 |
|
OSPF LSA 计时器,到达计时器 接受同一 LSA 之间的最小间隔(毫秒) 请参考供应商文档以获取相应的有效值 |
|
OSPF 步调计时器 |
|
OSPF 泛洪步调计时器 限制接口上的泛洪的最小间隔(毫秒) 请参考供应商文档以获取相应的有效值 |
|
OSPF LSA 组步调计时器 刷新或最大化 LSA 组之间的间隔(秒) 请参考供应商文档以获取相应的有效值 |
|
OSPF 重传步调计时器 邻居重传之间的最小间隔(毫秒) 请参考供应商文档以获取相应的有效值 |
|
OSPF 节流计时器 |
|
OSPF LSA 节流计时器 |
|
生成 LSA 首次出现时的延迟(毫秒) 请参考供应商文档以获取相应的有效值 |
|
发起同一 LSA 之间的最大延迟(毫秒) 请参考供应商文档以获取相应的有效值 |
|
发起同一 LSA 之间的最小延迟(毫秒) 请参考供应商文档以获取相应的有效值 |
|
OSPF SPF 节流计时器 - 接收 SPF 计算更改之间的延迟(毫秒)- 注意,有关相应的有效值,请参阅供应商文档 |
|
第一次和第二次 SPF 计算之间的延迟(毫秒) 请参考供应商文档以获取相应的有效值 |
|
SPF 计算的最大等待时间(毫秒) 请参考供应商文档以获取相应的有效值 |
|
接收 SPF 计算更改之间的延迟(毫秒) 请参考供应商文档以获取相应的有效值 |
|
如何计算备用路径上的流量共享 所有流量在最小度量路径之间共享 为等成本路径使用不同的接口 选择
|
|
TTL 安全检查 |
|
允许的最大 IP 跳数 请参考供应商文档以获取相应的有效值 |
|
在所有接口上启用 TTL 安全 选择
|
|
为 VPN 路由/转发实例指定参数 |
|
此选项仅用于状态已解析。 此选项的值应是通过执行命令 sh running-config | section ^router ospf 从 IOS 设备收到的输出。 状态已解析从 |
|
配置应保留的状态 状态已呈现、已收集和已解析不会对设备执行任何更改。 状态已呈现将 状态已收集将从设备获取运行配置,并将其转换为与资源模块 argspec 一致的格式的结构化数据,该值在结果中的 gathered 键中返回。 状态已解析从 选择
|
注释
注意
针对 CML 上的 Cisco IOSXE 版本 17.3 进行了测试。
此模块与连接
network_cli
一起使用。请参阅 https://docs.ansible.org.cn/ansible/latest/network/user_guide/platform_ios.html
示例
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router-ios#
- name: Merge provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
areas:
- area_id: "5"
capability: true
authentication:
enable: true
- area_id: "10"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
default_cost: 10
filter_list:
- name: test_prefix_in
direction: in
- name: test_prefix_out
direction: out
network:
- address: 198.51.100.0
wildcard_bits: 0.0.0.255
area: 5
default_information:
originate: true
passive_interfaces:
default: true
interface:
set_interface: false
name:
- GigabitEthernet0/1
- GigabitEthernet0/2
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.3.1
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
areas:
- area_id: "10"
capability: true
distribute_list:
acls:
- name: 10
direction: out
- name: 123
direction: in
state: merged
# Task Output:
# ------------
# before: {}
# commands:
# - router ospf 200 vrf blue
# - auto-cost reference-bandwidth 4
# - domain-id 192.0.3.1
# - max-metric router-lsa on-startup 100
# - area 10 capability default-exclusion
# - distribute-list 10 out
# - distribute-list 123 in
# - router ospf 1
# - default-information originate
# - max-metric router-lsa on-startup 110
# - area 5 capability default-exclusion
# - area 10 authentication message-digest
# - area 10 default-cost 10
# - area 10 nssa default-information-originate metric 10
# - area 10 nssa translate type7 suppress-fa
# - area 10 filter-list prefix test_prefix_in in
# - area 10 filter-list prefix test_prefix_out out
# - network 198.51.100.0 0.0.0.255 area 5
# - passive-interface default
# - no passive-interface GigabitEthernet0/1
# - no passive-interface GigabitEthernet0/2
# after:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '5'
# capability: true
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: in
# name: test_prefix_in
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# passive_interfaces:
# default: true
# interface:
# name:
# - GigabitEthernet2
# - GigabitEthernet1
# set_interface: false
# process_id: 1
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# passive-interface default
# no passive-interface GigabitEthernet1
# no passive-interface GigabitEthernet2
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# passive-interface default
# no passive-interface GigabitEthernet1
# no passive-interface GigabitEthernet2
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Replace running config with provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.4.1
max_metric:
router_lsa: true
on_startup:
time: 200
maximum_paths: 15
ttl_security:
hops: 7
areas:
- area_id: "10"
default_cost: 10
authentication:
message_digest: true
- process_id: 100
vrf: ospf_vrf
domain_id:
ip_address:
address: 192.0.5.1
auto_cost:
reference_bandwidth: 5
areas:
- area_id: "5"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
state: replaced
# Task Output:
# ------------
#
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '5'
# capability: true
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: in
# name: test_prefix_in
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# passive_interfaces:
# default: true
# interface:
# name:
# - GigabitEthernet2
# - GigabitEthernet1
# set_interface: false
# process_id: 1
#
# commands:
# - router ospf 100 vrf ospf_vrf
# - auto-cost reference-bandwidth 5
# - domain-id 192.0.5.1
# - area 5 authentication message-digest
# - area 5 nssa translate type7 suppress-fa
# - area 5 nssa default-information-originate metric 10
# - router ospf 200 vrf blue
# - no auto-cost reference-bandwidth 4
# - no distribute-list 10 out
# - no distribute-list 123 in
# - domain-id 192.0.4.1
# - max-metric router-lsa on-startup 200
# - maximum-paths 15
# - ttl-security all-interfaces hops 7
# - area 10 authentication message-digest
# - no area 10 capability default-exclusion
# - area 10 default-cost 10
# ]
#
# after:
# processes:
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# domain_id:
# ip_address:
# address: 192.0.4.1
# max_metric:
# on_startup:
# time: 200
# router_lsa: true
# maximum_paths: 15
# process_id: 200
# ttl_security:
# hops: 7
# vrf: blue
# - areas:
# - area_id: '5'
# authentication:
# message_digest: true
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# auto_cost:
# reference_bandwidth: 5
# set: true
# domain_id:
# ip_address:
# address: 192.0.5.1
# process_id: 100
# vrf: ospf_vrf
# - areas:
# - area_id: '5'
# authentication:
# enable: true
# capability: true
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: in
# name: test_prefix_in
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
# After state:
# -------------
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.4.1
# max-metric router-lsa on-startup 200
# ttl-security all-interfaces hops 7
# area 10 authentication message-digest
# area 10 default-cost 10
# maximum-paths 15
# router ospf 100 vrf ospf_vrf
# domain-id 192.0.5.1
# auto-cost reference-bandwidth 5
# area 5 authentication message-digest
# area 5 nssa default-information-originate metric 10
# area 5 nssa translate type7 suppress-fa
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 5 authentication
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Override provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.4.1
max_metric:
router_lsa: true
on_startup:
time: 200
maximum_paths: 15
ttl_security:
hops: 7
areas:
- area_id: "10"
default_cost: 10
authentication:
message_digest: true
- process_id: 100
vrf: ospf_vrf
domain_id:
ip_address:
address: 192.0.5.1
auto_cost:
reference_bandwidth: 5
areas:
- area_id: "5"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
state: overridden
# Task Output:
# ------------
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
#
# commands:
# - no router ospf 1
# - router ospf 100 vrf ospf_vrf
# - auto-cost reference-bandwidth 5
# - domain-id 192.0.5.1
# - area 5 authentication message-digest
# - area 5 nssa translate type7 suppress-fa
# - area 5 nssa default-information-originate metric 10
# - router ospf 200 vrf blue
# - no auto-cost reference-bandwidth 4
# - no distribute-list 10 out
# - no distribute-list 123 in
# - domain-id 192.0.4.1
# - max-metric router-lsa on-startup 200
# - maximum-paths 15
# - ttl-security all-interfaces hops 7
# - area 10 authentication message-digest
# - no area 10 capability default-exclusion
# - area 10 default-cost 10
#
# after:
# processes:
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# domain_id:
# ip_address:
# address: 192.0.4.1
# max_metric:
# on_startup:
# time: 200
# router_lsa: true
# maximum_paths: 15
# process_id: 200
# ttl_security:
# hops: 7
# vrf: blue
# - areas:
# - area_id: '5'
# authentication:
# message_digest: true
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# auto_cost:
# reference_bandwidth: 5
# set: true
# domain_id:
# ip_address:
# address: 192.0.5.1
# process_id: 100
# vrf: ospf_vrf
#
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.4.1
# max-metric router-lsa on-startup 200
# ttl-security all-interfaces hops 7
# area 10 authentication message-digest
# area 10 default-cost 10
# maximum-paths 15
# router ospf 100 vrf ospf_vrf
# domain-id 192.0.5.1
# auto-cost reference-bandwidth 5
# area 5 authentication message-digest
# area 5 nssa default-information-originate metric 10
# area 5 nssa translate type7 suppress-fa
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Delete provided OSPF V2 processes
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
- process_id: 200
vrf: blue
state: deleted
# Task Output:
# ------------
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
#
# commands:
# - no router ospf 1
#
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
#
# After state:
# ------------
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# Using deleted without any config passed (NOTE: This will delete all OSPFV2 configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Delete all OSPF processes
cisco.ios.ios_ospfv2:
state: deleted
# Task Output:
# ------------
# before:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
#
# commands:
# - no router ospf 200 vrf blue
# - no router ospf 1
#
# after: {}
#
# After state:
# ------------
# router-ios#sh running-config | section ^router ospf
# router-ios#
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Gather OSPFV2 running configurations
cisco.ios.ios_ospfv2:
config:
state: gathered
# Task Output:
# ------------
#
# gathered:
# processes:
# - areas:
# - area_id: '10'
# capability: true
# auto_cost:
# reference_bandwidth: 4
# set: true
# distribute_list:
# acls:
# - direction: out
# name: '10'
# - direction: in
# name: '123'
# domain_id:
# ip_address:
# address: 192.0.3.1
# max_metric:
# on_startup:
# time: 100
# router_lsa: true
# process_id: 200
# vrf: blue
# - areas:
# - area_id: '10'
# authentication:
# message_digest: true
# default_cost: 10
# filter_list:
# - direction: out
# name: test_prefix_out
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# default_information:
# originate: true
# max_metric:
# on_startup:
# time: 110
# router_lsa: true
# network:
# - address: 198.51.100.0
# area: '5'
# wildcard_bits: 0.0.0.255
# process_id: 1
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
areas:
- area_id: "5"
capability: true
authentication:
enable: true
- area_id: "10"
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
default_cost: 10
filter_list:
- name: test_prefix_in
direction: in
- name: test_prefix_out
direction: out
network:
- address: 198.51.100.0
wildcard_bits: 0.0.0.255
area: 5
default_information:
originate: true
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.3.1
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
areas:
- area_id: "10"
capability: true
distribute_list:
acls:
- name: 10
direction: out
- name: 123
direction: in
state: rendered
# Task Output:
# ------------
# rendered:
# - router ospf 200 vrf blue
# - auto-cost reference-bandwidth 4
# - distribute-list 10 out
# - distribute-list 123 in
# - domain-id 192.0.3.1
# - max-metric router-lsa on-startup 100
# - area 10 capability default-exclusion
# - router ospf 1
# - default-information originate
# - max-metric router-lsa on-startup 110
# - network 198.51.100.0 0.0.0.255 area 5
# - area 10 authentication message-digest
# - area 10 default-cost 10
# - area 10 nssa translate type7 suppress-fa
# - area 10 nssa default-information-originate metric 10
# - area 10 filter-list prefix test_prefix_out out
# - area 10 filter-list prefix test_prefix_in in
# - area 5 authentication
# - area 5 capability default-exclusion
#
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router ospf 100
# auto-cost reference-bandwidth 5
# domain-id 192.0.5.1
# area 5 authentication message-digest
# area 5 nssa translate type7 suppress-fa
# area 5 nssa default-information-originate metric 10
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_ospfv2:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Task Output:
# ------------
# parsed:
# processes:
# - areas:
# - area_id: '5'
# authentication:
# message_digest: true
# nssa:
# default_information_originate:
# metric: 10
# translate: suppress-fa
# auto_cost:
# reference_bandwidth: 5
# set: true
# domain_id:
# ip_address:
# address: 192.0.5.1
# process_id: 100
返回值
常见的返回值记录在 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
生成的配置模型调用。 返回:当更改时 示例: |
|
模型调用之前的配置。 返回: 总是 示例: |
|
推送到远程设备的命令集。 返回: 总是 示例: |
|
从远程设备收集的关于网络资源的结构化数据的事实。 返回: 当state为 示例: |
|
根据模块参数规范,将running_config选项中提供的设备原生配置解析为结构化数据。 返回: 当state为 示例: |
|
任务中提供的配置以设备原生格式渲染(离线)。 返回: 当state为 示例: |