Skip to content
Ask AI

Network Monitoring Configuration Guide

Port mirroring allows users to use the data monitoring device to analyze the copied messages for network monitoring and troubleshooting by copying messages from a specified port to a port connected to the data monitoring device.

  • Mirror source is the object being monitored, i.e., the port that receives and sends the messages that need to be monitored, called the source port.
  • The mirroring destination is the destination to which the mirroring message is destined, i.e., the port connected to the data monitoring device, called the destination port.
  • Mirror direction refers to which direction messages can be copied on the mirror source:
  • Inbound direction: is to copy only copy the messages received by the mirror source.
  • Outbound direction: is to copy only the messages sent by the mirror source.
  • Bidirectional: is to copy both the received and outgoing messages of the mirror source.

Network requirements

Device A and another Device on the network communication abnormalities, the need to mirror the Device connected to the external network interface Ethernet8 to analyze the sending and receiving of messages, mirroring the destination port is connected to the server Ethernet9 port.

Procedure

# Create a mirror group, specify the mirror source as Ethernet8, the mirror destination as Ethernet9, and the mirror direction as bidirectional.

sonic(config)# mirror session 1 span direction both dst-ethernet 9 src-ethernet 8

Verify configuration

1.View configuration

sonic# show mirror session
+----------------+------------------+-------------+--------+------------+
| Session Name | Destination Port | Source Port | Type | Direction |
+================+==================+=============+========+============+
| 1 | Ethernet9 | Ethernet8 | SPAN | BOTH |
+----------------+------------------+-------------+--------+------------+

2.Capture packets on the server to view, and so on to capture all the messages sent and received on Ethernet port 8.

IPFIX (IP Flow Information Export) is a standard protocol for collecting and exporting network traffic information, designed to provide a universal, scalable way to describe and transmit network traffic information. With IPFIX, network administrators can collect detailed information about network traffic, such as source IP address, destination IP address, port number, traffic byte count, connection duration, etc., for use in network monitoring, billing, traffic engineering, security analysis, and other scenarios.

OperationCommandDescription
Enter the system configuration viewconfigure terminal
Create and enter the ipfix exporter viewipfix exporter
Configure destination ip of the ipfix packetdip <A.B.C.D>
Configure domain_id of ipfix packetsdomain_id
Configure the destination port of ipfix packetsdport
Configure MTU of ipfix packetspath_mtu
Configure the source ip of ipfix packetssip <A.B.C.D>
Configure the source port of ipfix packetssport
Configure the transmission interval for ipfix template packetstemplate_interval
Configure the vrf of ipfix packet output portvrf
OperationCommandDescription
Enter the system configuration viewconfigure terminal
Create and enter the ipfix monitor-map viewipfix monitor-map
Bind exporter to monitorexporter
Set the depth of analyzed messagesrecord {l2|l3|l4|all}
Set the active time of a session streamtimeout_active
Set the timeout for session flowtimeout_passive
OperationCommandDescription
Enter the system configuration viewconfigure terminal
Enter the interface configuration viewinterface ethernet
Set the monitor interfaceipfix monitor {ip4|ip6|l2} {both|rx|tx}
OperationCommandDescription
Display ipfix exporter configurationshow ipfix exporter-
Display ipfix monitor-map configurationshow ipfix monitor-
Display ipfix port-map configurationshow ipfix port-map

Network requirements

Users collect traffic sent and received from Ethernet port 5 via Ethernet port 16.

Procedure

sonic(config)# interface ethernet 16
sonic(config-if-16)# ip address 192.85.3.1/24
sonic(config)# ipfix exporter test
sonic(config-ipfix-exporter-test)# dip 192.85.3.100
sonic(config-ipfix-exporter-test)# domain_id 10
sonic(config-ipfix-exporter-test)# path_mtu 1000
sonic(config-ipfix-exporter-test)# sip 1.1.1.1
sonic(config-ipfix-exporter-test)# template_interval 60
sonic(config)# ipfix monitor-map test1
sonic(config-ipfix-monitor-map-test)# exporter test
sonic(config-ipfix-monitor-map-test)# record all
sonic(config-ipfix-monitor-map-test)# timeout_active 60
sonic(config-ipfix-monitor-map-test)# timeout_passive 120
sonic(config)# interface ethernet 5
sonic(config-if-5)# ip address 80.0.0.1/24
sonic(config-if-5)# ipfix monitor test l2 both