Physically switching between two network cables [closed]

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.


Solution 1:

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.

Solution 2:

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.