Why Your Switch Port Keeps Going Up and Down
I know this error is infuriating. You're trying to keep the network stable, and that port blinking on and off makes you want to throw the switch out the window. I've been there. Let's fix it.
The Fix (Works 9 Times Out of 10)
Start here. Skip the firmware updates and the fancy diagnostics for now. This is what I do first on Cisco, Netgear, Ubiquiti, and even cheap TP-Link switches.
Step 1: Check the Cable (Obvious but Ignored)
Bad cables cause most flapping. Not slightly bad — I mean physically damaged, bent at 90 degrees, or old Cat5 cable from 2002. Replace the cable from the switch to the device with a known good Cat5e or Cat6 cable. Use a cable tester if you have one. If the flapping stops, you're done. If not, move to Step 2.
Step 2: Force the Speed and Duplex
Auto-negotiation fails sometimes, especially on older switches or mixed gear. On Cisco switches, I set the port to 100 Mbps full duplex. Here's the command:
interface GigabitEthernet0/1
speed 100
duplex full
no shutdownOn Netgear or managed switches, log in to the web interface, go to the port settings, and set speed to 100Mbps and duplex to Full. You can try 1Gbps full if your device supports it. But 100 full is safer for older devices.
Step 3: Disable Spanning Tree on That Port (Careful)
If the port is an access port connecting to a single device, not a switch, disable spanning tree for that port. It stops the flapping caused by Spanning Tree Protocol recalculating. On Cisco:
interface GigabitEthernet0/1
spanning-tree portfastThis tells the port to skip the listening and learning phases. Not for ports connecting to other switches though — that can cause loops.
Why It Worked
The cable replacement fixes physical damage. Forcing speed and duplex stops the endless negotiation battle between the switch and the device. And disabling spanning tree on an access port eliminates the delay that makes the port appear down and up. The flapping stops because the link stays stable.
Less Common Variations
Bad Power Supply
I've seen flapping caused by a dying power supply on the switch. The port goes down when the voltage drops, then comes back when it recovers. Check the switch's system log for power warnings. If you see them, replace the power supply.
Loop in the Network
Someone plugged a cable from port 1 to port 2 on the same switch? That creates a loop. The switch detects it and shuts down one port, then recovers, then shuts again. Check for physical loops. Also check if your Spanning Tree is enabled globally. On Cisco: spanning-tree vlan 1.
Faulty SFP Module
If the flapping port uses an SFP (fiber or copper), swap the module. I've seen cheap SFPs flake out after a year. Replace with a good brand like Cisco or Finisar.
MTU Mismatch
Rare but real. If the device sends jumbo frames and the switch expects 1500 bytes, the switch may drop the packet and reset the port. Set MTU the same on both ends. On Cisco: interface GigabitEthernet0/1.
mtu 1500
Prevention
Here's what I do on my networks to avoid this:
- Use good cables. Monoprice or Belden Cat6. Not the cheap ones from Amazon with 3 stars.
- Document your wiring. Label cables so you don't accidentally create loops.
- Enable portfast on all access ports. It's a best practice for Cisco and other managed switches.
- Set a fixed speed and duplex on ports that connect to servers or printers. Auto-negotiate is fine for desktops, but fixed is safer for critical links.
- Monitor your switch logs for port flapping events. Tools like PRTG or LibreNMS can alert you early.
Port flapping is annoying, but it's almost always fixable in 10 minutes. Start with the cable, then the speed, then the STP. Good luck.