Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_l2_acls_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_l2_acls_module:
2
3
4 **************************************
5 dellemc.enterprise_sonic.sonic_l2_acls
6 **************************************
7
8 **Manage Layer 2 access control lists (ACL) configurations on SONiC**
9
10
11 Version added: 2.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides configuration management of Layer 2 access control lists (ACL) in devices running SONiC.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="4">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="4">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">list</span>
43 / <span style="color: purple">elements=dictionary</span>
44 </div>
45 </td>
46 <td>
47 </td>
48 <td>
49 <div>Specifies Layer 2 ACL configurations.</div>
50 </td>
51 </tr>
52 <tr>
53 <td class="elbow-placeholder"></td>
54 <td colspan="3">
55 <div class="ansibleOptionAnchor" id="parameter-"></div>
56 <b>name</b>
57 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
58 <div style="font-size: small">
59 <span style="color: purple">string</span>
60 / <span style="color: red">required</span>
61 </div>
62 </td>
63 <td>
64 </td>
65 <td>
66 <div>Specifies the ACL name.</div>
67 </td>
68 </tr>
69 <tr>
70 <td class="elbow-placeholder"></td>
71 <td colspan="3">
72 <div class="ansibleOptionAnchor" id="parameter-"></div>
73 <b>remark</b>
74 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
75 <div style="font-size: small">
76 <span style="color: purple">string</span>
77 </div>
78 </td>
79 <td>
80 </td>
81 <td>
82 <div>Specifies remark for the ACL.</div>
83 </td>
84 </tr>
85 <tr>
86 <td class="elbow-placeholder"></td>
87 <td colspan="3">
88 <div class="ansibleOptionAnchor" id="parameter-"></div>
89 <b>rules</b>
90 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
91 <div style="font-size: small">
92 <span style="color: purple">list</span>
93 / <span style="color: purple">elements=dictionary</span>
94 </div>
95 </td>
96 <td>
97 </td>
98 <td>
99 <div>List of rules with the ACL.</div>
100 <div><em>sequence_num</em>, <em>action</em>, <em>source</em> &amp; <em>destination</em> are required for adding a new rule.</div>
101 <div>If <em>state=deleted</em>, options other than <em>sequence_num</em> are not considered.</div>
102 <div><em>ethertype</em> and <em>vlan_tag_format</em> are mutually exclusive.</div>
103 </td>
104 </tr>
105 <tr>
106 <td class="elbow-placeholder"></td>
107 <td class="elbow-placeholder"></td>
108 <td colspan="2">
109 <div class="ansibleOptionAnchor" id="parameter-"></div>
110 <b>action</b>
111 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
112 <div style="font-size: small">
113 <span style="color: purple">string</span>
114 </div>
115 </td>
116 <td>
117 <ul style="margin: 0; padding: 0"><b>Choices:</b>
118 <li>deny</li>
119 <li>discard</li>
120 <li>do-not-nat</li>
121 <li>permit</li>
122 <li>transit</li>
123 </ul>
124 </td>
125 <td>
126 <div>Specifies the action taken on the matched Ethernet frame.</div>
127 </td>
128 </tr>
129 <tr>
130 <td class="elbow-placeholder"></td>
131 <td class="elbow-placeholder"></td>
132 <td colspan="2">
133 <div class="ansibleOptionAnchor" id="parameter-"></div>
134 <b>dei</b>
135 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
136 <div style="font-size: small">
137 <span style="color: purple">integer</span>
138 </div>
139 </td>
140 <td>
141 <ul style="margin: 0; padding: 0"><b>Choices:</b>
142 <li>0</li>
143 <li>1</li>
144 </ul>
145 </td>
146 <td>
147 <div>Match Ethernet frame with the given Drop Eligible Indicator (DEI) value.</div>
148 </td>
149 </tr>
150 <tr>
151 <td class="elbow-placeholder"></td>
152 <td class="elbow-placeholder"></td>
153 <td colspan="2">
154 <div class="ansibleOptionAnchor" id="parameter-"></div>
155 <b>destination</b>
156 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
157 <div style="font-size: small">
158 <span style="color: purple">dictionary</span>
159 </div>
160 </td>
161 <td>
162 </td>
163 <td>
164 <div>Specifies the destination of the Ethernet frame.</div>
165 <div><em>address</em> and <em>address_mask</em> are required together.</div>
166 <div><em>any</em>, <em>host</em> and <em>address</em> are mutually exclusive.</div>
167 </td>
168 </tr>
169 <tr>
170 <td class="elbow-placeholder"></td>
171 <td class="elbow-placeholder"></td>
172 <td class="elbow-placeholder"></td>
173 <td colspan="1">
174 <div class="ansibleOptionAnchor" id="parameter-"></div>
175 <b>address</b>
176 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
177 <div style="font-size: small">
178 <span style="color: purple">string</span>
179 </div>
180 </td>
181 <td>
182 </td>
183 <td>
184 <div>Destination MAC address.</div>
185 </td>
186 </tr>
187 <tr>
188 <td class="elbow-placeholder"></td>
189 <td class="elbow-placeholder"></td>
190 <td class="elbow-placeholder"></td>
191 <td colspan="1">
192 <div class="ansibleOptionAnchor" id="parameter-"></div>
193 <b>address_mask</b>
194 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
195 <div style="font-size: small">
196 <span style="color: purple">string</span>
197 </div>
198 </td>
199 <td>
200 </td>
201 <td>
202 <div>Destination MAC address mask.</div>
203 </td>
204 </tr>
205 <tr>
206 <td class="elbow-placeholder"></td>
207 <td class="elbow-placeholder"></td>
208 <td class="elbow-placeholder"></td>
209 <td colspan="1">
210 <div class="ansibleOptionAnchor" id="parameter-"></div>
211 <b>any</b>
212 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
213 <div style="font-size: small">
214 <span style="color: purple">boolean</span>
215 </div>
216 </td>
217 <td>
218 <ul style="margin: 0; padding: 0"><b>Choices:</b>
219 <li>no</li>
220 <li>yes</li>
221 </ul>
222 </td>
223 <td>
224 <div>Match any destination MAC address.</div>
225 </td>
226 </tr>
227 <tr>
228 <td class="elbow-placeholder"></td>
229 <td class="elbow-placeholder"></td>
230 <td class="elbow-placeholder"></td>
231 <td colspan="1">
232 <div class="ansibleOptionAnchor" id="parameter-"></div>
233 <b>host</b>
234 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
235 <div style="font-size: small">
236 <span style="color: purple">string</span>
237 </div>
238 </td>
239 <td>
240 </td>
241 <td>
242 <div>MAC address of a single destination host.</div>
243 </td>
244 </tr>
245
246 <tr>
247 <td class="elbow-placeholder"></td>
248 <td class="elbow-placeholder"></td>
249 <td colspan="2">
250 <div class="ansibleOptionAnchor" id="parameter-"></div>
251 <b>ethertype</b>
252 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
253 <div style="font-size: small">
254 <span style="color: purple">dictionary</span>
255 </div>
256 </td>
257 <td>
258 </td>
259 <td>
260 <div>Specifies the EtherType of the Ethernet frame.</div>
261 <div>Only one suboption can be specified for ethertype in a rule.</div>
262 </td>
263 </tr>
264 <tr>
265 <td class="elbow-placeholder"></td>
266 <td class="elbow-placeholder"></td>
267 <td class="elbow-placeholder"></td>
268 <td colspan="1">
269 <div class="ansibleOptionAnchor" id="parameter-"></div>
270 <b>arp</b>
271 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
272 <div style="font-size: small">
273 <span style="color: purple">boolean</span>
274 </div>
275 </td>
276 <td>
277 <ul style="margin: 0; padding: 0"><b>Choices:</b>
278 <li>no</li>
279 <li>yes</li>
280 </ul>
281 </td>
282 <td>
283 <div>Match Ethernet frame with ARP EtherType (0x806).</div>
284 </td>
285 </tr>
286 <tr>
287 <td class="elbow-placeholder"></td>
288 <td class="elbow-placeholder"></td>
289 <td class="elbow-placeholder"></td>
290 <td colspan="1">
291 <div class="ansibleOptionAnchor" id="parameter-"></div>
292 <b>ipv4</b>
293 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
294 <div style="font-size: small">
295 <span style="color: purple">boolean</span>
296 </div>
297 </td>
298 <td>
299 <ul style="margin: 0; padding: 0"><b>Choices:</b>
300 <li>no</li>
301 <li>yes</li>
302 </ul>
303 </td>
304 <td>
305 <div>Match Ethernet frame with IPv4 EtherType (0x800).</div>
306 </td>
307 </tr>
308 <tr>
309 <td class="elbow-placeholder"></td>
310 <td class="elbow-placeholder"></td>
311 <td class="elbow-placeholder"></td>
312 <td colspan="1">
313 <div class="ansibleOptionAnchor" id="parameter-"></div>
314 <b>ipv6</b>
315 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
316 <div style="font-size: small">
317 <span style="color: purple">boolean</span>
318 </div>
319 </td>
320 <td>
321 <ul style="margin: 0; padding: 0"><b>Choices:</b>
322 <li>no</li>
323 <li>yes</li>
324 </ul>
325 </td>
326 <td>
327 <div>Match Ethernet frame with IPv6 EtherType (0x86DD).</div>
328 </td>
329 </tr>
330 <tr>
331 <td class="elbow-placeholder"></td>
332 <td class="elbow-placeholder"></td>
333 <td class="elbow-placeholder"></td>
334 <td colspan="1">
335 <div class="ansibleOptionAnchor" id="parameter-"></div>
336 <b>value</b>
337 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
338 <div style="font-size: small">
339 <span style="color: purple">string</span>
340 </div>
341 </td>
342 <td>
343 </td>
344 <td>
345 <div>Specifies the EtherType value to match as a hexadecimal string.</div>
346 <div>The range is from 0x600 to 0xffff.</div>
347 </td>
348 </tr>
349
350 <tr>
351 <td class="elbow-placeholder"></td>
352 <td class="elbow-placeholder"></td>
353 <td colspan="2">
354 <div class="ansibleOptionAnchor" id="parameter-"></div>
355 <b>pcp</b>
356 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
357 <div style="font-size: small">
358 <span style="color: purple">dictionary</span>
359 </div>
360 </td>
361 <td>
362 </td>
363 <td>
364 <div>Match Ethernet frames using Priority Code Point (PCP) value.</div>
365 <div><em>mask</em> is valid only when <em>value</em> is specified.</div>
366 <div><em>value</em> and <em>traffic_type</em> are mutually exclusive.</div>
367 </td>
368 </tr>
369 <tr>
370 <td class="elbow-placeholder"></td>
371 <td class="elbow-placeholder"></td>
372 <td class="elbow-placeholder"></td>
373 <td colspan="1">
374 <div class="ansibleOptionAnchor" id="parameter-"></div>
375 <b>mask</b>
376 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
377 <div style="font-size: small">
378 <span style="color: purple">integer</span>
379 </div>
380 </td>
381 <td>
382 </td>
383 <td>
384 <div>Match Ethernet frame with given PCP value and mask.</div>
385 <div>The range is from 0 to 7.</div>
386 </td>
387 </tr>
388 <tr>
389 <td class="elbow-placeholder"></td>
390 <td class="elbow-placeholder"></td>
391 <td class="elbow-placeholder"></td>
392 <td colspan="1">
393 <div class="ansibleOptionAnchor" id="parameter-"></div>
394 <b>traffic_type</b>
395 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
396 <div style="font-size: small">
397 <span style="color: purple">string</span>
398 </div>
399 </td>
400 <td>
401 <ul style="margin: 0; padding: 0"><b>Choices:</b>
402 <li>be</li>
403 <li>bk</li>
404 <li>ee</li>
405 <li>ca</li>
406 <li>vi</li>
407 <li>vo</li>
408 <li>ic</li>
409 <li>nc</li>
410 </ul>
411 </td>
412 <td>
413 <div>Match Ethernet frame with PCP value for the given traffic type.</div>
414 <div><code>be</code> - Match Ethernet frame with Best effort PCP (0).</div>
415 <div><code>bk</code> - Match Ethernet frame with Background PCP (1).</div>
416 <div><code>ee</code> - Match Ethernet frame with Excellent effort PCP (2).</div>
417 <div><code>ca</code> - Match Ethernet frame with Critical applications PCP (3).</div>
418 <div><code>vi</code> - Match Ethernet frame with Video, &lt; 100 ms latency and jitter PCP (4).</div>
419 <div><code>vo</code> - Match Ethernet frame with Voice, &lt; 10 ms latency and jitter PCP (5).</div>
420 <div><code>ic</code> - Match Ethernet frame with Internetwork control PCP (6).</div>
421 <div><code>nc</code> - Match Ethernet frame with Network control PCP (7).</div>
422 </td>
423 </tr>
424 <tr>
425 <td class="elbow-placeholder"></td>
426 <td class="elbow-placeholder"></td>
427 <td class="elbow-placeholder"></td>
428 <td colspan="1">
429 <div class="ansibleOptionAnchor" id="parameter-"></div>
430 <b>value</b>
431 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
432 <div style="font-size: small">
433 <span style="color: purple">integer</span>
434 </div>
435 </td>
436 <td>
437 </td>
438 <td>
439 <div>Match Ethernet frame with the given PCP value.</div>
440 <div>The range is from 0 to 7</div>
441 </td>
442 </tr>
443
444 <tr>
445 <td class="elbow-placeholder"></td>
446 <td class="elbow-placeholder"></td>
447 <td colspan="2">
448 <div class="ansibleOptionAnchor" id="parameter-"></div>
449 <b>remark</b>
450 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
451 <div style="font-size: small">
452 <span style="color: purple">string</span>
453 </div>
454 </td>
455 <td>
456 </td>
457 <td>
458 <div>Specifies remark for the ACL rule.</div>
459 </td>
460 </tr>
461 <tr>
462 <td class="elbow-placeholder"></td>
463 <td class="elbow-placeholder"></td>
464 <td colspan="2">
465 <div class="ansibleOptionAnchor" id="parameter-"></div>
466 <b>sequence_num</b>
467 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
468 <div style="font-size: small">
469 <span style="color: purple">integer</span>
470 / <span style="color: red">required</span>
471 </div>
472 </td>
473 <td>
474 </td>
475 <td>
476 <div>Specifies the sequence number of the rule.</div>
477 <div>The range is from 1 to 65535.</div>
478 </td>
479 </tr>
480 <tr>
481 <td class="elbow-placeholder"></td>
482 <td class="elbow-placeholder"></td>
483 <td colspan="2">
484 <div class="ansibleOptionAnchor" id="parameter-"></div>
485 <b>source</b>
486 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
487 <div style="font-size: small">
488 <span style="color: purple">dictionary</span>
489 </div>
490 </td>
491 <td>
492 </td>
493 <td>
494 <div>Specifies the source of the Ethernet frame.</div>
495 <div><em>address</em> and <em>address_mask</em> are required together.</div>
496 <div><em>any</em>, <em>host</em> and <em>address</em> are mutually exclusive.</div>
497 </td>
498 </tr>
499 <tr>
500 <td class="elbow-placeholder"></td>
501 <td class="elbow-placeholder"></td>
502 <td class="elbow-placeholder"></td>
503 <td colspan="1">
504 <div class="ansibleOptionAnchor" id="parameter-"></div>
505 <b>address</b>
506 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
507 <div style="font-size: small">
508 <span style="color: purple">string</span>
509 </div>
510 </td>
511 <td>
512 </td>
513 <td>
514 <div>Source MAC address.</div>
515 </td>
516 </tr>
517 <tr>
518 <td class="elbow-placeholder"></td>
519 <td class="elbow-placeholder"></td>
520 <td class="elbow-placeholder"></td>
521 <td colspan="1">
522 <div class="ansibleOptionAnchor" id="parameter-"></div>
523 <b>address_mask</b>
524 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
525 <div style="font-size: small">
526 <span style="color: purple">string</span>
527 </div>
528 </td>
529 <td>
530 </td>
531 <td>
532 <div>Source MAC address mask.</div>
533 </td>
534 </tr>
535 <tr>
536 <td class="elbow-placeholder"></td>
537 <td class="elbow-placeholder"></td>
538 <td class="elbow-placeholder"></td>
539 <td colspan="1">
540 <div class="ansibleOptionAnchor" id="parameter-"></div>
541 <b>any</b>
542 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
543 <div style="font-size: small">
544 <span style="color: purple">boolean</span>
545 </div>
546 </td>
547 <td>
548 <ul style="margin: 0; padding: 0"><b>Choices:</b>
549 <li>no</li>
550 <li>yes</li>
551 </ul>
552 </td>
553 <td>
554 <div>Match any source MAC address.</div>
555 </td>
556 </tr>
557 <tr>
558 <td class="elbow-placeholder"></td>
559 <td class="elbow-placeholder"></td>
560 <td class="elbow-placeholder"></td>
561 <td colspan="1">
562 <div class="ansibleOptionAnchor" id="parameter-"></div>
563 <b>host</b>
564 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
565 <div style="font-size: small">
566 <span style="color: purple">string</span>
567 </div>
568 </td>
569 <td>
570 </td>
571 <td>
572 <div>MAC address of a single source host.</div>
573 </td>
574 </tr>
575
576 <tr>
577 <td class="elbow-placeholder"></td>
578 <td class="elbow-placeholder"></td>
579 <td colspan="2">
580 <div class="ansibleOptionAnchor" id="parameter-"></div>
581 <b>vlan_id</b>
582 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
583 <div style="font-size: small">
584 <span style="color: purple">integer</span>
585 </div>
586 </td>
587 <td>
588 </td>
589 <td>
590 <div>Match Ethernet frame with the given VLAN ID.</div>
591 </td>
592 </tr>
593 <tr>
594 <td class="elbow-placeholder"></td>
595 <td class="elbow-placeholder"></td>
596 <td colspan="2">
597 <div class="ansibleOptionAnchor" id="parameter-"></div>
598 <b>vlan_tag_format</b>
599 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
600 <div style="font-size: small">
601 <span style="color: purple">dictionary</span>
602 </div>
603 </td>
604 <td>
605 </td>
606 <td>
607 <div>Match Ethernet frame with the given VLAN tag format.</div>
608 </td>
609 </tr>
610 <tr>
611 <td class="elbow-placeholder"></td>
612 <td class="elbow-placeholder"></td>
613 <td class="elbow-placeholder"></td>
614 <td colspan="1">
615 <div class="ansibleOptionAnchor" id="parameter-"></div>
616 <b>multi_tagged</b>
617 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
618 <div style="font-size: small">
619 <span style="color: purple">boolean</span>
620 </div>
621 </td>
622 <td>
623 <ul style="margin: 0; padding: 0"><b>Choices:</b>
624 <li>no</li>
625 <li>yes</li>
626 </ul>
627 </td>
628 <td>
629 <div>Match three of more VLAN tagged Ethernet frame.</div>
630 </td>
631 </tr>
632
633
634
635 <tr>
636 <td colspan="4">
637 <div class="ansibleOptionAnchor" id="parameter-"></div>
638 <b>state</b>
639 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
640 <div style="font-size: small">
641 <span style="color: purple">string</span>
642 </div>
643 </td>
644 <td>
645 <ul style="margin: 0; padding: 0"><b>Choices:</b>
646 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
647 <li>replaced</li>
648 <li>overridden</li>
649 <li>deleted</li>
650 </ul>
651 </td>
652 <td>
653 <div>The state of the configuration after module completion.</div>
654 <div><code>merged</code> - Merges provided L2 ACL configuration with on-device configuration.</div>
655 <div><code>replaced</code> - Replaces on-device configuration of the specified L2 ACLs with provided configuration.</div>
656 <div><code>overridden</code> - Overrides all on-device L2 ACL configurations with the provided configuration.</div>
657 <div><code>deleted</code> - Deletes on-device L2 ACL configuration.</div>
658 </td>
659 </tr>
660 </table>
661 <br/>
662
663
664 Notes
665 -----
666
667 .. note::
668 - Supports ``check_mode``.
669
670
671
672 Examples
673 --------
674
675 .. code-block:: yaml
676
677 # Using "merged" state
678 #
679 # Before state:
680 # -------------
681 #
682 # sonic# show running-configuration mac access-list
683 # !
684 # mac access-list test
685 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
686 # sonic#
687
688 - name: Merge provided Layer 2 ACL configurations
689 dellemc.enterprise_sonic.sonic_l2_acls:
690 config:
691 - name: 'test'
692 rules:
693 - sequence_num: 2
694 action: 'permit'
695 source:
696 any: true
697 destination:
698 any: true
699 ethertype:
700 value: '0x88cc'
701 remark: 'LLDP'
702 - sequence_num: 3
703 action: 'permit'
704 source:
705 any: true
706 destination:
707 address: '00:00:10:00:00:00'
708 address_mask: '00:00:ff:ff:00:00'
709 pcp:
710 value: 4
711 mask: 6
712 - sequence_num: 4
713 action: 'deny'
714 source:
715 any: true
716 destination:
717 any: true
718 vlan_tag_format:
719 multi_tagged: true
720 - name: 'test1'
721 remark: 'test_mac_acl'
722 rules:
723 - sequence_num: 1
724 action: 'permit'
725 source:
726 host: '11:11:11:11:11:11'
727 destination:
728 any: true
729 - sequence_num: 2
730 action: 'permit'
731 source:
732 any: true
733 destination:
734 any: true
735 ethertype:
736 arp: true
737 vlan_id: 100
738 - sequence_num: 3
739 action: 'deny'
740 source:
741 any: true
742 destination:
743 any: true
744 dei: 0
745 state: merged
746
747 # After state:
748 # ------------
749 #
750 # sonic# show running-configuration mac access-list
751 # !
752 # mac access-list test
753 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
754 # seq 2 permit any any 0x88cc remark LLDP
755 # seq 3 permit any 00:00:10:00:00:00 00:00:ff:ff:00:00 pcp vi pcp-mask 6
756 # seq 4 deny any any vlan-tag-format multi-tagged
757 # !
758 # mac access-list test1
759 # remark test_mac_acl
760 # seq 1 permit host 11:11:11:11:11:11 any
761 # seq 2 permit any any arp vlan 100
762 # seq 3 deny any any dei 0
763 # sonic#
764
765
766 # Using "replaced" state
767 #
768 # Before state:
769 # -------------
770 #
771 # sonic# show running-configuration mac access-list
772 # !
773 # mac access-list test
774 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
775 # seq 2 permit any any 0x88cc remark LLDP
776 # seq 3 permit any 00:00:10:00:00:00 00:00:ff:ff:00:00 pcp vi pcp-mask 6
777 # !
778 # mac access-list test1
779 # remark test_mac_acl
780 # seq 1 permit host 11:11:11:11:11:11 any
781 # seq 2 permit any any arp vlan 100
782 # seq 3 deny any any dei 0
783 # sonic#
784
785 - name: Replace device configuration of specified Layer 2 ACLs with provided configuration
786 dellemc.enterprise_sonic.sonic_l2_acls:
787 config:
788 - name: 'test1'
789 rules:
790 - sequence_num: 1
791 action: 'permit'
792 source:
793 any: true
794 destination:
795 any: true
796 ethertype:
797 arp: true
798 vlan_id: 200
799 - sequence_num: 2
800 action: 'discard'
801 source:
802 any: true
803 destination:
804 any: true
805 - name: 'test2'
806 rules:
807 - sequence_num: 1
808 action: 'permit'
809 source:
810 host: '33:33:33:33:33:33'
811 destination:
812 host: '44:44:44:44:44:44'
813 state: replaced
814
815 # After state:
816 # ------------
817 #
818 # sonic# show running-configuration mac access-list
819 # !
820 # mac access-list test
821 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
822 # seq 2 permit any any 0x88cc remark LLDP
823 # seq 3 permit any 00:00:10:00:00:00 00:00:ff:ff:00:00 pcp vi pcp-mask 6
824 # !
825 # mac access-list test1
826 # seq 1 permit any any arp vlan 200
827 # seq 2 discard any any
828 # !
829 # mac access-list test2
830 # seq 1 permit host 33:33:33:33:33:33 host 44:44:44:44:44:44
831 # sonic#
832
833
834 # Using "overridden" state
835 #
836 # Before state:
837 # -------------
838 #
839 # sonic# show running-configuration mac access-list
840 # !
841 # mac access-list test
842 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
843 # seq 2 permit any any 0x88cc remark LLDP
844 # seq 3 permit any 00:00:10:00:00:00 00:00:ff:ff:00:00 pcp vi pcp-mask 6
845 # !
846 # mac access-list test1
847 # seq 1 permit any any arp vlan 200
848 # seq 2 discard any any
849 # !
850 # mac access-list test2
851 # seq 1 permit host 33:33:33:33:33:33 host 44:44:44:44:44:44
852 # sonic#
853
854 - name: Override device configuration of all Layer 2 ACLs with provided configuration
855 dellemc.enterprise_sonic.sonic_l2_acls:
856 config:
857 - name: 'test1'
858 remark: 'test_mac_acl'
859 rules:
860 - sequence_num: 1
861 action: 'permit'
862 source:
863 host: '11:11:11:11:11:11'
864 destination:
865 any: true
866 vlan_id: 100
867 - sequence_num: 2
868 action: 'permit'
869 source:
870 any: true
871 destination:
872 any: true
873 pcp:
874 traffic_type: 'ca'
875 - sequence_num: 3
876 action: 'deny'
877 source:
878 any: true
879 destination:
880 any: true
881 ethertype:
882 ipv4: true
883 state: overridden
884
885 # After state:
886 # ------------
887 #
888 # sonic# show running-configuration mac access-list
889 # !
890 # mac access-list test1
891 # remark test_mac_acl
892 # seq 1 permit host 11:11:11:11:11:11 any vlan 100
893 # seq 2 permit any any pcp ca
894 # seq 3 deny any any ip
895 # sonic#
896
897
898 # Using "deleted" state
899 #
900 # Before state:
901 # -------------
902 #
903 # sonic# show running-configuration mac access-list
904 # !
905 # mac access-list test
906 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
907 # seq 2 permit any any 0x88cc remark LLDP
908 # seq 3 permit any 00:00:10:00:00:00 00:00:ff:ff:00:00 pcp vi pcp-mask 6
909 # !
910 # mac access-list test1
911 # remark test_mac_acl
912 # seq 1 permit host 11:11:11:11:11:11 any vlan 100
913 # seq 2 deny any any ip
914 # !
915 # mac access-list test2
916 # seq 1 permit host 33:33:33:33:33:33 host 44:44:44:44:44:44
917 # sonic#
918
919 - name: Delete specified Layer 2 ACLs, ACL remark and ACL rule entries
920 dellemc.enterprise_sonic.sonic_l2_acls:
921 config:
922 - name: 'test'
923 rules:
924 - sequence_num: 3
925 - name: 'test1'
926 remark: 'test_mac_acl'
927 - name: 'test2'
928 state: deleted
929
930 # After state:
931 # ------------
932 #
933 # sonic# show running-configuration mac access-list
934 # !
935 # mac access-list test
936 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
937 # seq 2 permit any any 0x88cc remark LLDP
938 # !
939 # mac access-list test1
940 # seq 1 permit host 11:11:11:11:11:11 any vlan 100
941 # seq 2 deny any any ip
942 # sonic#
943
944
945 # Using "deleted" state
946 #
947 # Before state:
948 # -------------
949 #
950 # sonic# show running-configuration mac access-list
951 # !
952 # mac access-list test
953 # seq 1 permit host 22:22:22:22:22:22 any vlan 20
954 # seq 2 permit any any 0x88cc remark LLDP
955 # seq 3 permit any 00:00:10:00:00:00 00:00:ff:ff:00:00 pcp vi pcp-mask 6
956 # !
957 # mac access-list test1
958 # remark test_mac_acl
959 # seq 1 permit host 11:11:11:11:11:11 any vlan 100
960 # seq 2 deny any any ip
961 # !
962 # mac access-list test2
963 # seq 1 permit host 33:33:33:33:33:33 host 44:44:44:44:44:44
964 # sonic#
965
966 - name: Delete all Layer 2 ACL configurations
967 dellemc.enterprise_sonic.sonic_l2_acls:
968 config:
969 state: deleted
970
971 # After state:
972 # ------------
973 #
974 # sonic# show running-configuration mac access-list
975 # sonic#
976
977
978
979 Return Values
980 -------------
981 Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
982
983 .. raw:: html
984
985 <table border=0 cellpadding=0 class="documentation-table">
986 <tr>
987 <th colspan="1">Key</th>
988 <th>Returned</th>
989 <th width="100%">Description</th>
990 </tr>
991 <tr>
992 <td colspan="1">
993 <div class="ansibleOptionAnchor" id="return-"></div>
994 <b>after</b>
995 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
996 <div style="font-size: small">
997 <span style="color: purple">list</span>
998 </div>
999 </td>
1000 <td>when changed</td>
1001 <td>
1002 <div>The resulting configuration module invocation.</div>
1003 <br/>
1004 <div style="font-size: smaller"><b>Sample:</b></div>
1005 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format as the parameters above.</div>
1006 </td>
1007 </tr>
1008 <tr>
1009 <td colspan="1">
1010 <div class="ansibleOptionAnchor" id="return-"></div>
1011 <b>after_generated</b>
1012 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1013 <div style="font-size: small">
1014 <span style="color: purple">list</span>
1015 </div>
1016 </td>
1017 <td>when <code>check_mode</code></td>
1018 <td>
1019 <div>The generated configuration module invocation.</div>
1020 <br/>
1021 <div style="font-size: smaller"><b>Sample:</b></div>
1022 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format as the parameters above.</div>
1023 </td>
1024 </tr>
1025 <tr>
1026 <td colspan="1">
1027 <div class="ansibleOptionAnchor" id="return-"></div>
1028 <b>before</b>
1029 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1030 <div style="font-size: small">
1031 <span style="color: purple">list</span>
1032 </div>
1033 </td>
1034 <td>always</td>
1035 <td>
1036 <div>The configuration prior to the module invocation.</div>
1037 <br/>
1038 <div style="font-size: smaller"><b>Sample:</b></div>
1039 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format as the parameters above.</div>
1040 </td>
1041 </tr>
1042 <tr>
1043 <td colspan="1">
1044 <div class="ansibleOptionAnchor" id="return-"></div>
1045 <b>commands</b>
1046 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
1047 <div style="font-size: small">
1048 <span style="color: purple">list</span>
1049 </div>
1050 </td>
1051 <td>always</td>
1052 <td>
1053 <div>The set of commands pushed to the remote device.</div>
1054 <br/>
1055 <div style="font-size: smaller"><b>Sample:</b></div>
1056 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;command 1&#x27;, &#x27;command 2&#x27;, &#x27;command 3&#x27;]</div>
1057 </td>
1058 </tr>
1059 </table>
1060 <br/><br/>
1061
1062
1063 Status
1064 ------
1065
1066
1067 Authors
1068 ~~~~~~~
1069
1070 - Arun Saravanan Balachandran (@ArunSaravananBalachandran)