SPAN
SPAN (Switched Port Analyzer) configuration manages monitor sessions for traffic mirroring on NX-OS devices. Supports local SPAN sessions that mirror traffic to a local destination port, and ERSPAN sessions that encapsulate mirrored traffic in GRE and send it to a remote destination IP. Each session can specify source interfaces, source VLANs, filter VLANs, and various ERSPAN-specific parameters.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (nxos.devices)
Section titled “configuration (nxos.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| monitor_sessions | List | [monitor_sessions] | No |
system (nxos.devices.configuration)
Section titled “system (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| erspan_origin_ip_address | IP | No |
monitor_sessions (nxos.devices.configuration)
Section titled “monitor_sessions (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | Integer | min: 1, max: 32 | Yes | |
| type | Choice | local, erspan-source, erspan-destination | No | |
| shutdown | Boolean | true, false | No | |
| description | String | No | ||
| destination_interface_type | Choice | ethernet, loopback, mgmt, port-channel, vlan, vni | No | |
| destination_interface_id | Any | String or Integer[min: 0] | No | |
| filter_access_group | String | No | ||
| mtu | Integer | min: 64, max: 10240 | No | |
| erspan_id | Integer | min: 0, max: 1023 | No | |
| destination_ip | IP | No | ||
| destination_ipv6 | IP | No | ||
| source_ip | IP | No | ||
| source_ipv6 | IP | No | ||
| ip_dscp | Integer | min: 0, max: 63 | No | |
| ip_ttl | Integer | min: 1, max: 255 | No | |
| vrf | String | No | ||
| header_type | Choice | 2, 3, 3-rfc-compliant | No | |
| source_forward_drops | Choice | none, rx, tx, both | No | |
| marker_packet | Boolean | true, false | No | |
| marker_packet_interval | Integer | min: 1, max: 1000 | No | |
| source_interfaces | List | [source_interfaces] | No | |
| source_vlans | List | [source_vlans] | No | |
| filter_vlans | Class | [filter_vlans] | No |
source_interfaces (nxos.devices.configuration.monitor_sessions)
Section titled “source_interfaces (nxos.devices.configuration.monitor_sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| interface_type | Choice | ethernet, loopback, mgmt, port-channel, vlan, vni | Yes | |
| interface_id | Any | String or Integer[min: 0] | Yes | |
| direction | Choice | rx, tx, both | No |
source_vlans (nxos.devices.configuration.monitor_sessions)
Section titled “source_vlans (nxos.devices.configuration.monitor_sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| vlans | Class | [vlans] | Yes | |
| direction | Choice | rx, tx, both | No |
filter_vlans (nxos.devices.configuration.monitor_sessions)
Section titled “filter_vlans (nxos.devices.configuration.monitor_sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ids | List | Integer[min: 1, max: 4094] | No | |
| ranges | List | [ranges] | No |
vlans (nxos.devices.configuration.monitor_sessions.source_vlans)
Section titled “vlans (nxos.devices.configuration.monitor_sessions.source_vlans)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ids | List | Integer[min: 1, max: 4094] | No | |
| ranges | List | [ranges] | No |
ranges (nxos.devices.configuration.monitor_sessions.filter_vlans)
Section titled “ranges (nxos.devices.configuration.monitor_sessions.filter_vlans)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| from | Integer | min: 1, max: 4094 | Yes | |
| to | Integer | min: 1, max: 4094 | Yes |
Examples
Section titled “Examples”Example 1: Local SPAN session mirroring Ethernet1/1 traffic to Ethernet1/2
nxos: devices: - name: LEAF1 configuration: monitor_sessions: - id: 1 type: local description: "Mirror server traffic" shutdown: false destination_interface_type: ethernet destination_interface_id: "1/2" source_interfaces: - interface_type: ethernet interface_id: "1/1" direction: bothExample 2: Local SPAN with source VLANs and filter VLANs
nxos: devices: - name: LEAF1 configuration: monitor_sessions: - id: 2 type: local description: "Monitor VLAN traffic" shutdown: false destination_interface_type: ethernet destination_interface_id: "1/48" mtu: 9000 filter_access_group: "SPAN-FILTER" source_vlans: - vlans: ids: [100] direction: rx - vlans: ids: [200] direction: rx filter_vlans: ids: [100, 200]Example 3: ERSPAN source session with global origin IP
nxos: devices: - name: SPINE1 configuration: system: erspan_origin_ip_address: 10.0.0.1 monitor_sessions: - id: 3 type: erspan-source description: "ERSPAN to remote analyzer" shutdown: false erspan_id: 100 destination_ip: "10.1.1.1" ip_dscp: 10 ip_ttl: 64 vrf: default header_type: "3" source_interfaces: - interface_type: ethernet interface_id: "1/1" direction: both - interface_type: ethernet interface_id: "1/2" direction: rx