cisco.nxos.nxos_igmp_snooping module – IGMP snooping 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_igmp_snooping.

New in cisco.nxos 1.0.0

Synopsis

  • This module manages the global IGMP snooping configuration and the IGMP snooping settings of the per-VLAN context (vlan configuration <id>), including static groups, multicast router ports, the querier and report policies, on devices running Cisco NX-OS.

Note

This module has a corresponding action plugin.

Aliases: igmp_snooping

Parameters

Parameter

Comments

config

dictionary

added in cisco.nxos 14.0.0

IGMP snooping configuration.

disable_nve_static_router_port

boolean

Do not include the NVE interface as a static router port in the VXLAN VLANs (ip igmp snooping disable-nve-static-router-port).

Defaults to false.

Choices:

  • false

  • true

group_timeout

string

Group membership timeout for all VLANs on the device (ip igmp snooping group-timeout).

Accepted values are an integer in the range 1-10080 (minutes) and never.

It is removed by state deleted, and by state replaced and overridden when it is not given.

holddown_timer

integer

Hold-down timer in seconds (ip igmp snooping holddown-timer), in the range 1-300.

Defaults to 210.

boolean

Global link-local groups suppression (ip igmp snooping link-local-groups-suppression).

Defaults to true.

Choices:

  • false

  • true

max_gq_miss

integer

Number of general queries without an answer after which the mrouter port is removed (ip igmp snooping max-gq-miss), in the range 3-5.

Defaults to 3.

proxy

dictionary

IGMP snooping proxy for general queries (ip igmp snooping proxy general-queries).

Removed by state replaced and overridden when it is not given.

general_queries

boolean

Enables (true) or removes (false) the proxy.

Required when mrt is given.

Choices:

  • false

  • true

mrt

integer

Maximum response time in seconds (mrt), in the range 1-25.

report_suppression

boolean

Global IGMPv1/IGMPv2 report suppression (ip igmp snooping report-suppression).

Defaults to true.

Choices:

  • false

  • true

snooping

boolean

Enables or disables IGMP snooping on the switch (ip igmp snooping).

Defaults to true.

Choices:

  • false

  • true

syslog_threshold

integer

Percentage of the multicast table size at which a syslog message is raised (ip igmp snooping syslog-threshold), in the range 1-100.

Defaults to 90.

v3_report_suppression

boolean

Global IGMPv3 report suppression and proxy reporting (ip igmp snooping v3-report-suppression).

Defaults to false.

Choices:

  • false

  • true

vlans

list / elements=dictionary

The VLANs with a vlan configuration block.

With state replaced the settings of a listed VLAN are made identical to the ones given, VLANs that are not listed are left alone.

With state overridden the VLANs that are not listed are removed.

access_group

list / elements=dictionary

Group access filters (ip igmp snooping access-group).

Without interface the line is ip igmp snooping access-group <route-map>, which is only possible for a route_map.

interface

string

The interface the policy applies to. Required for a prefix_list.

name

string / required

The 1-63 character route-map or prefix-list name. It does not have to exist.

policy_type

string / required

The kind of policy.

Choices:

  • "route_map"

  • "prefix_list"

explicit_tracking

boolean

Explicit host tracking for IGMPv3 (ip igmp snooping explicit-tracking). Defaults to true.

Choices:

  • false

  • true

fast_leave

boolean

Fast leave (ip igmp snooping fast-leave). Defaults to false.

Choices:

  • false

  • true

group_timeout

string

Group membership timeout of the VLAN (ip igmp snooping group-timeout), 1-10080 minutes or never.

last_member_query_interval

integer

Last member query interval in seconds (ip igmp snooping last-member-query-interval), in the range 1-25. Defaults to 1.

boolean

Link-local groups suppression of the VLAN. Defaults to true.

Choices:

  • false

  • true

mrouter_interfaces

list / elements=string

Static multicast router ports (ip igmp snooping mrouter interface).

Accepts NX-OS Ethernet, VLAN, loopback, port-channel and NVE interface names.

proxy

dictionary

IGMP snooping proxy for general queries of the VLAN (ip igmp snooping proxy general-queries).

general_queries

boolean

Enables (true) or removes (false) the proxy. Required when mrt is given.

Choices:

  • false

  • true

mrt

integer

Maximum response time in seconds, in the range 1-25.

proxy_leave_use_group_address

boolean

Use the group address in proxy leaves (ip igmp snooping proxy-leave use-group-address). Defaults to false.

Choices:

  • false

  • true

querier

string

The IPv4 source address of the IGMP snooping querier (ip igmp snooping querier).

The querier with the lowest address wins the election.

querier_timeout

integer

Querier timeout in seconds (ip igmp snooping querier-timeout), in the range 1-65535. Defaults to 255.

query_interval

integer

Query interval in seconds (ip igmp snooping query-interval), in the range 1-18000. Defaults to 125.

query_max_response_time

integer

Maximum query response time in seconds (ip igmp snooping query-max-response-time), in the range 1-25. Defaults to 10.

report_flood

dictionary

Floods the reports (ip igmp snooping report-flood) to all ports or to selected interfaces.

all

boolean

Flood the reports to all ports (report-flood all).

Choices:

  • false

  • true

interfaces

list / elements=string

Flood the reports to these interfaces (report-flood interface).

report_policy

list / elements=dictionary

Report filters (ip igmp snooping report-policy) per interface.

interface

string / required

The interface the policy applies to.

name

string / required

The 1-63 character route-map or prefix-list name. It does not have to exist.

policy_type

string / required

The kind of policy.

Choices:

  • "route_map"

  • "prefix_list"

report_suppression

boolean

IGMPv1/IGMPv2 report suppression of the VLAN. Defaults to true.

Choices:

  • false

  • true

robustness_variable

integer

Robustness variable (ip igmp snooping robustness-variable), in the range 1-7. Defaults to 2.

snooping

boolean

Enables or disables IGMP snooping for the VLAN (ip igmp snooping). Defaults to true.

Choices:

  • false

  • true

startup_query_count

integer

Number of queries sent at startup (ip igmp snooping startup-query-count), in the range 1-10.

startup_query_interval

integer

Interval of the startup queries in seconds (ip igmp snooping startup-query-interval), in the range 1-18000.

static_groups

list / elements=dictionary

Static multicast groups of the VLAN (ip igmp snooping static-group).

group

string / required

The IPv4 multicast group address.

interfaces

list / elements=string / required

The interfaces on which the group is statically joined.

One ip igmp snooping static-group line is configured for each interface.

source

string

The IPv4 source address of the group, for IGMPv3.

v3_report_suppression

boolean

IGMPv3 report suppression of the VLAN. Defaults to false.

Choices:

  • false

  • true

version

integer

IGMP version used by the snooping process (ip igmp snooping version), 2 or 3. Defaults to 3.

vlan_id

integer / required

The VLAN ID, in the range 1-4094.

vxlan

boolean

Enables IGMP snooping for VXLAN VLANs (ip igmp snooping vxlan).

Defaults to false.

Choices:

  • false

  • true

running_config

string

added in cisco.nxos 14.0.0

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 commands show running-config | section “^vlan configuration” and show running-config | include “^ip igmp snooping|^no ip igmp snooping”, or the full running configuration.

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 the configuration should be left in.

The states and the call shape changed in 14.0.0. Only the resource module states exist, the former present and default states are replaced by merged and deleted.

With merged what is given is added to the device, nothing is removed. A setting that is not given is not touched.

With replaced the global settings that are not given are reset to their default, the listed VLANs are made identical to the given ones and the other VLANs are not touched.

With overridden the same applies and the VLANs that are not listed are removed.

With deleted and without config all global settings are reset to their default and all vlan configuration blocks are removed. With config the listed global settings are reset, a listed VLAN without any setting is removed, and for a listed VLAN with settings only these are removed.

With gathered the configuration is read from the device.

With rendered the commands for config are returned without connecting to the device.

With parsed running_config is returned as structured data.

Choices:

  • "merged" ← (default)

  • "replaced"

  • "overridden"

  • "deleted"

  • "gathered"

  • "rendered"

  • "parsed"

Notes

Note

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

  • Unsupported for Cisco MDS.

  • The module was rewritten as a resource module, the former flat parameters and the present and default states are replaced by config with the state merged or deleted.

  • NX-OS does not display a setting that has its default value. The global settings are therefore gathered with their effective value, a setting of a VLAN that is equal to its default counts as not set, and an option that is given with its default value removes its line.

  • A vlan configuration block is managed completely. With state replaced or overridden a listed VLAN gets exactly the given settings. state deleted without config and state overridden also remove the blocks that are not listed, also those created by other tools, so run the task in check mode first.

  • The device keeps one policy per interface, so an interface can only be used once in report_policy and access_group.

  • The proxy with mrt 5, the default, is not stored by the device, omit mrt instead.

  • IGMP snooping over VXLAN needs BGP EVPN and the global vxlan setting, and the configuration must be identical on both vPC peers.

  • This module works with connection network_cli and httpapi. See https://docs.ansible.com/ansible/latest/network/user_guide/platform_nxos.html

  • The parsed state reads configuration from running_config and does not connect to the device.

Examples

# Using merged

# Before state:
# -------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# (nothing is shown, the device has the default configuration)

- name: Merge the provided configuration with the existing running configuration
  cisco.nxos.nxos_igmp_snooping:
    config:
      vxlan: true
      v3_report_suppression: true
      group_timeout: "300"
      vlans:
        - vlan_id: 100
          static_groups:
            - group: 233.252.0.10
              interfaces:
                - Eth1/10
                - Po20
            - group: 233.252.0.11
              source: 192.0.2.10
              interfaces:
                - Ethernet1/10
    state: merged

# Task output:
# ------------
# before:
#   snooping: true
#   link_local_groups_suppression: true
#   report_suppression: true
#   v3_report_suppression: false
#   vxlan: false
#   disable_nve_static_router_port: false
#   max_gq_miss: 3
#   syslog_threshold: 90
#   holddown_timer: 210
# commands:
#   - ip igmp snooping v3-report-suppression
#   - ip igmp snooping vxlan
#   - ip igmp snooping group-timeout 300
#   - vlan configuration 100
#   - ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
#   - ip igmp snooping static-group 233.252.0.10 interface port-channel20
#   - ip igmp snooping static-group 233.252.0.11 source 192.0.2.10 interface Ethernet1/10
# after:
#   snooping: true
#   link_local_groups_suppression: true
#   report_suppression: true
#   v3_report_suppression: true
#   vxlan: true
#   disable_nve_static_router_port: false
#   max_gq_miss: 3
#   syslog_threshold: 90
#   holddown_timer: 210
#   group_timeout: "300"
#   vlans:
#     - vlan_id: 100
#       static_groups:
#         - group: 233.252.0.10
#           interfaces:
#             - Ethernet1/10
#             - port-channel20
#         - group: 233.252.0.11
#           source: 192.0.2.10
#           interfaces:
#             - Ethernet1/10

# After state:
# ------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# ip igmp snooping v3-report-suppression
# ip igmp snooping group-timeout 300
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
#   ip igmp snooping static-group 233.252.0.10 interface port-channel20
#   ip igmp snooping static-group 233.252.0.11 source 192.0.2.10 interface Ethernet1/10

# Using merged with the per-VLAN settings

- name: Configure the querier, the router ports and the filters of a VLAN
  cisco.nxos.nxos_igmp_snooping:
    config:
      max_gq_miss: 4
      proxy:
        general_queries: true
        mrt: 8
      vlans:
        - vlan_id: 100
          querier: 192.0.2.1
          query_interval: 200
          version: 2
          fast_leave: true
          mrouter_interfaces:
            - Po20
          report_flood:
            interfaces:
              - Po20
          report_policy:
            - policy_type: route_map
              name: RM_REPORTS
              interface: Po20
          access_group:
            - policy_type: route_map
              name: RM_GROUPS
    state: merged

# Task output:
# ------------
# commands:
#   - ip igmp snooping max-gq-miss 4
#   - ip igmp snooping proxy general-queries mrt 8
#   - vlan configuration 100
#   - ip igmp snooping mrouter interface port-channel20
#   - ip igmp snooping report-flood interface port-channel20
#   - ip igmp snooping report-policy route-map RM_REPORTS interface port-channel20
#   - ip igmp snooping access-group RM_GROUPS
#   - ip igmp snooping fast-leave
#   - ip igmp snooping query-interval 200
#   - ip igmp snooping version 2
#   - ip igmp snooping querier 192.0.2.1

# Using replaced

# Before state:
# -------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# ip igmp snooping v3-report-suppression
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
#   ip igmp snooping static-group 233.252.0.10 interface port-channel20
# vlan configuration 200
#   ip igmp snooping static-group 233.252.0.20 interface Ethernet1/20

- name: Replace the global settings and the listed VLANs
  cisco.nxos.nxos_igmp_snooping:
    config:
      vxlan: true
      vlans:
        - vlan_id: 100
          static_groups:
            - group: 233.252.0.10
              interfaces:
                - Ethernet1/10
    state: replaced

# Task output:
# ------------
# commands:
#   - no ip igmp snooping v3-report-suppression
#   - vlan configuration 100
#   - no ip igmp snooping static-group 233.252.0.10 interface port-channel20

# After state:
# ------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
# vlan configuration 200
#   ip igmp snooping static-group 233.252.0.20 interface Ethernet1/20

# Using overridden

# Before state:
# -------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
# vlan configuration 200
#   ip igmp snooping static-group 233.252.0.20 interface Ethernet1/20

# WARNING: every vlan configuration block that is not listed is removed, also the ones
# created by other tools or roles. Run it with check_mode first.
- name: Override the IGMP snooping configuration
  cisco.nxos.nxos_igmp_snooping:
    config:
      vxlan: true
      vlans:
        - vlan_id: 100
          static_groups:
            - group: 233.252.0.10
              interfaces:
                - Ethernet1/10
    state: overridden

# Task output:
# ------------
# commands:
#   - no vlan configuration 200

# After state:
# ------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10

# Using deleted

# Before state:
# -------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# ip igmp snooping group-timeout 300
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
# vlan configuration 200
#   ip igmp snooping static-group 233.252.0.20 interface Ethernet1/20

- name: Delete the VLAN 200 configuration only
  cisco.nxos.nxos_igmp_snooping:
    config:
      vlans:
        - vlan_id: 200
    state: deleted

# Task output:
# ------------
# commands:
#   - no vlan configuration 200

# Using deleted without config

# Before state:
# -------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# ip igmp snooping vxlan
# ip igmp snooping group-timeout 300
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10

# WARNING: this removes EVERY vlan configuration block on the switch, also the ones
# created by other tools or roles. Run it with check_mode first.
- name: Reset all global settings and remove all vlan configuration blocks
  cisco.nxos.nxos_igmp_snooping:
    state: deleted

# Task output:
# ------------
# commands:
#   - no ip igmp snooping vxlan
#   - no ip igmp snooping group-timeout 300
#   - no vlan configuration 100

# After state:
# ------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# (nothing is shown, the device has the default configuration)

# Using rendered

- name: Render platform specific configuration lines (without connecting to the device)
  cisco.nxos.nxos_igmp_snooping:
    config:
      snooping: true
      report_suppression: false
      vlans:
        - vlan_id: 100
          static_groups:
            - group: 233.252.0.10
              source: 192.0.2.10
              interfaces:
                - Po20
    state: rendered

# Task Output:
# ------------
# rendered:
#   - ip igmp snooping
#   - no ip igmp snooping report-suppression
#   - vlan configuration 100
#   - ip igmp snooping static-group 233.252.0.10 source 192.0.2.10 interface port-channel20

# Using parsed

# parsed.cfg
# ----------
# ip igmp snooping vxlan
# ip igmp snooping group-timeout 300
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10
#   ip igmp snooping static-group 233.252.0.10 interface port-channel20

- name: Parse the provided configuration
  cisco.nxos.nxos_igmp_snooping:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Task output:
# ------------
# parsed:
#   snooping: true
#   link_local_groups_suppression: true
#   report_suppression: true
#   v3_report_suppression: false
#   vxlan: true
#   disable_nve_static_router_port: false
#   max_gq_miss: 3
#   syslog_threshold: 90
#   holddown_timer: 210
#   group_timeout: "300"
#   vlans:
#     - vlan_id: 100
#       static_groups:
#         - group: 233.252.0.10
#           interfaces:
#             - Ethernet1/10
#             - port-channel20

# Using gathered

# Existing device config:
# -----------------------
# nxos# show running-config | section "^vlan configuration|^ip igmp snooping"
# no ip igmp snooping link-local-groups-suppression
# vlan configuration 100
#   ip igmp snooping static-group 233.252.0.11 source 192.0.2.10 interface Ethernet1/10

- name: Gather the IGMP snooping configuration from the device
  cisco.nxos.nxos_igmp_snooping:
    state: gathered

# Task output:
# ------------
# gathered:
#   snooping: true
#   link_local_groups_suppression: false
#   report_suppression: true
#   v3_report_suppression: false
#   vxlan: false
#   disable_nve_static_router_port: false
#   max_gq_miss: 3
#   syslog_threshold: 90
#   holddown_timer: 210
#   vlans:
#     - vlan_id: 100
#       static_groups:
#         - group: 233.252.0.11
#           source: 192.0.2.10
#           interfaces:
#             - Ethernet1/10

Return Values

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

Key

Description

after

dictionary

The resulting configuration after module execution.

Returned: when changed

Sample: "This output will always be in the same format as the module argspec.\n"

before

dictionary

The configuration prior to the module execution.

Returned: when state is merged, replaced, overridden or deleted

Sample: "This output will always be in the same format as the module argspec.\n"

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: when state is merged, replaced, overridden or deleted

Sample: ["ip igmp snooping vxlan", "vlan configuration 100", "ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10"]

gathered

dictionary

Facts about the network resource gathered from the remote device as structured data.

Returned: when state is gathered

Sample: "This output will always be in the same format as the module argspec.\n"

parsed

dictionary

The device native config provided in running_config option, parsed into structured data.

Returned: when state is parsed

Sample: "This output will always be in the same format as the module argspec.\n"

rendered

list / elements=string

The provided configuration in the device-native format (offline).

Returned: when state is rendered

Sample: ["ip igmp snooping vxlan", "vlan configuration 100", "ip igmp snooping static-group 233.252.0.10 interface Ethernet1/10"]

Authors

  • Jason Edelman (@jedelman8)

  • Gabriele Gerbino (@GGabriele)

  • Jorgen Spange (@jorgenspange)