4

I am looking for a small piece of hardware that will allow me to physically switch between two network cables, similar to how a KVM switch works. That is, there are two ethernet input cables to switch between and one output ethernet cable. Does such a thing exist? I am having a very hard time trying to search for this given the results, switch and ethernet bring up... Currently I am having to physically unplug one cable from my NIC and plug in the other to change physical networks, I would prefer just having to press a button.

5
  • Can't You use two ethernet cards for it ?
    – Alan
    Apr 18, 2012 at 13:19
  • The machine is an imac, which only has a single gigabyte ethernet port.
    – Gav
    Apr 18, 2012 at 13:50
  • 1
    If you have spare USB ports, use a USB NIC? If you didn't mind not having a gigabit connection, you could wire up something using a 4PDT switch and some 8P8C connectors; or perhaps even attempt a gigabit changeover mechanism using an 8PDT switch (though I suspect you'd get strange crosstalk problems and quite poor speeds).
    – Andrew
    Apr 18, 2012 at 14:43
  • 1
    Why not get a router to connect the networks? Plug the iMac and both network cables into the router, and ta-da!
    – Bigbio2002
    Apr 23, 2012 at 6:35
  • Im trying to do this to reduce the need for expensive 10gb hardware... Switch people from 1gb to 10gb as needed
    – Ray Foss
    Jan 27, 2020 at 16:22

5 Answers 5

5

Does such a thing exist?

Yes, it's a device called a network switch. You need one with multiple VLAN capability and at least 3 ports: one port for your "output" cable, and for one each of your two "input" cables. Unfortunately, I know of no switch that functions as you desire (that is, one with some kind of physical mechanism to control which VLAN a given port resides on), but it's not impossible that such a thing could exist.

It is much more likely, however, that you will find a network switch that is configured entirely in software, possibly through a web-based config page. The idea is to put your two "input" ports on two separate VLANs, and plug your two networks into those ports. Plug the device you wish to swap between networks into a third port on the switch, and then configure that port to reside on whichever VLAN you wish. Changing the chosen VLAN for that port won't be exactly a "push-button" operation, but it can come close to it, if your switch has a scriptable configuration language.

1
  • Instead of using separate VLANs, you could enable/disable the ports entirely, given a powerful (read: expensive) enough managed switch.
    – Andrew
    Apr 19, 2012 at 6:39
4

Why not just disable the network port administratively using a command like ifconfig in Linux? Under Linux, you can just do:

ifconfig eth0 down
ifconfig eth0 up

to bring an interface down and up again.

For Windows, you can just right click and disable the network connection. Then, you can enable it again.

8
  • 1
    I think he asked for different thing (physically switching ,not restarting )
    – Alan
    Apr 18, 2012 at 13:19
  • @AlanKuras: I am not talking about restart! I just said he can just disable one interface and enable the other without the need for physically unplugging and plugging the cables.
    – Khaled
    Apr 18, 2012 at 13:20
  • 1
    I dont see anything about second interface in You answer ?
    – Alan
    Apr 18, 2012 at 13:22
  • @AlanKuras: I just gave an exmaple on how to bring an interface up and down. It should be clear how to do this for another interface! Isn't it? :)
    – Khaled
    Apr 18, 2012 at 13:24
  • 1
    The machine is an imac, which only has a single gigabyte ethernet port. If I purchased a USB ethernet port I assume I could use this solution?
    – Gav
    Apr 18, 2012 at 13:52
2

I found this product that seems to do what you want: https://www.amazon.com/gp/product/B00DRG1SLO/ref=od_aui_detailpages00?ie=UTF8&psc=1

0

You don't mention why you're doing this, but is it possible to just put two IP addresses on the one interface?

This won't always work for a variety of reasons, but when it does it works well.

1
  • To use two IP addresses on one interface either requires the broadcast domain for both subnets to be the same (which may no be appropriate for the environment) or requires sub-interfaces using 802.1q tagging and an appropriate managed switch to tag the frames from each cable.
    – Thomas G
    Apr 18, 2012 at 13:32
0

You could get a 16 channel smart relay. That should allow you to switch to Ethernet cables between one source.

https://www.amazon.com/SainSmart-101-70-103-16-Channel-Relay-Module/dp/B0057OC66U

Not the answer you're looking for? Browse other questions tagged .