diff --git a/docs/vyos.vyos.vyos_vpp_acl_module.rst b/docs/vyos.vyos.vyos_vpp_acl_module.rst new file mode 100644 index 00000000..a1e6d276 --- /dev/null +++ b/docs/vyos.vyos.vyos_vpp_acl_module.rst @@ -0,0 +1,1225 @@ +.. _vyos.vyos.vyos_vpp_acl_module: + + +********************** +vyos.vyos.vyos_vpp_acl +********************** + +**VPP dataplane ACL resource module** + + +Version added: 7.0.0 + +.. contents:: + :local: + :depth: 1 + + +Synopsis +-------- +- This module manages the access control lists of the accelerated dataplane (VPP) on devices running VyOS - IP and MAC ACLs, and their bindings to dataplane interfaces. + + + + +Parameters +---------- + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ config + +
+ dictionary +
+
+ +
The VPP dataplane ACL configuration.
+
+
+ ip + +
+ dictionary +
+
+ +
IP ACLs and their bindings.
+
+
+ acls + +
+ list + / elements=dictionary +
+
+ +
IP ACLs (vpp acl ip tag-name).
+
+
+ description + +
+ string +
+
+ +
The ACL description.
+
+
+ name + +
+ string + / required +
+
+ +
The ACL name.
+
+
+ rules + +
+ list + / elements=dictionary +
+
+ +
The ACL rules.
+
+
+ action + +
+ string +
+
+
    Choices: +
  • permit
  • +
  • deny
  • +
  • permit-reflect
  • +
+
+
The action for matching packets.
+
+
+ description + +
+ string +
+
+ +
The rule description.
+
+
+ destination + +
+ dictionary +
+
+ +
The destination to match.
+
+
+ port + +
+ string +
+
+ +
The destination port or port range.
+
+
+ prefix + +
+ string +
+
+ +
The IPv4 or IPv6 destination prefix.
+
+
+ number + +
+ integer + / required +
+
+ +
The rule number.
+
+
+ protocol + +
+ string +
+
+ +
The protocol to match, as a name or number, or all.
+
+
+ source + +
+ dictionary +
+
+ +
The source to match.
+
+
+ port + +
+ string +
+
+ +
The source port or port range, for example 1024-65535.
+
+
+ prefix + +
+ string +
+
+ +
The IPv4 or IPv6 source prefix.
+
+
+ tcp_flags + +
+ dictionary +
+
+ +
The TCP flags to match.
+
+
+ is_not_set + +
+ list + / elements=string +
+
+
    Choices: +
  • ack
  • +
  • cwr
  • +
  • ecn
  • +
  • fin
  • +
  • psh
  • +
  • rst
  • +
  • syn
  • +
  • urg
  • +
+
+
The TCP flags that must not be set.
+
+
+ is_set + +
+ list + / elements=string +
+
+
    Choices: +
  • ack
  • +
  • cwr
  • +
  • ecn
  • +
  • fin
  • +
  • psh
  • +
  • rst
  • +
  • syn
  • +
  • urg
  • +
+
+
The TCP flags that must be set.
+
+
+ interfaces + +
+ list + / elements=dictionary +
+
+ +
The IP ACLs bound to dataplane interfaces.
+
+
+ input + +
+ list + / elements=dictionary +
+
+ +
The ACLs applied to incoming traffic, in the order of acl_tag.
+
+
+ acl_tag + +
+ integer + / required +
+
+ +
The position of the ACL in the list.
+
+
+ tag_name + +
+ string + / required +
+
+ +
The name of the IP ACL.
+
+
+ name + +
+ string + / required +
+
+ +
The interface name, for example eth1.
+
+
+ output + +
+ list + / elements=dictionary +
+
+ +
The ACLs applied to outgoing traffic, in the order of acl_tag.
+
+
+ acl_tag + +
+ integer + / required +
+
+ +
The position of the ACL in the list.
+
+
+ tag_name + +
+ string + / required +
+
+ +
The name of the IP ACL.
+
+
+ mac + +
+ dictionary +
+
+ +
MAC ACLs and their bindings.
+
+
+ acls + +
+ list + / elements=dictionary +
+
+ +
MAC ACLs (vpp acl mac tag-name).
+
+
+ description + +
+ string +
+
+ +
The ACL description.
+
+
+ name + +
+ string + / required +
+
+ +
The ACL name.
+
+
+ rules + +
+ list + / elements=dictionary +
+
+ +
The ACL rules.
+
+
+ action + +
+ string +
+
+
    Choices: +
  • permit
  • +
  • deny
  • +
+
+
The action for matching packets.
+
+
+ description + +
+ string +
+
+ +
The rule description.
+
+
+ mac_address + +
+ string +
+
+ +
The MAC address to match.
+
+
+ mac_mask + +
+ string +
+
+ +
The mask applied to mac_address.
+
+
+ number + +
+ integer + / required +
+
+ +
The rule number.
+
+
+ prefix + +
+ string +
+
+ +
The IPv4 or IPv6 prefix to match.
+
+
+ interfaces + +
+ list + / elements=dictionary +
+
+ +
The MAC ACLs bound to dataplane interfaces, one per interface.
+
+
+ name + +
+ string + / required +
+
+ +
The interface name, for example eth1.
+
+
+ tag_name + +
+ string +
+
+ +
The name of the MAC ACL.
+
+
+ running_config + +
+ string +
+
+ +
This option is used only with state parsed.
+
The value of this option should be the output received from the VyOS device by executing the command show configuration commands | grep 'vpp acl'.
+
The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
+
+
+ state + +
+ string +
+
+
    Choices: +
  • merged ←
  • +
  • replaced
  • +
  • overridden
  • +
  • deleted
  • +
  • gathered
  • +
  • rendered
  • +
  • parsed
  • +
+
+
The state the configuration should be left in.
+
+
+ + +Notes +----- + +.. note:: + - Tested against VyOS 1.5.1. + - This module works with connection ``network_cli``. + - ACLs can only be bound to interfaces that are part of the dataplane (``vpp settings interface``). + - IP and MAC ACLs are handled independently. With *state=replaced*, the listed ACLs and interface bindings are replaced as given; with *state=overridden*, ACLs and bindings that are not listed are also deleted, bindings before ACLs. + - When not configured, VyOS uses the protocol ``all`` for IP rules and the mask ``ff:ff:ff:ff:ff:ff`` for MAC rules; the module reports only configured values. + + + +Examples +-------- + +.. code-block:: yaml + + # Using merged + + # Before state: + # ------------- + # + # vyos@vyos:~$ show configuration commands | grep 'vpp acl' + # + + - name: Permit HTTPS from partners into eth1 + vyos.vyos.vyos_vpp_acl: + config: + ip: + acls: + - name: WEB-IN + description: Inbound web traffic + rules: + - number: 10 + action: permit + protocol: tcp + source: + prefix: 192.0.2.0/24 + destination: + prefix: 198.51.100.10/32 + port: "443" + - number: 20 + action: deny + interfaces: + - name: eth1 + input: + - acl_tag: 1 + tag_name: WEB-IN + state: merged + + # Task output + # ----------- + # + # commands: + # - set vpp acl ip tag-name WEB-IN description 'Inbound web traffic' + # - set vpp acl ip tag-name WEB-IN rule 10 action permit + # - set vpp acl ip tag-name WEB-IN rule 10 protocol tcp + # - set vpp acl ip tag-name WEB-IN rule 10 source prefix 192.0.2.0/24 + # - set vpp acl ip tag-name WEB-IN rule 10 destination prefix 198.51.100.10/32 + # - set vpp acl ip tag-name WEB-IN rule 10 destination port 443 + # - set vpp acl ip tag-name WEB-IN rule 20 action deny + # - set vpp acl ip interface eth1 input acl-tag 1 tag-name WEB-IN + + # Using merged, MAC ACL + + - name: Permit one vendor's MAC addresses on eth1 + vyos.vyos.vyos_vpp_acl: + config: + mac: + acls: + - name: MAC-FILTER + rules: + - number: 10 + action: permit + mac_address: 00:11:22:00:00:00 + mac_mask: ff:ff:ff:00:00:00 + interfaces: + - name: eth1 + tag_name: MAC-FILTER + state: merged + + # Using replaced + + # Before state: + # ------------- + # + # set vpp acl ip tag-name WEB-IN rule 10 action 'permit' + # set vpp acl ip tag-name WEB-IN rule 10 protocol 'tcp' + # set vpp acl ip tag-name WEB-IN rule 20 action 'deny' + + - name: Replace the rules of WEB-IN + vyos.vyos.vyos_vpp_acl: + config: + ip: + acls: + - name: WEB-IN + rules: + - number: 10 + action: permit + state: replaced + + # Task output + # ----------- + # + # commands: + # - delete vpp acl ip tag-name WEB-IN rule 10 protocol + # - delete vpp acl ip tag-name WEB-IN rule 20 + + # Using overridden + + - name: Keep only the WEB-IN ACL and its binding + vyos.vyos.vyos_vpp_acl: + config: + ip: + acls: + - name: WEB-IN + rules: + - number: 10 + action: permit + interfaces: + - name: eth1 + input: + - acl_tag: 1 + tag_name: WEB-IN + state: overridden + + # Using deleted + + - name: Remove the ACL bindings of eth1 and the WEB-IN ACL + vyos.vyos.vyos_vpp_acl: + config: + ip: + acls: + - name: WEB-IN + interfaces: + - name: eth1 + state: deleted + + - name: Delete all dataplane ACL configuration + vyos.vyos.vyos_vpp_acl: + state: deleted + + # Task output (all ACL configuration) + # ----------------------------------- + # + # commands: + # - delete vpp acl + + # Using gathered + + - name: Gather the dataplane ACL configuration + vyos.vyos.vyos_vpp_acl: + state: gathered + + # Using rendered + + - name: Render the commands for a MAC ACL + vyos.vyos.vyos_vpp_acl: + config: + mac: + acls: + - name: MAC-FILTER + rules: + - number: 10 + action: deny + mac_address: 00:11:22:33:44:55 + state: rendered + + # Task output + # ----------- + # + # rendered: + # - set vpp acl mac tag-name MAC-FILTER rule 10 action deny + # - set vpp acl mac tag-name MAC-FILTER rule 10 mac-address 00:11:22:33:44:55 + + # Using parsed + + - name: Parse dataplane ACL configuration from device output + vyos.vyos.vyos_vpp_acl: + running_config: | + set vpp acl ip tag-name WEB-IN rule 10 action 'permit' + set vpp acl ip tag-name WEB-IN rule 10 tcp-flags is-set 'syn' + state: parsed + + # Task output + # ----------- + # + # parsed: + # ip: + # acls: + # - name: WEB-IN + # rules: + # - number: 10 + # action: permit + # tcp_flags: + # is_set: + # - syn + + + +Return Values +------------- +Common return values are documented `here `_, the following are the fields unique to this module: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ after + +
+ dictionary +
+
when changed +
The resulting configuration after module execution.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ before + +
+ dictionary +
+
when state is merged, replaced, overridden or deleted +
The configuration prior to the module execution.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ commands + +
+ list +
+
when state is merged, replaced, overridden or deleted +
The set of commands pushed to the remote device.
+
+
Sample:
+
['set vpp acl ip tag-name WEB-IN rule 10 action permit', 'set vpp acl ip interface eth1 input acl-tag 1 tag-name WEB-IN']
+
+
+ gathered + +
+ dictionary +
+
when state is gathered +
Facts about the network resource gathered from the remote device as structured data.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ parsed + +
+ dictionary +
+
when state is parsed +
The device native config provided in running_config option parsed into structured data as per module argspec.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ rendered + +
+ list +
+
when state is rendered +
The provided configuration in the task rendered in device-native format (offline).
+
+
Sample:
+
['set vpp acl mac tag-name MAC-FILTER rule 10 action deny']
+
+

+ + +Status +------ + + +Authors +~~~~~~~ + +- Evgeny Molotkov (@omnom62)