dellemc.enterprise_sonic.sonic_ipv6_router_advertisement module – Manage interface-specific IPv6 Router Advertisement configurations on SONiC

Note

This module is part of the dellemc.enterprise_sonic collection (version 3.2.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 dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_ipv6_router_advertisement.

New in dellemc.enterprise_sonic 3.1.0

Synopsis

  • This module provides configuration management of interface-specific IPv6 Router Advertisement parameters for devices running SONiC.

  • This functionality is referred to as ‘ipv6 nd’ in Enterprise SONiC CLI.

Parameters

Parameter

Comments

config

list / elements=dictionary

Specifies interface-specific IPv6 Router Advertisement configurations.

adv_interval_option

boolean

Include Advertisement Interval option in Router Advertisement.

Choices:

  • false

  • true

dnssl

list / elements=dictionary

Specifies the DNS search list to advertise.

If state=deleted, options other than dnssl_name are not considered.

dnssl_name

string / required

Domain Name suffix to be advertised.

valid_lifetime

integer

Specifies the valid lifetime in seconds.

The range if from 0 to 4294967295.

Value of 4294967295 represents infinite valid lifetime.

home_agent_config

boolean

Set ‘Home Agent’ flag in Router Advertisement.

Choices:

  • false

  • true

home_agent_lifetime

integer

Specifies the Home Agent lifetime in seconds when home_agent_config=True.

The range is from 0 to 65520.

home_agent_preference

integer

Specifies the Home Agent preference when home_agent_config=True.

The range is from 0 to 65535.

managed_config

boolean

Set ‘Managed Address Configuration’ flag in Router Advertisement.

Choices:

  • false

  • true

min_ra_interval

integer

Specifies the minimum Router Advertisement interval in seconds.

The range is from 1 to 1350.

min_ra_interval_msec

integer

Specifies the minimum Router Advertisement interval in milliseconds.

The range is from 30 to 1350000.

mtu

integer

Specifies the MTU (in bytes) to be advertised.

The range is from 0 to 65535.

name

string / required

Full name of the interface.

other_config

boolean

Set ‘Other Configuration’ flag in Router Advertisement.

Choices:

  • false

  • true

ra_fast_retrans

boolean

Enable faster transmissions of RA packets.

Choices:

  • false

  • true

ra_hop_limit

integer

Specifies the Hop limit to be advertised.

The range is from 0 to 255.

ra_interval

integer

Specifies the maximum Router Advertisement interval in seconds.

The range is from 1 to 1800.

ra_interval_msec

integer

Specifies the maximum Router Advertisement interval in milliseconds.

The range is from 70 to 1800000.

ra_lifetime

integer

Specifies the Router Lifetime in seconds.

The range is from 0 to 9000.

ra_prefixes

list / elements=dictionary

Specifies the IPv6 prefixes to be included in Router Advertisement.

If state=deleted, options other than prefix are not considered.

no_autoconfig

boolean

Indicate the prefix cannot be used for IPv6 autoconfiguration.

Choices:

  • false

  • true

boolean

Indicate the prefix cannot be used for on-link determination.

Choices:

  • false

  • true

preferred_lifetime

integer

Specifies the preferred lifetime in seconds.

The range if from 0 to 4294967295.

Value of 4294967295 represents infinite preferred lifetime.

prefix

string / required

IPv6 prefix to be advertised.

router_address

boolean

Set ‘Router Address’ flag.

Choices:

  • false

  • true

valid_lifetime

integer

Specifies the valid lifetime in seconds.

The range if from 0 to 4294967295.

Value of 4294967295 represents infinite valid lifetime.

ra_retrans_interval

integer

Specifies the Retransmission Interval in milliseconds.

The range is from 0 to 4294967295.

rdnss

list / elements=dictionary

Specifies the Recursive DNS server addresses to advertise.

If state=deleted, options other than address are not considered.

address

string / required

Recursive DNS server address to be advertised.

valid_lifetime

integer

Specifies the valid lifetime in seconds.

The range if from 0 to 4294967295.

Value of 4294967295 represents infinite valid lifetime.

reachable_time

integer

Specifies the Reachable Time in milliseconds.

The range is from 0 to 3600000.

router_preference

string

Specifies the default router preference.

Choices:

  • "low"

  • "medium"

  • "high"

suppress

boolean

Enable suppression of Router Advertisement.

Choices:

  • false

  • true

state

string

The state of the configuration after module completion.

merged - Merges provided interface-specific IPv6 router advertisement configuration with on-device configuration.

replaced - Replaces on-device IPv6 router advertisement configuration of the specified interfaces with provided configuration.

overridden - Overrides all on-device interface-specific IPv6 router advertisement configurations with the provided configuration.

deleted - Deletes on-device interface-specific IPv6 router advertisement configuration.

Choices:

  • "merged" ← (default)

  • "deleted"

  • "replaced"

  • "overridden"

Examples

# Using merged
#
# Before State:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
# !

- name: Add IPv6 Router Advertisement configurations
  dellemc.enterprise_sonic.sonic_ipv6_router_advertisement:
    config:
      - name: 'Eth1/1'
        suppress: false
        router_preference: high
        ra_interval: 180
        min_ra_interval: 60
        ra_lifetime: 360
        ra_retrans_interval: 30000
        ra_hop_limit: 10
        dnssl:
          - dnssl_name: 'test.com'
            valid_lifetime: 3600
        rdnss:
          - address: 100::100
          - address: 100::200
      - name: 'Eth1/2'
        adv_interval_option: true
        ra_fast_retrans: false
        reachable_time: 7200000
        ra_prefixes:
          - prefix: 1000:0:0:2000::/64
            valid_lifetime: 86400
            preferred_lifetime: 86400
            off_link: true
            no_autoconfig: true
    state: merged

# After State:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd ra-retrans-interval 30000
#  ipv6 nd router-preference high
#  ipv6 nd dnssl test.com 3600
#  ipv6 nd rdnss 100::100
#  ipv6 nd rdnss 100::200
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  no ipv6 nd ra-fast-retrans
#  ipv6 nd adv-interval-option
#  ipv6 nd reachable-time 1200000
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
#  ipv6 nd prefix 1000:0:0:2000::/64 86400 86400 off-link no-autoconfig
# !


# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd ra-retrans-interval 30000
#  ipv6 nd router-preference high
#  ipv6 nd dnssl test.com 3600
#  ipv6 nd dnssl test2.com 7200
#  ipv6 nd rdnss 100::100 3600
#  ipv6 nd rdnss 100::200 7200
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  no ipv6 nd ra-fast-retrans
#  ipv6 nd adv-interval-option
#  ipv6 nd min-ra-interval msec 45500
#  ipv6 nd reachable-time 1200000
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
#  ipv6 nd prefix 1000:0:0:2000::/64 86400 86400 off-link no-autoconfig
# !

- name: Delete IPv6 Router Advertisement configurations
  dellemc.enterprise_sonic.sonic_ipv6_router_advertisement:
    config:
      - name: 'Eth1/1'
        ra_hop_limit: 10
        router_preference: high
        dnssl:
          - dnssl_name: test2.com
        rdnss:
          - address: 100::200
      - name: 'Eth1/2'
        adv_interval_option: true
        ra_fast_retrans: false
        ra_prefixes:
          - prefix: 1000:0:0:2000::/64
    state: deleted

# After State:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd ra-retrans-interval 30000
#  ipv6 nd dnssl test.com 3600
#  ipv6 nd rdnss 100::100 3600
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd min ra-interval msec 45500
#  ipv6 nd reachable-time 1200000
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
# !


# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd ra-retrans-interval 30000
#  ipv6 nd dnssl test.com 3600
#  ipv6 nd rdnss 100::100 3600
#  ipv6 nd rdnss 100::200 7200
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd adv-interval-option
#  ipv6 nd router-preference low
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
# !

- name: Delete all IPv6 Router Advertisement configurations for interface Eth1/1
  dellemc.enterprise_sonic.sonic_ipv6_router_advertisement:
    config:
      - name: 'Eth1/1'
    state: deleted

# After State:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd adv-interval-option
#  ipv6 nd router-preference low
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
# !


# Using deleted
#
# Before State:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd ra-retrans-interval 30000
#  ipv6 nd dnssl test.com 3600
#  ipv6 nd rdnss 100::100 3600
#  ipv6 nd rdnss 100::200 7200
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd adv-interval-option
#  ipv6 nd router-preference low
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
# !

- name: Delete all IPv6 Router Advertisement configurations
  dellemc.enterprise_sonic.sonic_ipv6_router_advertisement:
    config:
    state: deleted

# After State:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
# !


# Using replaced
#
# Before State:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd router-preference high
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  no ipv6 nd ra-fast-retrans
#  ipv6 nd adv-interval-option
#  ipv6 nd min-ra-interval msec 45500
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd reachable-time 1200000
#  ipv6 nd prefix 1000:0:0:1000::/64 86400 86400 off-link no-autoconfig
#  ipv6 nd prefix 1000:0:0:2000::/64 86400 86400 off-link no-autoconfig
# !

- name: Replace IPv6 Router Advertisement configurations for interface Eth1/2
  dellemc.enterprise_sonic.sonic_ipv6_router_advertisement:
    config:
      - name: 'Eth1/2'
        suppress: false
        ra_interval: 300
        router_preference: high
        ra_prefixes:
          - prefix: 2000:0:0:1000::/64
            valid_lifetime: 3600
            preferred_lifetime: 3600
            router_address: true
    state: replaced

# After State:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd router-preference high
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-interval 300
#  ipv6 nd router-preference high
#  ipv6 nd prefix 2000:0:0:1000::/64 3600 3600 router-address
# !


# Using overridden
#
# Before State:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-hop-limit 10
#  ipv6 nd ra-interval 180
#  ipv6 nd min-ra-interval 60
#  ipv6 nd ra-lifetime 360
#  ipv6 nd router-preference high
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd ra-interval 300
#  ipv6 nd router-preference high
#  ipv6 nd prefix 2000:0:0:1000::/64 3600 3600 router-address
# !
# interface Eth1/3
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
# !

- name: Override all IPv6 Router Advertisement configurations
  dellemc.enterprise_sonic.sonic_ipv6_router_advertisement:
    config:
      - name: 'Eth1/1'
        suppress: false
        home_agent_config: true
        home_agent_lifetime: 7200
        home_agent_preference: 100
      - name: 'Eth1/3'
        suppress: false
        managed_config: true
        other_config: true
        ra_retrans_interval: 30000
    state: overridden

# After State:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Eth1/1
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd home-agent-config-flag
#  ipv6 nd home-agent-lifetime 7200
#  ipv6 nd home-agent-preference 100
# !
# interface Eth1/2
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
# !
# interface Eth1/3
#  mtu 9100
#  speed 400000
#  fec RS
#  no shutdown
#  no ipv6 nd suppress-ra
#  ipv6 nd managed-config-flag
#  ipv6 nd other-config-flag
#  ipv6 nd ra-retrans-interval 30000
# !

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 resulting from module invocation.

Returned: when changed

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

after(generated)

list / elements=string

The configuration that would be generated by module invocation.

Returned: when check_mode

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

before

list / elements=string

The configuration prior to the module invocation.

Returned: always

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

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

Sample: ["command 1", "command 2", "command 3"]

Authors

  • Arun Saravanan Balachandran (@ArunSaravananBalachandran)