Monitor Session
Traffic mirroring (SPAN) sessions supports local SPAN (port mirroring to a physical interface), ERSPAN (mirroring over GRE tunnels), PW-SPAN (mirroring over MPLS pseudowires), and SPAN-to-File (packet capture to disk). Global session definitions control the destination and mirroring properties, while per-interface attachments specify which source interfaces participate in each session.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (iosxr.devices)
Section titled “configuration (iosxr.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| monitor_sessions | Class | [monitor_sessions] | No |
monitor_sessions (iosxr.devices.configuration)
Section titled “monitor_sessions (iosxr.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| default_capture_disable | Boolean | true, false | No | |
| local_capture | Class | [local_capture] | No | |
| router_id | Integer | min: 1, max: 255 | No | |
| sessions | List | [sessions] | No |
local_capture (iosxr.devices.configuration.monitor_sessions)
Section titled “local_capture (iosxr.devices.configuration.monitor_sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| size | Integer | min: 1, max: 4294967295 | No | |
| unit | Choice | gb, kb, mb | No |
sessions (iosxr.devices.configuration.monitor_sessions)
Section titled “sessions (iosxr.devices.configuration.monitor_sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| destination_file | Class | [destination_file] | No | |
| destination_interface | String | No | ||
| destination_pseudowire | Boolean | true, false | No | |
| direction | Choice | rx, tx | No | |
| discard_class | Integer | min: 0, max: 2 | No | |
| drops | Class | [drops] | No | |
| inject_interface | String | No | ||
| mirror_first | Integer | min: 1, max: 10000 | No | |
| mirror_interval | Choice | 128, 16, 16K, 1K, 2, 256, 2K, 32, 4, 4K, 512, 64, 8, 8K | No | |
| protocol_capture | Class | [protocol_capture] | No | |
| rate_limit_rx | Integer | min: 0, max: 4294967295 | No | |
| rate_limit_tx | Integer | min: 0, max: 4294967295 | No | |
| traffic_class | Integer | min: 0, max: 7 | No | |
| type | Choice | ethernet, ipv4, ipv6, mpls-ipv4, mpls-ipv6 | No |
destination_file (iosxr.devices.configuration.monitor_sessions.sessions)
Section titled “destination_file (iosxr.devices.configuration.monitor_sessions.sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| always_on | Boolean | true, false | No | |
| buffer_type | Choice | linear | No | |
| filter | String | No | ||
| format | Choice | pcapng | No | |
| size | Integer | min: 1, max: 16777216 | No |
drops (iosxr.devices.configuration.monitor_sessions.sessions)
Section titled “drops (iosxr.devices.configuration.monitor_sessions.sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| direction | Choice | rx, tx | No | |
| filter | String | No | ||
| packet_processing | Boolean | true, false | No | |
| traffic_management | Boolean | true, false | No |
protocol_capture (iosxr.devices.configuration.monitor_sessions.sessions)
Section titled “protocol_capture (iosxr.devices.configuration.monitor_sessions.sessions)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| direction | Choice | rx, tx | No | |
| filter | String | No |
Example YAML Code:
Section titled “Example YAML Code:”Example-1: Local SPAN session mirroring to a physical interface.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: monitor_sessions: sessions: - name: SPAN1 direction: rx destination_interface: GigabitEthernet0/0/0/2 mirror_first: 256 discard_class: 1 traffic_class: 5 interfaces: ethernets: - type: GigabitEthernet id: 0/0/0/1 monitor_sessions: - name: SPAN1 direction: rx-onlyExample-2: SPAN-to-File with packet capture and drops monitoring.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: monitor_sessions: router_id: 1 default_capture_disable: true local_capture: size: 500 unit: mb sessions: - name: CAPTURE1 destination_file: size: 1024 buffer_type: linear format: pcapng always_on: true drops: packet_processing: true direction: rxExample-3: Per-direction (rx-only) session with ACL filtering and rate limiting.
iosxr: devices: - name: router-1 host: 10.10.10.1:57400 configuration: monitor_sessions: sessions: - name: MON-RX direction: rx destination_interface: GigabitEthernet0/0/0/2 rate_limit_tx: 1000000 rate_limit_rx: 1000000 interfaces: ethernets: - type: GigabitEthernet id: 0/0/0/1 monitor_sessions: - name: MON-RX direction: rx-only ipv4_acl: SPAN-ACL ipv6_acl: ACL2