Enable port mirroring on a FortiSwitch

Reading Time: < 1 minute

The FortiSwitch unit can send a copy of any ingress or egress packet on a port to egress on another port of the same FortiSwitch unit. The original traffic is unaffected. This process is known as port-based mirroring and is typically used for external analysis and capture.

The following commands configure a FortiSwitch to send a copy of all incoming and outgoing traffics on port interface 2 and 3 to the port interface 1 which is the one on which you will connect your ethernet cable to capture the data.

config switch-controller managed-switch
    edit S513DE4P15010494
     config mirror
      edit bProbe
       set status active
       set dst port1
       set switching-packet enable
       set src-ingress port2 port3
       set src-egress port2 port3
      next
     end
    next
Note S513DE4P15010494 is the FortiSwitch serial number need to connect to the right device, bProbe is the name we give to this configuration. port1 represent our destination port, the port2 and port3, the ports we want to capture a copy of traffic from.