source (monitor session)

Configures the mirroring parameters.

Syntax

[no] source { ethernet <interface-id> | port-channel <port-channel-id> | vlan { <vlan-id> | <vlan-range> } | ve { <ve-id> | <ve-range> } } destination { ethernet <interface-id> | port-channel <port-channel-id> } direction { rx | tx | both } [ flow-based ]
[no] source { ethernet <interface-id> | port-channel <port-channel-id> vlan { <vlan-id> | <vlan-range> } | ve { <ve-id> | <ve-range> } } destination rspan-vlan <vlan-id> { ethernet <interface-id> | port-channel <port-channel-id> } direction { rx | tx | both } [ flow-based ]
[no] source { ethernet <interface-id> | port-channel <port-channel-id> vlan { <vlan-id> | <vlan-range> } | ve { <ve-id> | <ve-range> } } destination erspan <erspan-id> source-ip <ip-address> destination-ip <ip-address> [ vrf <user-vrf> ] direction { rx | tx | both } [ flow-based ]

Command Default

There are no defaults for these commands

Parameters

ethernet <interface-id>
The source interface ID in the format 0/3.
port-channel <port-channel-id>
The source Port Channel ID.
vlan { <vlan-id> | <vlan-range> }
The VLAN ID or range of VLANs for the source of the traffic. VLAN is only available for use with Flow Based Mirroring.
ve { <ve-id> | <ve-range> }
The VE ID or range of VEs for the source of the traffic. VE is only available for use with Flow Based Mirroring.
destination
Indicates that the configurations following this keyword define the settings for the destination of the mirrored traffic.
rspan-vlan <vlan-id>
This keyword indicates that the mirroring is RSPAN. Provide the VLAN ID for the VLAN to mirror traffic to.
erspan <erspan-id>
This keyword indicates that the mirroring is ERSPAN. Provide a unique ERSPAN ID for this entry.
source-ip <ip-address>
The source IP address for the GRE tunnel. This configuration is only available for ERSPAN mirroring.
destination-ip <ip-address>
The destination IP address for the GRE tunnel. This configuration is only available for ERSPAN mirroring
vrf <user-vrf>
The user created VRF instance. This configuration is only available for ERSPAN mirroring.
direction { rx | tx | both }
Sets the traffic direction to apply mirroring on. You can apply mirroring on ingress, egress, or bi-directional traffic.
flow-based
Indicates that Flow Based Mirroring is being applied. For Flow Based Mirroring to work, it is recommended that ACLs with the mirror action be applied to the source interface before configuring Flow Based Mirroring with this command. Flow Based Mirroring will activate only when ACLs are applied to the source interface.

Modes

Monitor Session Mode

Examples

The following are examples for SPAN mirroring.

The following example shows the configuration of SPAN mirroring from a Port Channel interface to an Ethernet interface. Traffic from both directions is mirrored.

SLX# configure terminal
SLX (config)# interface ethernet 0/2
SLX (conf-if-eth-0/2)# lldp disable
SLX (conf-if-eth-0/2)# exit
SLX (config)# monitor session 23
SLX (config-session-23)# source port-channel 1 destination ethernet 0/1 direction both
            

The following example shows the configuration of mirroring from a Port Channel to a destination that is a Port Channel. Traffic from both directions is mirrored.

SLX# configure terminal
SLX (config)# monitor session 24
SLX (config-session-24)# source port-channel 1 destination port-channel 11 direction both
            

The following are examples of Flow Based Mirroring.

This example displays the complete configuration for Flow Based SPAN mirroring.

SLX # configure terminal
SLX (config)# interface ethernet 0/3
SLX (conf-if-eth-0/3)# lldp disable
SLX (conf-if-eth-0/3)# exit
SLX (config)#ip access-list extended mirror-my-port
SLX (config-ipacl-std)#
SLX (config-ipacl-std)#seq 5 permit ip host 10.10.10.1 any count mirror 
SLX (config-ipacl-std)# exit
SLX (config)# interface ethernet 0/1
SLX (config-eth-0/1)# ip access-group mirror-my-port in 
SLX (config-eth-0/1)# ip access-group mirror-my-port out 
SLX (config-eth-0/1)# exit
SLX (config)# monitor session 25
SLX (config-session-25)# source ethernet 0/1 destination ethernet 0/3 direction both flow-based
SLX (config-session-25)# exit

This examples show a configuration for Flow Based Mirroring from a Port Channel port to an Ethernet port.

SLX (config)# monitor session 26
SLX (config-session-26)# source port-channel 1 destination ethernet 0/3 direction rx flow-based

This example shows a configuration for Flow Based Mirroring from an Ethernet port to a Port Channel port.

SLX (config)# monitor session 27
SLX (config-session-27)# source ethernet 0/1 destination port-channel 3 direction tx flow-based
            

This example shows a configuration for Flow Based Mirroring from a VE to an Ethernet port.

SLX (config)# monitor session 28
SLX (config-session-28)# source ve 1 destination ethernet 0/3 direction both flow-based
            

This example show a configuration for Flow Based Mirroring from a VLAN to an Ethernet port.

SLX (config)# monitor session 29
SLX (config-session-29)# source vlan 100 destination ethernet 0/3 direction tx flow-based
            

The following are examples of RSPAN mirroring.

This example mirrors the ingress traffic on ethernet port 0/1 to the destination RSPAN VLAN through the configured ethernet port.

SLX# configure terminal
SLX (config)# interface ethernet 0/3
SLX (conf-if-eth-0/3)# lldp disable
SLX (conf-if-eth-0/3)# exit
SLX (config)# monitor session 28
SLX (config-session-28)# source ethernet 0/1 destination rspan-vlan 120 ethernet 0/3 direction rx
            

This example shows the configuration of RSPAN mirroring from a source ethernet port to a destination RSPAN VLAN on a port channel.

SLX (config)# monitor session 30
SLX (config-session-30)# source ethernet 0/1 destination rspan-vlan 120 port-channel 2 direction tx
            

The following example shows the complete configuration of Flow Based Mirroring of an ethernet port to a RSPAN VLAN.

SLX # configure terminal
SLX (config)# interface ethernet 0/3
SLX (conf-if-eth-0/3)# lldp disable
SLX (conf-if-eth-0/3)# exit
SLX (config)#ip access-list extended mirror-my-port
SLX (config-ipacl-std)#
SLX (config-ipacl-std)#seq 5 permit ip host 10.10.10.1 any count mirror 
SLX (config-ipacl-std)# exit
SLX (config)# interface ethernet 0/1
SLX (config-eth-0/1)# ip access-group mirror-my-port in 
SLX (config-eth-0/1)# ip access-group mirror-my-port out 
SLX (config-eth-0/1)# exit
SLX (config)# monitor session 25
SLX (config-session-25)# source ethernet 0/1 destination rspan-vlan 120 ethernet 0/3 direction both flow-based
SLX (config-session-25)# exit

The following example shows the configuration of Flow Based Mirroring of a VLAN to a RSPAN VLAN accessible on a port channel.

SLX # configure terminal
SLX (config)#mac access-list extended mirror-my-port
SLX (config-ipacl-std)#
SLX (config-ipacl-std)#seq 5 permit ip host 10.10.10.1 any count mirror 
SLX (config-ipacl-std)# exit
SLX (config)# vlan 100 
SLX (config-vlan-100)# mac access-group mirror-my-port in 
SLX (config-vlan-100)# mac access-group mirror-my-port out 
SLX (config-vlan-100)# exit
SLX (config)# monitor session 31
SLX (config-session-31)# source vlan 100 destination rspan-vlan 120 port-channel 2 direction both flow-based
SLX (config-session-31)# exit

The following are examples of ERSPAN mirroring.

This example configures ERSPAN mirroring of the ingress traffic on ethernet port 0/1 to the destination IP address over GRE.

SLX# configure terminal
SLX (config)# interface ethernet 0/3
SLX (conf-if-eth-0/3)# lldp disable
SLX (conf-if-eth-0/3)# exit
SLX (config)# monitor session 32
SLX (config-session-32)# source ethernet 0/1 destination erspan 1 source-ip 10.10.10.1 
        destination-ip 10.20.20.1 vrf vrf-for-erspan direction both 
            

This example shows the configuration of ERSPAN mirroring from a source port channel port to a destination IP over GRE.

SLX (config)# monitor session 33
SLX (config-session-33)# source port-channel 1 destination erspan 1 source-ip 10.10.10.1 
        destination-ip 10.20.20.1 vrf vrf-for-erspan direction both 
            

This example shows the configuration of ERSPAN mirroring from a VE (ve 1) to an specific destination IP(10.20.20.1). This traffic is directed over IP GRE tunnel with a source IP (10.10.10.1).

SLX (config)# monitor session 34
SLX (config-session-34)# source ve 1 destination erspan 1 source-ip 10.10.10.1 destination-ip 10.20.20.1
        direction rx vrf vrf-for-erspan flow-based
SLX (config-session-34)# exit
            

This example shows the configuration of ERSPAN mirroring from a VLAN (vlan 100) to an specific destination IP(10.20.20.1). This traffic is directed over IP GRE tunnel with a source IP (10.10.10.1).

SLX (config)# monitor session 34
SLX (config-session-34)# source vlan 100 destination erspan 1 source-ip 10.10.10.1 destination-ip 10.20.20.1
        direction rx vrf vrf-for-erspan flow-based
SLX (config-session-34)# exit