1

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?

http://thenetworksherpa.com/what-is-a-physical-layer-switch/

http://www.digital-loggers.com/lpc.html

3
  • 2
    Why? It's not necessary. You can simply shut the port from the command line on practically any Ethernet switch. Commented Aug 27, 2016 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
    Commented Aug 28, 2016 at 5:28
  • 1
    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
    Commented Aug 15, 2017 at 1:04

3 Answers 3

3

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.

3
  • no normally priced ones? This is frustrating, but thank you.
    – tarabyte
    Commented Aug 26, 2016 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
    Commented Aug 29, 2016 at 9:42
  • 1
    Cheap and cheap, found this one on Ebay actually ebay.com/p/…
    – Stuggi
    Commented Aug 29, 2016 at 9:46
1

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).

3
  • 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
    Commented Aug 25, 2016 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
    Commented Aug 25, 2016 at 22:47
  • @tarabyte, what, specifically, are you asking. You can physically plug and unplug cables from any switch.
    – Ron Maupin
    Commented Aug 25, 2016 at 22:47
0

I'd use a managed switch for that. It should have a decent console or API for scripted automation though, not sure if the one you've linked to does the trick.

You can simulate the physical connect/disconnect by enabling/disabling the switch port using (no) shut, interface dis/enable or similar.

Additionally, you can configure VLANs and alternately connect one of them to the switch port (as untagged/access). That way you can present various network variants to the test clients. Of course, there may be additional switch features you could use for testing, including variable speed, bandwidth limitations or similar.

In

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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