dellemc.enterprise_sonic.sonic_vlan_mapping module – Configure vlan mappings on SONiC.
Note
This module is part of the dellemc.enterprise_sonic collection (version 3.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 dellemc.enterprise_sonic
.
To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_vlan_mapping
.
New in dellemc.enterprise_sonic 2.1.0
Synopsis
This module provides configuration management for vlan mappings on devices running SONiC.
Vlan mappings only available on TD3 and TD4 devices.
For TD4 devices must enable vlan mapping first (can enable in config-switch-resource).
Parameters
Parameter |
Comments |
---|---|
Specifies the vlan mapping related configurations. |
|
Define vlan mappings. dot1q_tunnel and vlan_translation are mutually exclusive. |
|
Specify a vlan stacking. |
|
Set priority level of the vlan stacking. Priority range is 0-7. |
|
Configure customer VLAN IDs. It can pass ranges and/or multiple list entries. Individual VLAN ID or (-) separated range of VLAN IDs. |
|
Configure service provider VLAN ID. VLAN ID range is 1-4094. |
|
Specify a vlan translation. |
|
Configure double tagged vlan translation. |
|
Configure inner customer VLAN ID. VLAN ID range is 1-4094. Only available for double tagged translations. |
|
Configure outer customer VLAN ID. VLAN ID range is 1-4094. |
|
Set priority level of the vlan translation. Priority range is 0-7. |
|
Configure single tagged vlan translation. |
|
Configure outer customer VLAN ID. VLAN ID range is 1-4094. |
|
Set priority level of the vlan translation. Priority range is 0-7. |
|
Indicate if there are multiple tags. Choices:
|
|
Full name of the interface, i.e. Ethernet8, PortChannel2, Eth1/2. |
|
Specifies the operation to be performed on the vlan mappings configured on the device. In case of merged, the input configuration will be merged with the existing vlan mappings on the device. In case of deleted, the existing vlan mapping configuration will be removed from the device. In case of overridden, all existing vlan mappings will be deleted and the specified input configuration will be add. In case of replaced, the existing vlan mappings on the device will be replaced by the configuration for each vlan mapping. Choices:
|
Examples
#
# Using deleted
#
# Before state:
# -------------
#
#sonic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 360-366,392 2755 3
#
# - name: Delete dot1q_tunnel configuration
# sonic_vlan_mapping:
# config:
# - name: Ethernet4
# mapping:
# - service_vlan: 2755
# dot1q_tunnel:
# vlan_ids:
# - 392
# - 360-362
# state: deleted
#
# After state:
# ------------
#
#onic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 363-366 2755 3
#
# Using deleted
#
# Before state:
# -------------
#
#sonic# show interface vlan-mappings
#Flags: M - Multi-tag
#---------------------------------------------------------
#Name Outer Inner Mapped Vlan Priority Flags
#---------------------------------------------------------
#Ethernet8 610 600 2567 - -
#Ethernet8 611 601 2567 1 -
#Ethernet8 612 602 2567 2 -
#
# - name: Delete vlan translation configuration
# sonic_vlan_mapping:
# config:
# - name: Ethernet8
# mapping:
# - service_vlan: 2567
# vlan_translation:
# match_double_tags:
# - inner_vlan: 602
# outer_vlan: 612
# priority: 2
# state: deleted
#
# After state:
# ------------
#
#sonic# show interface vlan-mappings
#Flags: M - Multi-tag
#---------------------------------------------------------
#Name Outer Inner Mapped Vlan Priority Flags
#---------------------------------------------------------
#Ethernet8 610 600 2567 - -
#Ethernet8 611 601 2567 1 -
#
#
# Using merged
#
# Before state:
# -------------
#
#sonic# show interface vlan-mappings dot1q-tunnel
#
# - name: Merge dot1q_tunnel configuration
# sonic_vlan_mapping:
# config:
# - name: Ethernet4
# mapping:
# - service_vlan: 2755
# dot1q_tunnel:
# vlan_ids:
# - 392
# - 360-366
# priority: 3
# state: merged
#
# After state:
# ------------
#
#sonic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 360-366,392 2755 3
#
# Using merged
#
# Before state:
# -------------
#
#sonic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 360-366,392 2755 3
#
# - name: Merge vlan translation configuration
# sonic_vlan_mapping:
# config:
# - name: Ethernet8
# mapping:
# - service_vlan: 2567
# vlan_translation:
# match_double_tags:
# - inner_vlan: 600
# outer_vlan: 610
# - inner_vlan: 601
# outer_vlan: 611
# priority: 1
# - inner_vlan: 602
# outer_vlan: 612
# priority: 2
# state: merged
#
# After state:
# ------------
#
#sonic# show interface vlan-mappings
#Flags: M - Multi-tag
#---------------------------------------------------------
#Name Outer Inner Mapped Vlan Priority Flags
#---------------------------------------------------------
#Ethernet8 610 600 2567 - -
#Ethernet8 611 601 2567 1 -
#Ethernet8 612 602 2567 2 -
#
#sonic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 360-366,392 2755 3
#
#
# Using replaced
#
# Before state:
# -------------
#
#sonic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 360-366,392 2755 3
#
# - name: Replace dot1q_tunnel configuration
# sonic_vlan_mapping:
# config:
# - name: Ethernet4
# mapping:
# - service_vlan: 2755
# dot1q_tunnel:
# vlan_ids:
# - 660-666
# priority: 6
# state: replaced
#
# After state:
# ------------
#
#sonic# show interface vlan-mappings dot1q-tunnel
#--------------------------------------------------------------------
#Name Vlan dot1q-tunnel Vlan Priority
#--------------------------------------------------------------------
#Ethernet4 660-666 2755 6
#
# Using overridden
#
# Before state:
# -------------
#
#sonic# show interface vlan-mappings
#Flags: M - Multi-tag
#---------------------------------------------------------
#Name Outer Inner Mapped Vlan Priority Flags
#---------------------------------------------------------
#Ethernet8 610 600 2567 - -
#Ethernet8 611 601 2567 1 -
#Ethernet8 612 602 2567 2 -
#
# - name: Override vlan translation configuration
# sonic_vlan_mapping:
# config:
# - name: Ethernet8
# mapping:
# - service_vlan: 2567
# vlan_translation:
# match_double_tags:
# - inner_vlan: 701
# outer_vlan: 711
# priority: 5
# - inner_vlan: 702
# outer_vlan: 712
# priority: 6
# state: overridden
#
# After state:
# ------------
#
#sonic# show interface vlan-mappings
#Flags: M - Multi-tag
#---------------------------------------------------------
#Name Outer Inner Mapped Vlan Priority Flags
#---------------------------------------------------------
#Ethernet8 711 701 2567 5 -
#Ethernet8 712 702 2567 6 -
#
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 configuration prior to the module invocation. Returned: always Sample: |
|
The set of commands pushed to the remote device. Returned: always Sample: |