Use the following command to configure SPAN to File:
monitor-session <name> [ethernet|ipv4|ipv6|mpls-ipv4|mpls-ipv6]
destination file [size <kbytes>] [buffer-type linear]
The monitor-session <name> [ethernet|ipv4|ipv6|mpls-ipv4|mpls-ipv6]
part of the command creates a monitor-session with the specified name and class and is a pre-existing chain point from the
current SPAN feature. The destination file [size <kbytes>] [buffer-type linear]
part of the command adds a new “file” option to the existing “destination”.
destination file
has the following configuration options:
-
Buffer size.
-
Two types of buffer:
-
Circular: Once the buffer is full, the start is overwritten.
-
Linear: Once the buffer is full, no further packets are logged.
Note
|
The default buffer-type is circular. Only linear buffer is explicitly configurable. Changing any of the parameters (buffer
size or type) recreates the session, and clears any buffers of packets.
|
All configuration options which are applied to an attachment currently supported for other SPAN types should also be supported
by SPAN to file. This may include:
Note
|
These options are implemented by the platform when punting the packet.
|
Once a session has been created, then interfaces may be attached to it using the following configuration:
interface GigabitEthernet 0/0/0/0
monitor-session <name> [ethernet|ipv4|ipv6|mpls-ipv4|mpls-ipv6]
The attachment configuration is unchanged by SPAN to File feature.
Configuration Examples
To configure a mon1
monitor session, use the following commands:
monitor-session mon1 ethernet
destination file size 230000
!
In the above example, omitting the buffer-type
option results in default circular buffer.
To configure a mon2
monitor session, use the following commands:
monitor-session mon2 ethernet
destination file size 1000 buffer-type linear
!
To attach monitor session to a physical or bundle interface, use the following commands:
interface Bundle-Ether1
monitor-session ms7 ethernet
!
Running Configuration
!! IOS XR Configuration 7.1.1.124I
!! Last configuration change at Tue Nov 26 19:29:05 2019 by root
!
hostname OC
logging console informational
!
monitor-session mon1 ethernet
destination file size 230000 buffer-type circular
!
monitor-session mon2 ethernet
destination file size 1000 buffer-type linear
!
interface Bundle-Ether1
monitor-session ms7 ethernet
end
Verification
To verify packet collection status:
RP/0/RP0/CPU0:router#show monitor-session status
Monitor-session mon1
Destination File - Packet collecting
=============================================
Source Interface Dir Status
--------------------- ---- ------------------
Hu0/9/0/2 Rx Operational
Monitor-session mon2
Destination File - Packet collecting
=========================================
Source Interface Dir Status
--------------------- ---- --------------
BE2.1 Rx Operational
If packet collection is not active, the following line is displayed:
Monitor-session mon2
Destination File - Not collecting