HowTo Configure Port Mirroring on Mellanox Ethernet Switches

Version 6

    This post shows how to setup port mirroring on Mellanox Ethernet switches.


    >>Learn for free about Mellanox solutions and technologies in the Mellanox Online Academy



    • MLNX-OS User Manual








    In terms of naming terminology:

    • The source interface is the Ethernet port on the switch that the traffic will be copied from
    • The destination interface is the Ethernet port on the switch that the data traffic will be mirrored to so that tcpdump’s can be captured.


    Switch Configuration


    switch (config) # interface ethernet 1/3 shutdown

    switch (config) # monitor session 1

    switch (config monitor session 1) # add source interface ethernet 1/1 direction both

    switch (config monitor session 1) # destination interface ethernet 1/3

    switch (config monitor session 1) # no shutdown

    switch (config monitor session 1) # exit

    switch (config) # interface ethernet 1/3 no shutdown



    For more configuration options, refer to the MLNX-OS User Manual.



    Run the following commands on the switch:

    1. Show monitor session

    switch (config) # show monitor session 1

    Admin:  Enable

    Status: Up

    Truncate:   Disable

    Destination interface: eth1/3

    Congestion type: drop-excessive-frames

    Header format: local

               -traffic class: 0


    Source interfaces

    Interface  direction


    eth1/1    both


    2. Show monitor session summary.

    Make sure that the session is up and enabled.

    switch (config) # show monitor session summary


    Flags : i ingress, e egress, b both

    Session  Admin   Status  Mode       Destination  Source

    1        Enable  Up      local      eth1/3      eth1/1(b)



    3. Start tcpdump on the analyzer host connected to switch destination port (e.g. 1/3) and run some traffic from the source host.


    Analyzer# tcpdump -nnvvXSs 1514 -i eth2 -w myDump.pcap

    Server-A# ping -c 1




    Server-B# ping  -c 1


    Then, pull ‘myDump.pcap’ from the analyzer host into Wireshark to analyze the data traffic.