Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Can't You use two ethernet cards for it ? – Alan Kuras Apr 18 '12 at 13:19
The machine is an imac, which only has a single gigabyte ethernet port. – Gav Apr 18 '12 at 13:50
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 '12 at 14:43
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 '12 at 6:35

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.

share|improve this answer
Instead of using separate VLANs, you could enable/disable the ports entirely, given a powerful (read: expensive) enough managed switch. – Andrew Apr 19 '12 at 6:39

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.

share|improve this answer
I think he asked for different thing (physically switching ,not restarting ) – Alan Kuras Apr 18 '12 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 '12 at 13:20
I dont see anything about second interface in You answer ? – Alan Kuras Apr 18 '12 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 '12 at 13:24
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 '12 at 13:52

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.

share|improve this answer
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 '12 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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