OcNOS-RON : System Management Guide : System Management Configuration Guide : Traffic Mirroring Configuration : Port Mirroring Configuration
Port Mirroring Configuration
This example shows detailed configuration of port mirroring.
 
#configure terminal
Enter configure mode.
(config)#bridge 1 protocol mstp
Configure bridge 1 as MSTP bridge.
(config)#vlan 101-110 bridge 1 state enable
Configure VLANs.
(config)#interface xe10
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#bridge-group 1
Associate bridge to an interface.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan add 101-110
Allow VLANs 101-110 on the interface.
(config-if)#no shutdown
Make interface admin up.
(config-if)#exit
Exit interface mode.
(config)#interface xe20
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#bridge-group 1
Associate bridge to an interface.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan add 101-110
Allow VLANs 101-110 on the interface.
(config-if)#no shutdown
Make interface admin up.
(config-if)#exit
Exit interface mode.
(config)#interface xe5
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#exit
Exit interface mode.
(config)#monitor session 1
Enter monitor session configuration mode
(config-monitor)#destination interface xe5
Configure the interface as destination port
(config-monitor)#source interface xe10 both
Configure the source interface to mirror ingress as well as egress direction traffic
(config-monitor)#no shut
Activate monitor session
(config-monitor)#end
Exit monitor session configuration mode
Validation
Enter the below commands to confirm the configurations.
#show running-config monitor
!
monitor session 1
source interface xe10 both
destination interface xe5
no shut
 
#show monitor session all
session 1
---------------
type : local
state : up
source intf :
tx : xe10
rx : xe10
both : xe10
source VLANs :
rx :
destination ports : xe5
filter count :
 
Legend: f = forwarding enabled, l = learning enabled
If monitor session configured with two source interface as egress direction (tx) then the destination port will receive only one copy of the egressed packet
.
#configure terminal
Enter configure mode.
(config)#bridge 1 protocol mstp
Configure bridge 1 as MSTP bridge.
(config)#vlan 101-110 bridge 1 state enable
Configure VLANs.
(config)#interface xe10
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#bridge-group 1
Associate bridge to an interface.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan add 101-110
Allow VLANs 101-110 on the interface.
(config-if)#no shutdown
Make interface admin up.
(config-if)#exit
Exit interface mode.
(config)#interface xe20
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#bridge-group 1
Associate bridge to an interface.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan add 101-110
Allow VLANs 101-110 on the interface.
(config-if)#no shutdown
Make interface admin up.
(config-if)#exit
Exit interface mode.
(config)#interface xe30
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#bridge-group 1
Associate bridge to an interface.
(config-if)#switchport mode trunk
Configure port as a trunk.
(config-if)#switchport trunk allowed vlan add 101-110
Allow VLANs 101-110 on the interface.
(config-if)#no shutdown
Make interface admin up.
(config-if)#exit
Exit interface mode.
(config)#interface xe5
Enter interface mode.
(config-if)#switchport
Configure interface as a layer 2 port.
(config-if)#exit
Exit interface mode.
(config)#monitor session 1
Enter monitor session configuration mode
(config-monitor)#destination interface xe5
Configure the interface as destination port
(config-monitor)#source interface xe10 tx
Configure the source interface to mirror egress direction traffic
(config-monitor)#source interface xe30 tx
Configure the source interface to mirror egress direction traffic
(config-monitor)#no shut
Activate monitor session
(config-monitor)#end
Exit monitor session configuration mode
Validation
#show running-config monitor
!
monitor session 1
source interface xe10 tx
source interface xe30 tx
destination interface xe5
no shut
 
#show monitor session all
session 1
---------------
Type : local
State : up
source intf :
tx : xe10 xe30
rx :
both :
source VLANs :
rx :
destination ports : xe5
filter count :
Legend: f = forwarding enabled, l = learning enable
Send 10 frames from xe20 packets egress via xe10 and xe30, then on mirror destination port only 10 packets are received.
Last modified date: 08/28/2023