dellemc.enterprise_sonic.sonic_l3_interfaces module – Configure the IPv4 and IPv6 parameters on Interfaces such as, Eth, LAG, VLAN, and loopback
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_l3_interfaces.
New in dellemc.enterprise_sonic 1.0.0
Synopsis
Configures Layer 3 interface settings on devices running Enterprise SONiC Distribution by Dell Technologies. This module provides configuration management of IPv4 and IPv6 parameters on Ethernet interfaces of devices running Enterprise SONiC.
Parameters
Parameter |
Comments |
|---|---|
A list of l3_interfaces configurations. |
|
ipv4 configurations to be set for the Layer 3 interface mentioned in name option. |
|
List of IPv4 addresses to be set. |
|
IPv4 address to be set in the format <ipv4 address>/<mask> for example, 192.0.2.1/24. |
|
secondary flag of the ip address. Functional default is ‘false’ Choices:
|
|
List of IPv4 addresses to be set for anycast. |
|
Configurations parameters for ipv4 proxy ARP |
|
Modes for proxy_arp Choices:
|
|
ipv6 configurations to be set for the Layer 3 interface mentioned in name option. |
|
List of IPv6 addresses to be set. |
|
IPv6 address to be set in the address format is <ipv6 address>/<mask> for example, 2001:db8:2201:1::1/64. |
|
Flag to indicate whether it is eui64 address Choices:
|
|
List of IPv6 anycast addresses. |
|
autoconfiguration flag Choices:
|
|
IPv6 nd dad related configs. Choices:
|
|
enabled flag of the ipv6. Choices:
|
|
Configurations parameters for ipv6 ND-proxy |
|
Modes for nd_proxy Choices:
|
|
List of ipv6 prefixes (subnets) for which this interface is to serve as an nd proxy |
|
Full name of the interface, for example, Eth1/3. |
|
The state of the configuration after module completion. Choices:
|
Notes
Note
Tested against Enterprise SONiC Distribution by Dell Technologies.
Supports
check_mode.
Examples
# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 83.1.1.1/16
# ip address 84.1.1.1/16 secondary
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 address 85::/64 eui-64
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ip proxy-arp enable remote-only
# ipv6 nd-proxy enable all
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ip address 92.1.1.1/16 secondary
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
# interface Vlan501
# ip anycast-address 11.12.13.14/12
# ip anycast-address 1.2.3.4/22
# ipv6 anycast-address 101::101/64
# ipv6 anycast-address 102::102/64
# !
- name: delete l3 interface attributes
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
- name: Ethernet20
ipv4:
proxy_arp:
mode: REMOTE_ONLY
addresses:
- address: 83.1.1.1/16
- address: 84.1.1.1/16
ipv6:
addresses:
- address: 85::/64
- name: Ethernet24
ipv6:
enabled: true
addresses:
- address: 91::1/16
- name: Vlan501
ipv4:
anycast_addresses:
- 11.12.13.14/12
ipv6:
anycast_addresses:
- 101::101/64
state: deleted
#
# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ipv6 nd-proxy enable all
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ip address 92.1.1.1/16 secondary
# ipv6 address 90::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
# interface Vlan501
# ip anycast-address 1.2.3.4/22
# ipv6 anycast-address 102::102/64
# !
# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 83.1.1.1/16
# ip address 84.1.1.1/16 secondary
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 address 85::/64 eui-64
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ip proxy-arp enable remote-only
# ipv6 nd-proxy enable all
# ipv6 nd-proxy rule prefix 5001::/24
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# ip proxy-arp enable all
# ipv6 nd-proxy enable remote-only
# ipv6 nd-proxy rule prefix 6001::/24
# !
# interface Vlan501
# ip anycast-address 11.12.13.14/12
# ip anycast-address 1.2.3.4/22
# ipv6 anycast-address 101::101/64
# ipv6 anycast-address 102::102/64
# !
- name: delete all l3 interface
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
state: deleted
#
# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# !
# interface Vlan501
# !
# Using "merged" state
#
# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# !
# interface Vlan501
# ip anycast-address 1.2.3.4/22
# ipv6 anycast-address 101::101/64
# !
- name: Add l3 interface configurations
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
- name: Ethernet20
ipv4:
addresses:
- address: 83.1.1.1/16
- address: 84.1.1.1/16
secondary: true
proxy_arp:
mode: REMOTE_ONLY
ipv6:
enabled: true
dad: ENABLE
autoconf: true
addresses:
- address: 83::1/16
- address: 84::1/16
- address: 85::/64
eui64: true
- name: Ethernet24
ipv4:
addresses:
- address: 91.1.1.1/16
ipv6:
addresses:
- address: 90::1/16
- address: 91::1/16
- address: 92::1/16
- address: 93::1/16
nd_proxy:
mode: REMOTE_ONLY
nd_proxy_rules:
- 6001::/24
- name: Vlan501
ipv4:
anycast_addresses:
- 11.12.13.14/12
ipv6:
anycast_addresses:
- 102::102/64
state: merged
# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 83.1.1.1/16
# ip address 84.1.1.1/16 secondary
# ip proxy-arp enable remote-only
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 address 85::/64 eui-64
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# ipv6 nd-proxy enable remote-only
# ipv6 nd-proxy rule prefix 6001::/24
# !
# interface Vlan501
# ip anycast-address 1.2.3.4/22
# ip anycast-address 11.12.13.14/12
# ipv6 anycast-address 101::101/64
# ipv6 anycast-address 102::102/64
# !
# Using "replaced" state
#
# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 83.1.1.1/16
# ip address 84.1.1.1/16 secondary
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 enable
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
- name: Replace l3 interface
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
- name: Ethernet20
ipv4:
- address: 81.1.1.1/16
proxy_arp:
mode: ALL
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 81.1.1.1/16
# ip proxy-arp enable all
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
# Using "replaced" state
#
# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 83.1.1.1/16
# ip address 84.1.1.1/16 secondary
# ip proxy-arp enable all
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 enable
# ipv6 nd-proxy enable remote-only
# ipv6 nd-proxy rule prefix 6001::/24
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
- name: Replace l3 interface
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
- name: Ethernet20
state: replaced
# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
# Using "overridden" state
#
# Before state:
# -------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# ip address 83.1.1.1/16
# ip address 84.1.1.1/16 secondary
# ipv6 address 83::1/16
# ipv6 address 84::1/16
# ipv6 address 85::/64 eui-64
# ipv6 enable
# ipv6 address autoconfig
# ipv6 nd dad enable
# ipv6 nd-proxy enable remote-only
# ipv6 nd-proxy rule prefix 6001::/24
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 91.1.1.1/16
# ipv6 address 90::1/16
# ipv6 address 91::1/16
# ipv6 address 92::1/16
# ipv6 address 93::1/16
# !
- name: Override l3 interface
dellemc.enterprise_sonic.sonic_l3_interfaces:
config:
- name: Ethernet24
ipv4:
- address: 81.1.1.1/16
proxy_arp:
mode: ALL
- name: Vlan100
ipv4:
anycast_addresses:
- 83.1.1.1/24
- 85.1.1.12/24
ipv6:
anycast_addresses:
- 83::1/24
- 85::1/24
nd_proxy:
mode: REMOTE_ONLY
nd_proxy_rules:
- 6001::/24
state: overridden
# After state:
# ------------
#
# sonic# show running-configuration interface
# !
# interface Ethernet20
# mtu 9100
# speed 100000
# shutdown
# !
# interface Ethernet24
# mtu 9100
# speed 100000
# shutdown
# ip address 81.1.1.1/16
# ip proxy-arp enable all
# !
# interface Vlan100
# ip anycast-address 83.1.1.1/24
# ip anycast-address 85.1.1.12/24
# ipv6 anycast-address 83::1/24
# ipv6 anycast-address 85::1/24
# ipv6 nd-proxy enable remote-only
# ipv6 nd-proxy rule prefix 6001::/24
# !
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The resulting configuration module invocation. Returned: when changed Sample: |
|
The generated configuration module invocation. Returned: when Sample: |
|
The configuration prior to the module invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |