dellemc.enterprise_sonic.sonic_fbs_classifiers module – Manage flow based services (FBS) classifiers configuration 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_fbs_classifiers.
New in dellemc.enterprise_sonic 3.1.0
Synopsis
This module provides configuration management of FBS classifiers for devices running SONiC
Parameters
Parameter |
Comments |
|---|---|
FBS classifiers configuration match_acl and match_hdr_fields are mutually exclusive. |
|
Description of classifier |
|
Name of classifier |
|
Match ACL configuration |
|
Name of ACL to be used as match criteria |
|
Type of ACL to be used as match criteria Choices:
|
|
Match header fields configuration ipv4 and ipv6 are mutually exclusive. |
|
IP field configuration |
|
Value of diffserv code point, range 0-63 |
|
IP protocol Choices:
|
|
IPv4 field configuration |
|
Destination IPv4 address prefix |
|
Source IPv4 address prefix |
|
IPv6 field configuration |
|
Destination IPv6 address prefix |
|
Source IPv6 address prefix |
|
Ethernet field configuration |
|
Drop eligible indicator, range 0-1 |
|
Destination MAC address |
|
Destination MAC address mask |
|
Ethertype field to match in ethernet packets Choices:
|
|
Priority code point, range 0-7 |
|
Source MAC address |
|
Source MAC address mask |
|
VLAN ID, range 1-4094 |
|
Transport field configuration |
|
Destination port or range For specifying a range use ‘..’ as a delimeter, e.g. ‘1..3’. |
|
ICMP or ICMPv6 code, range 0-255 |
|
ICMP or ICMPv6 type, range 0-255 |
|
Source port or range For specifying a range use ‘..’ as a delimeter, e.g. ‘1..3’. |
|
List of TCP flags to match Choices:
|
|
Classifier match type The classifier match type is required for classifier creation and corresponds to either ‘match_acl’ or ‘match_hdr_fields’ configuration. Choices:
|
|
The state of the configuration after module completion Choices:
|
Notes
Note
Tested against Enterprise SONiC Distribution by Dell Technologies.
Supports
check_mode.
Examples
# Using "merged" state
#
# Before state:
# -------------
#
# sonic# show class-map
# (No 'class-map' configuration present)
- name: Merge FBS classifiers configuration
dellemc.enterprise_sonic.sonic_fbs_classifiers:
config:
- class_name: class1
class_description: xyz
match_type: fields
match_hdr_fields:
ip:
dscp: 0
protocol: tcp
ipv4:
source_address: 1.1.1.1/1
destination_address: 2.2.2.2/2
l2:
source_mac: 1a:2b:3c:4d:5e:6f
source_mac_mask: 6a:5b:4c:3d:2e:1f
destination_mac: 2a:4b:6c:8d:10:20
destination_mac_mask: 20:10:8d:6c:4b:2a
dei: 0
ethertype: ipv4
pcp: 0
vlanid: 1
transport:
source_port: 1..3
destination_port: 4..6
tcp_flags:
- ack
- fin
- psh
state: merged
# After state:
# ------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description: xyz
# Match:
# ethertype ip
# src-mac 1a:2b:3c:4d:5e:6f/6a:5b:4c:3d:2e:1f
# dst-mac 2a:4b:6c:8d:10:20/20:10:8d:6c:4b:2a
# vlan 1
# pcp be
# dei 0
# ip protocol tcp
# src-ip 1.1.1.1/1
# dst-ip 2.2.2.2/2
# dscp default
# src-port 1-3
# dst-port 4-6
# tcp-flags fin psh ack
# Referenced in flows:
# Using "replaced" state
#
# Before state:
# -------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description: xyz
# Match:
# ethertype ip
# src-mac 1a:2b:3c:4d:5e:6f/6a:5b:4c:3d:2e:1f
# dst-mac 2a:4b:6c:8d:10:20/20:10:8d:6c:4b:2a
# vlan 1
# pcp be
# dei 0
# ip protocol tcp
# src-ip 1.1.1.1/1
# dst-ip 2.2.2.2/2
# dscp default
# src-port 1-3
# dst-port 4-6
# tcp-flags fin psh ack
# Referenced in flows:
#
# Class-map class2 match-type acl
# Description: abc
# Match:
# ip access-group acl1
# Referenced in flows:
- name: Replace FBS classifiers configuration
dellemc.enterprise_sonic.sonic_fbs_classifiers:
config:
- class_name: class1
match_hdr_fields:
l2:
source_mac: 9a:8b:7c:6d:5e:4f
source_mac_mask: 2a:4b:1c:9b:1e:0f
destination_mac: 1a:6c:3c:4f:40:22
destination_mac_mask: 26:44:8c:9d:4b:6f
ethertype: vlan
pcp: 6
vlanid: 2
state: replaced
# After state:
# ------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description: xyz
# Match:
# ethertype 0x8100
# src-mac 9a:8b:7c:6d:5e:4f/2a:4b:1c:9b:1e:0f
# dst-mac 1a:6c:3c:4f:40:22/26:44:8c:9d:4b:6f
# vlan 2
# pcp ic
# Referenced in flows:
#
# Class-map class2 match-type acl
# Description: abc
# Match:
# ip access-group acl1
# Referenced in flows:
# Using "overridden" state
#
# Before state:
# -------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description: xyz
# Match:
# ethertype 0x8100
# src-mac 9a:8b:7c:6d:5e:4f/2a:4b:1c:9b:1e:0f
# dst-mac 1a:6c:3c:4f:40:22/26:44:8c:9d:4b:6f
# vlan 2
# pcp ic
# Referenced in flows:
- name: Override FBS classifiers configuration
dellemc.enterprise_sonic.sonic_fbs_classifiers:
config:
- class_name: class2
class_description: abc
match_type: acl
match_acl:
acl_name: acl1
acl_type: ip
# After state:
# ------------
#
# sonic# show class-map
# Class-map class2 match-type acl
# Description: abc
# Match:
# ip access-group acl1
# Referenced in flows:
# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description: xyz
# Match:
# ethertype 0x8100
# src-mac 9a:8b:7c:6d:5e:4f/2a:4b:1c:9b:1e:0f
# dst-mac 1a:6c:3c:4f:40:22/26:44:8c:9d:4b:6f
# vlan 2
# pcp ic
# Referenced in flows:
#
# Class-map class2 match-type acl
# Description: abc
# Match:
# ip access-group acl1
# Referenced in flows:
- name: Delete FBS classifiers configuration
dellemc.enterprise_sonic.sonic_fbs_classifiers:
config:
- class_name: class1
class_description: xyz
match_hdr_fields:
l2:
source_mac: 9a:8b:7c:6d:5e:4f
source_mac_mask: 2a:4b:1c:9b:1e:0f
destination_mac: 1a:6c:3c:4f:40:22
destination_mac_mask: 26:44:8c:9d:4b:6f
ethertype: vlan
pcp: 6
vlanid: 2
- class_name: class2
state: deleted
# After state:
# ------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description:
# Match:
# Referenced in flows:
# Using "deleted" state
#
# Before state:
# -------------
#
# sonic# show class-map
# Class-map class1 match-type fields
# Description: xyz
# Match:
# ethertype 0x8100
# src-mac 9a:8b:7c:6d:5e:4f/2a:4b:1c:9b:1e:0f
# dst-mac 1a:6c:3c:4f:40:22/26:44:8c:9d:4b:6f
# vlan 2
# pcp ic
# Referenced in flows:
#
# Class-map class2 match-type acl
# Description: abc
# Match:
# ip access-group acl1
# Referenced in flows:
- name: Delete all FBS classifiers configuration
dellemc.enterprise_sonic.sonic_fbs_classifiers:
config:
state: deleted
# After state:
# ------------
#
# sonic# show class-map
# (No 'class-map' configuration present)
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 |
|
The generated configuration from module invocation. Returned: when |
|
The configuration prior to the module invocation. Returned: always |
|
The set of commands pushed to the remote device. Returned: always Sample: |