I want to plug and unplug two ethernet cables from a little test script. I thought a fancy managed switch would have this capability but it turns out to only allow me to create VLANs and optionally tag certain ports with those VLAD IDs.

Am I looking for a a layer 1/physical switch?



  • 1
    Why? It's not necessary. You can simply shut the port from the command line on practically any Ethernet switch. – Ron Royston Aug 27 '16 at 1:15
  • shutdown and no shutdown commands work for some test cases, thank you! i still have a need for a more general configuration so that I can nest device connections in different ways, though. – tarabyte Aug 28 '16 at 5:28
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 15 '17 at 1:04

If you need to electrically disconnect a port via command line (doing electrically the same thing as physically removing the cable from the port) you'll need a Layer 1 switch, which is a very expensive device (since it can connect any port to any other port). If you only need to stop the port communicating, then you might be able to do it with a cheaper managed switch by issuing interface disable/enable commands.

Depending on what you're doing, you could also manufacture a device that does it, for example by putting 8 Mosfets between the pins of two outlets, and then trigger those with the I/O of a Raspberry Pi. This won't satisfy the requirements for Ethernet when it comes to shielding and frequency attenuation, but for test purposes it might work. If you're only using FastEthernet, then you can get away with only doing it on 2 pairs of the cable as well.

  • no normally priced ones? This is frustrating, but thank you. – tarabyte Aug 26 '16 at 18:52
  • No, not that I've seen, they are quite expensive devices normally intended for big datacenters, where you might want to be able to remotely repatch a server without anybody having to drive out to site. The way they do it is also a bit expensive, they work as an old telephone exchange, by doing line switching instead of packet switching. – Stuggi Aug 29 '16 at 9:42
  • 1
    Cheap and cheap, found this one on Ebay actually ebay.com/p/… – Stuggi Aug 29 '16 at 9:46

By "plug and unplug" could you mean "administratively disable" and then "enable" a port on a switch? A switch, or switched hub, has at least Layer 2 capabilities by definition. All managed switches I've ever used have the ability to disable and enable switch ports. I've never used a TP-LINK device, however. Try a Cisco; you don't need the expensive versions to get the control it appears you want. My experience with Cisco switches is they are less prone to malfunction than most of the available network equipment and are highly customizable.

The "Layer 1 Switch" to which you link is more like what the author of that page describes it: a "software-controlled patch panel". If that is really what you want to accomplish, those MRV devices are in a completely other league than the Layer 2 switch you linked as far as price is concerned (many thousands of dollars).

  • No I mean physically plug and unplug. I want to test a hardware device that has an ethernet port and can connect to other ones. – tarabyte Aug 25 '16 at 22:39
  • Did you check out the MRV equipment that your original link mentions? They're expensive but appear to do what you want. Although even those use software to connect and disconnect. They don't robotically disconnect the cable and then reconnect it to my knowledge. – Scott Aug 25 '16 at 22:47
  • @tarabyte, what, specifically, are you asking. You can physically plug and unplug cables from any switch. – Ron Maupin Aug 25 '16 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.