dellemc.enterprise_sonic.sonic_ospfv2_interfaces 模块 – 在 SONiC 上配置 OSPFv2 接口模式协议设置。
注意
此模块是 dellemc.enterprise_sonic 集合(版本 2.5.1)的一部分。
如果您使用的是 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install dellemc.enterprise_sonic。
要在 playbook 中使用它,请指定:dellemc.enterprise_sonic.sonic_ospfv2_interfaces。
dellemc.enterprise_sonic 2.5.0 中的新增功能
概要
- 此模块提供在运行 SONiC 的设备上对 OSPFv2 接口模式参数进行配置管理。 
- 在 VRF 中配置 OSPF 之前,先配置 VRF 实例。 
- 在接口中配置 OSPF 之前,先配置 OSPF 实例。 
参数
| 参数 | 注释 | 
|---|---|
| 指定 OSPFv2 接口配置。 | |
| 配置 OSPFv2 接口 BFD。 | |
| 配置 BFD 配置文件。 | |
| 为 OSPFv2 启用 BFD 支持。 选择 
 | |
| 接口的全名,即 Ethernet1。 | |
| 配置 OSPFv2 接口网络类型 选择 
 | |
| 指定接口的 OSPFv2 配置。 如果未指定 address,则考虑接口的 IPv4 地址。 dead_interval 和 hello_multiplier 是互斥的。 | |
| 指定接口 IPv4 地址。 | |
| 网络的 OSPFv2 区域 ID(A.B.C.D 或 0 到 4294967295)。 | |
| 配置 OSPFv2 纯文本身份验证类型密码。 身份验证密钥的最大长度应为 8 个字符。 | |
| 指示密码是否为加密格式。 选择 
 | |
| 指定身份验证密码。 纯文本密码(即 encrypted=false 的密码)将以加密格式存储在运行配置中,因此不会保持幂等性,因此任务输出将始终为 changed=true。 | |
| 启用 OSPFv2 身份验证及其类型。 
 
 
 选择 
 | |
| 配置 OSPFv2 接口成本(1 到 65535)。 | |
| 配置 OSPFv2 邻接死间隔(1 到 65535)。 | |
| 配置 OSPFv2 邻居 Hello 间隔(1 到 65535)。 | |
| 最小 1 秒死间隔,具有快速亚秒级 Hello。 每秒发送的 Hello 数量(1 到 10)。 | |
| 配置 OSPFv2 消息摘要密钥和密码。 使用 MD5 算法。 | |
| 指示密码是否为加密格式。 选择 
 | |
| 指定 OSPFv2 消息摘要密钥 ID(1 到 255)。 | |
| 指定 OSPFv2 消息摘要密码。 纯文本密码(即 encrypted=false 的密码)将以加密格式存储在运行配置中,因此不会保持幂等性,因此任务输出将始终为 changed=true。 | |
| 禁用 OSPFv2 MTU 不匹配检测。 选择 
 | |
| 配置 OSPFv2 邻接路由器优先级(0 到 255)。 | |
| 配置 OSPFv2 重传间隔(2 到 65535)。 | |
| 配置 OSPFv2 传输延迟(1 到 65535)。 | |
| 指定要在设备上配置的 OSPFv2 接口上执行的操作。 在合并的情况下,输入配置将与设备上现有的 OSPFv2 接口配置合并。 在删除的情况下,现有的 OSPFv2 接口配置将从设备中删除。 在覆盖的情况下,所有现有的 OSPFv2 接口配置都将被删除,并且将安装指定的输入配置。 在替换的情况下,设备上现有的 OSPFv2 接口配置将由 playbook 中为 playbook 配置的每个接口组的配置替换。 选择 
 | 
注释
注意
- 支持 - check_mode。
示例
# Using deleted
# Before state:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network point-to-point
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1/Ml24vwe6RSjUUqI+54BdDyDL0eKUezJw= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
#!
#interface Eth1/2
# ip ospf bfd
# ip ospf network point-to-point
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
  - name: Delete the OSPFv2_interface configurations
    sonic_ospfv2_interfaces:
      config:
        - name: 'Eth1/1'
          ospf_attributes:
            - area_id: '2.2.2.2'
              cost: 30
              priority: 20
              hello_interval: 10
              dead_interval: 40
              mtu_ignore: True
            - address: '10.10.120.1'
              authentication_type: 'NONE'
              authentication:
                password: 'pass2'
            - address: '10.19.119.1'
          bfd:
            enable: True
            bfd_profile: 'profile2'
          network: point_to_point
        - name: 'Eth1/2'
          bfd:
            enable: True
        - name: 'Eth1/3'
      state: deleted
# After state:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
#!
#interface Eth1/2
# ip ospf network point-to-point
#!
#interface Eth1/3
#!
#sonic#
# Using deleted
# Before state:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network point-to-point
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1/Ml24vwe6RSjUUqI+54BdDyDL0eKUezJw= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
#!
#interface Eth1/2
# ip ospf bfd
# ip ospf network point-to-point
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
  - name: Delete the OSPFv2_interface configurations
    sonic_ospfv2_interfaces:
      config:
        - name: 'Eth1/1'
        - name: 'Eth1/2'
          bfd:
            enable: True
        - name: 'Eth1/3'
      state: deleted
# After state:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
#!
#interface Eth1/2
# ip ospf network point-to-point
#!
#interface Eth1/3
#!
#sonic#
# Using merged
# Before state:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
#!
#interface Eth1/2
#!
#interface Eth1/3
#!
#sonic#
  - name: Add the OSPFv2_interface configurations
    sonic_ospfv2_interfaces:
      config:
        - name: 'Eth1/1'
          ospf_attributes:
            - area_id: '2.2.2.2'
              cost: 20
              priority: 20
              hello_interval: 10
              dead_interval: 40
              mtu_ignore: True
            - address: '10.10.120.1'
              authentication_type: 'MD5HMAC'
              authentication:
                password: 'password'
              hello_multiplier: 5
          bfd:
            enable: True
            bfd_profile: 'profile1'
          network: broadcast
        - name: 'Eth1/3'
          ospf_attributes:
            - area_id: '3.3.3.3'
              address: '10.19.120.2'
              authentication_type: 'MD5HMAC'
              authentication:
                password: 'password'
              hello_multiplier: 5
          bfd:
            enable: True
          network: point_to_point
      state: merged
# After state:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
#!
#interface Eth1/2
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
# Using merged
# Before state:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
#!
#interface Eth1/2
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
  - name: Add the OSPFv2_interface configurations
    sonic_ospfv2_interfaces:
      config:
        - name: 'Eth1/1'
          ospf_attributes:
            - area_id: '2.2.2.2'
              cost: 30
              priority: 20
              hello_interval: 10
              dead_interval: 40
              mtu_ignore: True
            - address: '10.10.120.1'
              authentication_type: 'NONE'
              authentication:
                password: 'pass2'
            - address: '10.19.119.1'
              authentication_type: 'NONE'
              md_authentication:
                - key_id: 10
                  md5key: 'U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ='
                  encrypted: True
          bfd:
            enable: True
            bfd_profile: 'profile2'
          network: point_to_point
        - name: 'Eth1/2'
          bfd:
            enable: True
          network: point_to_point
      state: merged
# After state:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network point-to-point
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1/Ml24vwe6RSjUUqI+54BdDyDL0eKUezJw= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
#!
#interface Eth1/2
# ip ospf bfd
# ip ospf network point-to-point
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
# Using replaced
# Before state:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
#!
#interface Eth1/2
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
  - name: Replace the OSPFv2_interface configurations
    sonic_ospfv2_interfaces:
      config:
        - name: 'Eth1/3'
          ospf_attributes:
            - area_id: '2.2.2.2'
              cost: 30
              priority: 20
              hello_interval: 10
              dead_interval: 40
              mtu_ignore: True
            - address: '10.10.120.1'
              authentication_type: 'NONE'
              authentication:
                password: 'pass2'
            - address: '10.19.119.1'
              authentication_type: 'NONE'
              md_authentication:
                - key_id: 10
                  md5key: 'U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ='
                  encrypted: True
          bfd:
            enable: True
            bfd_profile: 'profile2'
          network: broadcast
      state: replaced
# After state:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
#!
#interface Eth1/2
#!
#interface Eth1/3
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX186k2R2hUXaDloW8hfkApn5Zx5hCQy9usc= encrypted 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
#!
#sonic#
# Using overridden
# Before state:
# -------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile1
# ip ospf cost 20
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication message-digest 10.10.120.1
# ip ospf authentication-key U2FsdGVkX1+ozJSEI69XJb2KR9Pu1Sa3Ou6ujTRalbQ= encrypted 10.10.120.1
# ip ospf dead-interval minimal hello-multiplier 5 10.10.120.1
#!
#interface Eth1/2
#!
#interface Eth1/3
# ip ospf bfd
# ip ospf network point-to-point
# ip ospf area 3.3.3.3 10.19.120.2
# ip ospf authentication message-digest 10.19.120.2
# ip ospf authentication-key U2FsdGVkX19HqGCcf2pzGur9MDnb0VzLNRvoFij3Os0= encrypted 10.19.120.2
# ip ospf dead-interval minimal hello-multiplier 5 10.19.120.2
#!
#sonic#
  - name: Override the OSPFv2_interface configurations
    sonic_ospfv2_interfaces:
      config:
        - name: 'Eth1/3'
          ospf_attributes:
            - area_id: '2.2.2.2'
              cost: 30
              priority: 20
              hello_interval: 10
              dead_interval: 40
              mtu_ignore: True
            - address: '10.10.120.1'
              authentication_type: 'NONE'
              authentication:
                password: 'pass2'
            - address: '10.19.119.1'
              authentication_type: 'NONE'
              md_authentication:
                - key_id: 10
                  md5key: 'U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ='
                  encrypted: True
          bfd:
            enable: True
            bfd_profile: 'profile2'
          network: broadcast
      state: overridden
# After state:
# ------------
#
#sonic# show running-configuration interface
#!
#interface Eth1/1
#!
#interface Eth1/2
#!
#interface Eth1/3
# ip ospf area 2.2.2.2
# ip ospf bfd
# ip ospf bfd profile profile2
# ip ospf cost 30
# ip ospf dead-interval 40
# ip ospf hello-interval 10
# ip ospf mtu-ignore
# ip ospf network broadcast
# ip ospf priority 20
# ip ospf authentication null 10.10.120.1
# ip ospf authentication-key U2FsdGVkX186k2R2hUXaDloW8hfkApn5Zx5hCQy9usc= encrypted 10.10.120.1
# ip ospf authentication null 10.19.119.1
# ip ospf message-digest-key 10 md5 U2FsdGVkX1/Bq/+x8a3fsBo9ZrAX56ynmPKnRM87kfQ= encrypted 10.19.119.1
#!
#sonic#
返回值
通用返回值记录在此处,以下是此模块独有的字段
| 键 | 描述 | 
|---|---|
| 生成的配置模型调用。 返回:当更改时 示例:  | |
| 生成的配置模型调用。 返回:当  示例:  | |
| 模型调用之前的配置。 返回:始终 示例:  | |
| 推送到远程设备的命令集。 返回:始终 示例:  | 
