Port Mirroring Configuration I Table of Contents Table of Contents Chapter 1 Port Mirroring Configuration........................................................................................................1 1.1 Configuring Port Mirroring Task List.............................................................................................. 1 1.2 Configuring Port Mirroring Task......................................................................................................1 1.2.1 Configuring port mirroring....................................................................................................1 1.2.2 Displaying port mirroring information.................................................................................2 1.3 Remote Mirroring Configuration Example.................................................................................... 2 II Port Mirroring Configuration Chapter 1 Port Mirroring Configuration 1.1 Configuring Port Mirroring Task List  Configuring port mirroring  Displays port mirroring information 1.2 Configuring Port Mirroring Task 1.2.1 Configuring port mirroring In order to make switch management easy, you can set port mirror and use a port of the switch to observe the flux that runs through a group of ports. Port mirroring could be divided like local mirroring and remote mirroring. Local mirroring means copying message to this device’s port, and remote mirroring function means transferring message to remote device across multiple network devices. Port mirroring is configured by the way of mirroring group, and relative concepts include port, destination port, remote mirroring VLAN, remote mirroring TPID, VLAN DISABLE-LEARNING and etc. In the remote mirroring, the local device would add a vlan tag in the mirroring message. Messages from different mirroring’s remote groups are detected by setting the tag’s vid (remote mirroring vlan) and tpid. In order to achieve remote mirroring function, it is required that the middle device could transfer messages within remote mirroring’s vlan to remote device. Remote mirroring’s schemetic plot is like following: Configuring remote mirroring function on source device, and mirroring source port’s message to the output port while adding configuring RSPAN TAG on the message. Vlan id in this tag is the remote mirroring VLAN. Middle device transfer mirroring message to the destination port by broadcasting. The destination device transfer message from 1 Port Mirroring Configuration destination port to data monitoring device by configuration. If the destination device supports port mirroring function, the message could be transferred from destination port to data monitoring device by configuring local mirroring. If the destination device supports the configuration of mac address learning based on vlan, the message could be transferred to data monitoring device by shutting down remote mirroring vlan address learning. If the destination device’s qos policy mapping supports the matching of vlan, the message could be transferred to monitoring device by qos policy mapping. Enter the EXEC mode and perform the following steps to configure port mirroring: Command Purpose config Enters the global configuration mode. mirror session session_number {destination To set port mirror, run this command. {interface interface-id} { rspan vid tpid} | session-number is the number of the port source {interface interface-id [, | -] rx | tx | mirroring. both] } destination is the destination port of the mirroring. VID is the tag of remote mirroring TPID is the tag of remote mirroring source is the source port of mirroring. rx means the data flow of mirroring. rx means the input data of mirroring. tx means the output data of mirroring, both means both mirroring exit Goes back to the EXEC mode. write Saves the settings. 1.2.2 Displaying port mirroring information To display the configuration information about port mirroring, run the following command: Command Purpose show mirror [session session_number] Displays the configuration information about port mirroring session-number means the number of the port mirroring. 1.3 Remote Mirroring Configuration Example The network topology is shown in the following figure: 2 Port Mirroring Configuration You need to monitor the traffic of interface g0/1 on switch a and interface g0/1 on switch b by the network analysis meter. Configure as follows by the remote mirroring: switch a: mirror session 1 destination interface g0/3 rspan 100 0x8100 mirror session 1 source interface g0/1 both switch b: mirror session 1 destination interface g0/3 rspan 1000 0x8100 mirror session 1 source interface g0/1 both switch c: interface GigaEthernet0/1 switchport mode trunk ! interface GigaEthernet0/2 3 Port Mirroring Configuration switchport mode trunk ! interface GigaEthernet0/3 switchport mode trunk ! ! vlan 1,100,1000 ! switch d: mirror session 1 destination interface g0/2 mirror session 1 source interface g0/1 both 4