How to power cycle the switch?

A trunk CAT5 cable that goes between two Linksys EA8500 (configured as APs) was possibly damaged during renovations, and now intermittently "stops working." Unfortunately the cable is now hidden behind multiple walls and is impossible to replace.

When it stops working, port LEDs stay solid ON on both sides, and swconfig reports link:up on both sides, but pings are unreachable. To fix this I either have to reboot one of the two APs, or unplug and replug the affected cable from either side.

I would like to automate this by running a ping script that automatically power cycles the port or the entire switch when the link becomes unusable. So far I have tried the following but none has the same effect as physically unplugging the cable:

swconfig dev switch0 set reset 1 # (followed by reconfiguration of vlans and then "set apply")
/etc/init.d/network restart
ifconfig eth0 down;sleep 1s;ifconfig eth0 up

Is there anyway to completely power cycle the port, or the switch?

Ideas and hints are highly appreciated.

Maybe it's too complicated, but you could take a cheap switch and switch it on/off with a wifi-plug.

you could do a reboot if enough pings are lost, or implement a watchdog.

only set it up on one side, not both, or they might get stuck in a dual side boot loop :slight_smile:

If you supect a bad cable, you could try stepping down from 1gbit to 100mbit,
1gb uses all 8 pins in the cable, 100mbit only uses 4.

Or replace it by using the old one to pull in a new one.

2 Likes

May I suggest testing the same devices with another CAT5 cable (move one of them for the sake of experiment), leaving them for same time and see if the priblem will occur.

It's just I can't understand how a cable can intermittently work if left untouched. Maybe you could also use a cable tester?

2 Likes

Thanks for the ideas.

I've already setup a watchdog script that counts the number of pings lost, but since its takes 2 to 3 minutes for the 5ghz radio to come back online, I was hoping to avoid a full reboot.

Unfortunately the cable is so damaged that it is already running at 100Mbps. Anyway I couldn't figure out how one could specify link speed using openwrt (swconfig port link property is read only) -- may be it's not supported by the driver/hardware?

If there isn't any viable software based solution, I'll consider the smart switch solution, or may be even a relay powered by the router's USB port. Thanks for the idea!

ethtool is used for setting link speeds, etc.

Unfortunately for this particular router all 5 ports (including the WAN) are connected to one single switch and interface (eth0).

I may be wrong, but it seems that ethtool can only operate on the interface, not on individual switch ports in this case.

what if you do this on the other end of the broken cable ?

100 Mb only uses two of the wire pairs in the cable, so try putting plugs on in a nonstandard way that uses the ordinarily unused pairs (the blue and brown) in place of the ordinarily active pairs (green and orange).

Also you should strictly enforce a 100 Mb link over the two good pairs (if there are any) by placing a 100 Mb switch in line at either end. The behavior of two 1000 Mb ports linked with missing or bad pairs in the cable is undefined. It may fall back to 100 Mb, but it may also fall back unreliably.

The only good solution to this is to replace the cable. In the realm of home improvements nothing is impossible.

1 Like

I think to avoid shooting in the dark, it's best to use a cable tester. If you don't have such thing, you could use a regular multimeter by shorting a pair at one side and measuring connectivity (or, better, resistance) at the other end.

Have you also considered it could be a dodgy termination rather than the cable itself?

There also remains the option of power extenders, as a last resort. Though, the idea of using the old cable to pull a new one as mentioned by @frollic can prove very useful. But if you go this way, make sure you connect the cables very well (yet smooth with no large knot between the two cables) to avoid the risk of having them disconnected midway

Thanks for the suggestions.

Replacing the cable was the first thing we tried, but it's about 100 feet long and it's stuck -- impossible to pull out from either end.

I have since tried multiple other solutions such as mesh, WDS, PLC/homeplugs (both ends on the same circuit) but for various reasons none can even deliver the 100mbps the damaged cable is still capable of.

It seems that a smart plug or a custom USB/relay switch is the best way out.

Thanks again everyone.