HowTo Configure Port Mirroring on Mellanox Ethernet Switches

Version 5

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

     

    References

    • MLNX-OS User Manual

     

    Setup

    1%3Fauth_token%3Dac925677a8f777b0d5dc18535b2e9c491f4192f7

     

     

    Configuration

     

    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.

     

    Verification

    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 11.11.11.2 -c 1

     

    And/or

     

    Server-B# ping 11.11.11.1  -c 1

     

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