fortiswitch_switch_mirror – Packet mirror in Fortinet’s FortiSwitch
New in version 1.0.0.
Synopsis
This module is able to configure a FortiSwitch device by allowing the user to set and modify switch feature and mirror category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v7.0.0
Requirements
The below requirements are needed on the host that executes this module.
ansible>=2.14
FortiSW Version Compatibility
Supported Version Ranges | |
fortiswitch_switch_mirror | v7.0.0 -> latest |
Parameters
- enable_log - Enable/Disable logging for task. type: bool required: false default: False
- member_path - Member attribute path to operate on. type: str
- member_state - Add or delete a member under specified attribute path. type: str choices: present, absent
- state - Indicates whether to create or remove the object. type: str required: true choices: present, absent
- switch_mirror - Packet mirror. type: dict
- dst - Destination interface. type: str
- encap_gre_protocol - Protocol value in the ERSPAN GRE header. type: int
- encap_ipv4_src - IPv4 source address in the ERSPAN IP header. type: str
- encap_ipv4_tos - TOS, or DSCP and ECN, values in the ERSPAN IP header. type: int
- encap_ipv4_ttl - IPv4 time-to-live value in the ERSPAN IP header. type: int
- encap_mac_dst - Nexthop/Gateway MAC address on the path to the ERSPAN collector IP. type: str
- encap_mac_src - Source MAC address in the ERSPAN ethernet header. type: str
- encap_vlan - Control the tagged/untagged status of ERSPAN encapsulation headers. type: str choices: tagged, untagged
- encap_vlan_cfi - CFI or DEI bit in the ERSPAN or RSPAN VLAN header. type: int
- encap_vlan_id - VLAN ID in the ERSPAN or RSPAN VLAN header. type: int
- encap_vlan_priority - Priority code point value in the ERSPAN or RSPAN VLAN header. type: int
- encap_vlan_tpid - TPID in the ERSPAN or RSPAN VLAN header. type: int
- erspan_collector_ip - ERSPAN collector IP address. type: str
- mode - Mirroring mode. type: str choices: SPAN, RSPAN, ERSPAN-manual, ERSPAN-auto, RSPAN-manual, RSPAN-auto
- name - Mirror session name. type: str required: true
- rspan_ip - RSPAN destination IP address. type: str
- src_egress - Source egress interfaces. type: list
- name - Interface name. type: str
- src_ingress - Source ingress interfaces. type: list
- name - Interface name. type: str
- status - Status. type: str choices: active, inactive
- strip_mirrored_traffic_tags - Enable/disable stripping of VLAN tags from mirrored traffic. type: str choices: enable, disable
- switching_packet - Enable/disable switching functionality when mirroring. type: str choices: enable, disable
Examples
- name: Packet mirror.
fortinet.fortiswitch.fortiswitch_switch_mirror:
state: "present"
switch_mirror:
dst: "<your_own_value> (source switch.interface.name)"
encap_gre_protocol: "4"
encap_ipv4_src: "<your_own_value>"
encap_ipv4_tos: "6"
encap_ipv4_ttl: "7"
encap_mac_dst: "<your_own_value>"
encap_mac_src: "<your_own_value>"
encap_vlan: "tagged"
encap_vlan_cfi: "11"
encap_vlan_id: "12"
encap_vlan_priority: "13"
encap_vlan_tpid: "14"
erspan_collector_ip: "<your_own_value>"
mode: "SPAN"
name: "default_name_17"
rspan_ip: "<your_own_value>"
src_egress:
-
name: "default_name_20 (source switch.physical-port.name)"
src_ingress:
-
name: "default_name_22 (source switch.physical-port.name)"
status: "active"
strip_mirrored_traffic_tags: "enable"
switching_packet: "enable"
Return Values
Common return values are documented: https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values, the following are the fields unique to this module:
- build - Build number of the fortiSwitch image returned: always type: str sample: 1547
- http_method - Last method used to provision the content into FortiSwitch returned: always type: str sample: PUT
- http_status - Last result given by FortiSwitch on last operation applied returned: always type: str sample: 200
- mkey - Master key (id) used in the last call to FortiSwitch returned: success type: str sample: id
- name - Name of the table used to fulfill the request returned: always type: str sample: urlfilter
- path - Path of the table used to fulfill the request returned: always type: str sample: webfilter
- serial - Serial number of the unit returned: always type: str sample: FS1D243Z13000122
- status - Indication of the operation's result returned: always type: str sample: success
- version - Version of the FortiSwitch returned: always type: str sample: v7.0.0
Status
This module is not guaranteed to have a backwards compatible interface.