cisco.nxos.nxos_nve_interface module – NVE interface resource module.

Note

This module is part of the cisco.nxos collection (version 14.0.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.nxos.

To use it in a playbook, specify: cisco.nxos.nxos_nve_interface.

New in cisco.nxos 13.1.0

Synopsis

  • This module provides declarative management of Network Virtualization Endpoint (NVE) overlay interface that terminates VXLAN tunnels.

Note

This module has a corresponding action plugin.

Aliases: nve_interface

Parameters

Parameter

Comments

config

dictionary

A List of NVE interface options.

advertise_virtual_rmac

boolean

Enable/disable virtual RMAC advertisement

Choices:

  • false

  • true

description

string

Interface description

enabled

boolean

Administrative state of the interface. Set the value to true to administratively enable the interface or false to disable it.

Choices:

  • false

  • true

global_ingress_replication_bgp

boolean

Enable/disable global bgp ingress replication

Choices:

  • false

  • true

global_multicast_group

dictionary

Global multicast group.

On NX-OS 10.6(4) a group with mode L3 is accepted but never shown in the running-config, so it cannot be gathered and is configured again on every run. The L2 mode is not affected.

address

string

Multicast address

mode

string / required

VNI type.

Choices:

  • "L2"

  • "L3"

global_suppress_arp

boolean

Enable/disable global ARP suppression

Choices:

  • false

  • true

host_reachability_bgp

boolean

Enable/disable host reachability with bgp

Choices:

  • false

  • true

multisite_interface

string

Multisite border gateway source interface

source_interface_hold_time

integer

Source loopback interface hold-down-time in seconds

source_interface_name

string

Source loopback interface name

vnis

list / elements=dictionary

Configure Virtual Network Identifier membership

associate_vrf

boolean

Associate L3VNI with VRF

Choices:

  • false

  • true

ingress_replication_bgp

boolean

Enable/disable bgp ingress replication for L2VNI

Mutually exclusive with mcast_group.

Choices:

  • false

  • true

mcast_group

dictionary

Multicast group used for BUM traffic of this VNI (mcast-group).

Mutually exclusive with ingress_replication_bgp.

With state merged, setting this option removes a configured ingress_replication_bgp from the VNI (and vice versa).

address

string / required

Multicast group address.

secondary_address

string

Optional second multicast group address accepted by mcast-group.

Accepted by the CLI of NX-OS 10.6(4) on N9K-C93180YC-FX without an error but not applied there, so it is not covered by the integration tests.

multisite_ingress_replication

boolean

Enable/disable multisite ingress replication for L2VNI

Choices:

  • false

  • true

suppress_arp

boolean

Enable/disable ARP suppression for L2VNI

Mutually exclusive with suppress_arp_disable when both are true.

Choices:

  • false

  • true

suppress_arp_disable

boolean

Disable/enable the global setting for ARP suppression for L2VNI

Mutually exclusive with suppress_arp when both are true.

Choices:

  • false

  • true

vni_id

integer / required

Virtual Network Identifier ID

Valid range is 1-16777214.

running_config

string

This option is used only with state parsed.

The value of this option should be the output received from the NX-OS device by executing the command show running-config | section “^interface nve1”.

The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module’s argspec and the value is then returned in the parsed key within the result.

state

string

The state of the configuration after module completion.

States replaced and overridden have the same behaviour for this module.

With state deleted and no config, the whole interface nve1 is removed.

With state deleted and an config, only the listed vnis and the listed top-level attributes that are configured on the device are removed. Other VNIs and attributes, and the interface itself, are left in place.

Choices:

  • "merged" ← (default)

  • "replaced"

  • "overridden"

  • "deleted"

  • "parsed"

  • "gathered"

  • "rendered"

Notes

Note

  • Tested against NXOS 10.3(7)

  • Tested against NX-OS 10.6(4) on N9K-C93180YC-FX

  • Unsupported for Cisco MDS

  • suppress_arp needs the ARP-Ether ACL TCAM region (hardware access-list tcam region arp-ether) to be carved, which requires a reload. Devices without it reject the command.

  • Only the interface nve1 interface is managed.

  • Within a VNI, suppress-arp and suppress-arp disable are alternatives, as are mcast-group and ingress-replication protocol bgp. The module fails if both options of such a pair are true (or, for mcast_group, set) in the task.

  • cisco.nxos.nxos_vxlan_vtep and cisco.nxos.nxos_vxlan_vtep_vni manage an overlapping part of the same interface nve1 configuration. Prefer this module for whole-interface, declarative management (including replaced, overridden and gathered). Do not manage the same NVE settings with both this module and the older modules in one play.

Examples

# Using merged

# Before state:
# -------------
# switch# show running-config | section "^interface nve1"
# switch#

- name: Merge the provided NVE configuration with the existing running configuration.
  cisco.nxos.nxos_nve_interface:
    config:
      enabled: true
      description: vxlan vtep
      advertise_virtual_rmac: true
      host_reachability_bgp: true
      source_interface_name: loopback1
      source_interface_hold_time: 60
      global_multicast_group:
        address: 233.252.0.20
        mode: L2
      vnis:
        - associate_vrf: true
          vni_id: 11111
        - associate_vrf: false
          vni_id: 22222
        - suppress_arp: true
          vni_id: 33333
        - vni_id: 44444
          mcast_group:
            address: 233.252.0.10
    state: merged

# Task output:
# ------------
# before: {}
#
# commands:
#   - interface nve1
#   - description vxlan vtep
#   - host-reachability protocol bgp
#   - advertise virtual-rmac
#   - source-interface loopback1
#   - source-interface hold-down-time 60
#   - member vni 11111 associate-vrf
#   - member vni 22222
#   - member vni 33333
#   - suppress-arp
#   - member vni 44444
#   - mcast-group 233.252.0.10
#   - no shutdown
#   - global mcast-group 233.252.0.20 L2
#
# after:
#   enabled: true
#   description: vxlan vtep
#   advertise_virtual_rmac: true
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#   source_interface_hold_time: 60
#   global_multicast_group:
#     address: 233.252.0.20
#     mode: L2
#   vnis:
#     - associate_vrf: true
#       vni_id: 11111
#     - vni_id: 22222
#     - suppress_arp: true
#       vni_id: 33333
#     - vni_id: 44444
#       mcast_group:
#         address: 233.252.0.10
#
# After state:
# ------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   description vxlan vtep
#   host-reachability protocol bgp
#   advertise virtual-rmac
#   source-interface loopback1
#   source-interface hold-down-time 60
#   global mcast-group 233.252.0.20 L2
#   member vni 11111 associate-vrf
#   member vni 22222
#   member vni 33333
#     suppress-arp
#   member vni 44444
#     mcast-group 233.252.0.10


# Using gathered

# Existing config:
# ---------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   description vxlan vtep
#   host-reachability protocol bgp
#   advertise virtual-rmac
#   source-interface loopback1
#   source-interface hold-down-time 60
#   global mcast-group 233.252.0.20 L2
#   member vni 11111 associate-vrf
#   member vni 22222
#   member vni 33333
#     suppress-arp

- name: Gather NVE interface facts using gathered
  cisco.nxos.nxos_nve_interface:
    state: gathered

# Task output:
# ------------
# gathered:
#   enabled: true
#   description: vxlan vtep
#   advertise_virtual_rmac: true
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#   source_interface_hold_time: 60
#   global_multicast_group:
#     address: 233.252.0.20
#     mode: L2
#   vnis:
#     - associate_vrf: true
#       vni_id: 11111
#     - vni_id: 22222
#     - suppress_arp: true
#       vni_id: 33333


# Using overridden

# Before state:
# -------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   description vxlan vtep
#   host-reachability protocol bgp
#   advertise virtual-rmac
#   source-interface loopback1
#   source-interface hold-down-time 60
#   global mcast-group 233.252.0.20 L2
#   member vni 11111 associate-vrf
#   member vni 22222
#   member vni 33333
#     suppress-arp

- name: Override NVE interface configuration with provided configuration.
  cisco.nxos.nxos_nve_interface:
    config:
      enabled: true
      advertise_virtual_rmac: true
      host_reachability_bgp: true
      source_interface_name: loopback1
      global_multicast_group:
        address: 233.252.0.30
        mode: L2
      vnis:
        - associate_vrf: false
          ingress_replication_bgp: true
          suppress_arp: true
          vni_id: 11111
        - associate_vrf: true
          vni_id: 22222
        - associate_vrf: true
          vni_id: 33333
    state: overridden

# Task output:
# ------------
# before:
#   enabled: true
#   description: vxlan vtep
#   advertise_virtual_rmac: true
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#   source_interface_hold_time: 60
#   global_multicast_group:
#     address: 233.252.0.20
#     mode: L2
#   vnis:
#     - associate_vrf: true
#       vni_id: 11111
#     - vni_id: 22222
#     - suppress_arp: true
#       vni_id: 33333
#
# commands:
#   - interface nve1
#   - no description vxlan vtep
#   - no source-interface hold-down-time 60
#   - no member vni 11111 associate-vrf
#   - member vni 11111
#   - suppress-arp
#   - ingress-replication protocol bgp
#   - no member vni 22222
#   - member vni 22222 associate-vrf
#   - no member vni 33333
#   - member vni 33333 associate-vrf
#   - global mcast-group 233.252.0.30 L2
#
# after:
#   enabled: true
#   advertise_virtual_rmac: true
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#   global_multicast_group:
#     address: 233.252.0.30
#     mode: L2
#   vnis:
#     - ingress_replication_bgp: true
#       suppress_arp: true
#       vni_id: 11111
#     - associate_vrf: true
#       vni_id: 22222
#     - associate_vrf: true
#       vni_id: 33333
#
# After state:
# ------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   host-reachability protocol bgp
#   advertise virtual-rmac
#   source-interface loopback1
#   global mcast-group 233.252.0.40 L2
#   member vni 11111
#     suppress-arp
#     ingress-replication protocol bgp
#   member vni 22222 associate-vrf
#   member vni 33333 associate-vrf


# Using replaced

# Before state:
# -------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   host-reachability protocol bgp
#   advertise virtual-rmac
#   source-interface loopback1
#   global mcast-group 233.252.0.40 L2
#   member vni 11111
#     suppress-arp
#     ingress-replication protocol bgp
#   member vni 22222 associate-vrf
#   member vni 33333 associate-vrf

- name: Replace NVE interface configuration with provided configuration.
  cisco.nxos.nxos_nve_interface:
    config:
      description: vxlan vtep
      host_reachability_bgp: true
      source_interface_name: loopback1
    state: replaced

# Task output:
# ------------
# before:
#   enabled: true
#   advertise_virtual_rmac: true
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#   global_multicast_group:
#     address: 233.252.0.40
#     mode: L2
#   vnis:
#     - ingress_replication_bgp: true
#       suppress_arp: true
#       vni_id: 11111
#     - associate_vrf: true
#       vni_id: 22222
#     - associate_vrf: true
#       vni_id: 33333
#
# commands:
#   - interface nve1
#   - description vxlan vtep
#   - no advertise virtual-rmac
#   - no member vni 11111
#   - no member vni 22222 associate-vrf
#   - no member vni 33333 associate-vrf
#   - shutdown
#   - no global mcast-group L2
#
# after:
#   enabled: false
#   description: vxlan vtep
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#
# After state:
# ------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   shutdown
#   description vxlan vtep
#   host-reachability protocol bgp
#   source-interface loopback1


# Using deleted

# Before state:
# -------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   shutdown
#   description vxlan vtep
#   host-reachability protocol bgp
#   source-interface loopback1

- name: Delete the whole NVE interface.
  cisco.nxos.nxos_nve_interface:
    state: deleted

# Task output:
# ------------

# before:
#   description: vxlan vtep
#   host_reachability_bgp: true
#   source_interface_name: loopback1
#
# commands:
#   - no interface nve1
#
# after: {}
#
# After state:
# ------------
# switch# show running-config | section "^interface nve1"
# switch#


# Using deleted with a config to remove only the listed VNIs

# Before state:
# -------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   host-reachability protocol bgp
#   source-interface loopback1
#   member vni 11111
#   member vni 22222 associate-vrf
#   member vni 33333

- name: Delete only the listed VNIs.
  cisco.nxos.nxos_nve_interface:
    config:
      vnis:
        - vni_id: 11111
        - vni_id: 22222
    state: deleted

# Task output:
# ------------

# commands:
#   - interface nve1
#   - no member vni 11111
#   - no member vni 22222 associate-vrf
#
# After state:
# ------------
# switch# show running-config | section "^interface nve1"
# interface nve1
#   no shutdown
#   host-reachability protocol bgp
#   source-interface loopback1
#   member vni 33333


# Using rendered

- name: Render platform specific configuration lines (without connecting to the device)
  cisco.nxos.nxos_nve_interface:
    config:
      enabled: true
      description: vxlan vtep
      advertise_virtual_rmac: true
      host_reachability_bgp: true
      source_interface_name: loopback1
      global_multicast_group:
        address: 233.252.0.20
        mode: L2
      vnis:
        - suppress_arp: true
          vni_id: 11111
        - suppress_arp_disable: true
          vni_id: 22222
    state: rendered

# Task output:
# ------------
# rendered:
#   - interface nve1
#   - description vxlan vtep
#   - host-reachability protocol bgp
#   - advertise virtual-rmac
#   - source-interface loopback1
#   - member vni 11111
#   - suppress-arp
#   - member vni 22222
#   - suppress-arp disable
#   - no shutdown
#   - global mcast-group 233.252.0.20 L2


# Using parsed

# parsed.cfg
# ----------
# interface nve1
#   no shutdown
#   description vxlan vtep
#   host-reachability protocol bgp
#   source-interface loopback1
#   global mcast-group 233.252.0.20 L2
#   member vni 22222
#   member vni 33333

- name: Parse externally provided NVE interface config
  cisco.nxos.nxos_nve_interface:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Task output:
# ------------
# parsed:
#   description: vxlan vtep
#   enabled: true
#   global_multicast_group:
#     address: 233.252.0.20
#     mode: L2
#  host_reachability_bgp: true
#  source_interface_name: loopback1
#  vnis:
#    - vni_id: 22222
#    - vni_id: 33333

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

list / elements=string

The configuration as structured data after module completion.

Returned: when changed

Sample: ["The configuration returned will always be in the same format of the parameters above.\n"]

before

list / elements=string

The configuration as structured data prior to module invocation.

Returned: always

Sample: ["The configuration returned will always be in the same format of the parameters above.\n"]

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

Sample: ["interface nve1", "no shutdown", "description vxlan vtep", "host-reachability protocol bgp", "advertise virtual-rmac", "source-interface loopback1", "global mcast-group 233.252.0.20 L2", "member vni 11111 associate-vrf", "member vni 22222", "suppress-arp"]

Authors

  • Jørn Ivar Holland (@jiholland)