Command Line Reference
Ethernet Switching
Loopback Detection Configuration
13 min
loopback detection configuration show loopback detection config \[command] show loopback detection config \[purpose] view interface loopback detection status configuration information \[view] system view \[ use cases ] sonic# show loopback detection config packets interval time 30 (sec) log interval time 0 (sec) port/vlan action recovery time status \ vlan55 enable show loopback detection status \[command] show loopback detection config \[purpose] view interface loopback detection interface status information \[view] system view \[ use cases ] sonic# show loopback detection status you can re up err down ports one by one by "no shutdown" under interface config, re up all by "clear loopback detection", or configure "loopback detection recovery time" for automatic recovery loopback is detected port status caused by time \ ethernet57 shutdown ethernet61,vlan55 00 00 04 ethernet61 shutdown ethernet57,vlan55 00 00 04 loopback detection interval time \[command] loopback detection interval time interval \[purpose] configure interface loopback detection packet transmission interval \[parameter] parameter description interval value range 10 300, unit in seconds default value is 30 \[view] system configuration view \[usage scenario] this command configures the interval for periodically sending loopback detection packets users can adjust the loopback detection packet transmission interval based on network conditions a shorter interval results in more loopback detection packets being sent per unit of time, leading to more accurate interface loopback responses, but also consuming more system resources \[ use cases ] sonic(config)# loopback detection interval time 10 loopback detection log time \[command] loopback detection log time interval \[purpose] configure the interface loopback detection alarm message transmission interval \[parameter] parameter description interval value range 10 300, unit in seconds default value is 0 \[view] system configuration view \[usage scenario] this command configures the interface loopback detection alarm message transmission interval, which specifies the period at which the information of disabled interfaces is printed when the default value is 0, it means that the warning message will not be printed repeatedly \[ use cases ] sonic(config)# loopback detection log time 10 loopback detection enable \[command] loopback detection enable \[purpose] enable the loopback detection feature \[view] interface view、vlan view \[usage scenario] network loops can cause devices to repeatedly send broadcast, multicast, and unknown unicast packets, leading to network resource waste and even network paralysis to detect loops in a layer 2 network in real time and prevent serious impacts on the entire network, a detection technology is needed this technology should notify users promptly to check network connections and configurations when a loop is detected, and allow for placing the problematic interface into a controlled state loopback detection is such a detection technology it works by periodically sending detection packets from the interface, checking whether the packets return to the device (without requiring the same interface for both sending and receiving) this helps determine if there is a loop in the interface, the network or device connected to the device, or between two interfaces on the device upon detecting a loop, the loopback detection function triggers an alarm, logs the event, and, based on user configured settings, processes the interface (by default, disabling it) this places the interface into a controlled state, reducing the impact of the loop on the device and the entire network \[commit] configurations in the vlan view apply to all ports within the specified vlan, while configurations in the interface view apply only to the current port \[ use cases ] sonic(config)# vlan 10 sonic(config vlan 10)# loopback detection enable loopback detection action \[command] loopback detection action {logging|shutdown} \[purpose] configure the loopback detection handling action for the interface \[parameter] parameter description logging the interface only reports an alarm shutdown the interface is shut down \[view] interface view \[usage scenario] after enabling interface loopback detection, the interface will periodically check if it sends a loopback when the device detects a loop on the interface, the configuration set by this command can be used to take action on the interface, quickly minimizing the impact of the loop on the entire network notes when the device detects a loop, it will automatically bring down the interface that received the detection packet however, the poe power supply to the interface will not be affected \[ use cases ] sonic(config)# interface ethernet 57 sonic(config if 57)# loopback detection action logging loopback detection recovery time \[command] loopback detection recovery time interval \[purpose] configure the time for the interface to automatically recover to normal state after detecting a loopback \[parameter] parameter description interval value range 10 65535, unit in seconds \[view] interface view \[usage scenario] after enabling interface loopback detection, the interface will periodically send loopback detection packets upon detecting a loop, the configured action will be applied to the interface, and a timer will start users can configure the interface recovery time after the specified recovery time, the system will attempt to recover the interface if the loop is cleared by that time, the interface will be restored to its normal state \[ use cases ] sonic(config)# interface ethernet 57 sonic(config if 57)# loopback detection recovery time 60 clear loopback detection \[command] clear loopback detection \[purpose] clear loopback detection information and enable all interfaces that are in a shutdown state \[view] system view \[usage scenario] when the loopback detection action is set to shutdown, after the loop is cleared, the interfaces that were error disabled cannot automatically recover you must manually execute the shutdown and no shutdown commands to restore the interface alternatively, you can use the clear loopback detection command to restart all interfaces that were shutdown \[ use cases ] sonic# clear loopback detection
