I own a raspberry pi 3 with integrated wifi and I have several computers I would like to connect with ethernet cables for gigabit file transfers. Unfortunately the home's router is located on a different level of the house and there is NO chance of getting an ethernet cable from the router downstairs. I own a network switch.
I am wondering if it is possible to connect the switch to the raspberry pi, which is connected to the router wirelessly, and then plug each computer into the switch to transfer files between them at gigabit speeds. Would this work, or is it impossible? If impossible, why?
81 Answer
I am wondering if it is possible to connect the switch to the raspberry pi, which is connected to the router wirelessly, and then plug each computer into the switch to transfer files between them at gigabit speeds. Would this work, or is it impossible? If impossible, why?
Yes it would work, but it has nothing to do with the Raspberry Pi. That's what your actual switch already does all the time, so the Raspberry Pi – and even the router – might as well just not be connected at all.
As long as your computers are within the same IP subnet, they will always attempt to talk at MAC layer to each other directly – they'll send Ethernet frames with each other's MAC address as the "destination" (not the router's nor the Pi's).
All Ethernet switches are built to support this; they automatically learn which ports have which MAC addresses behind them, and will directly forward the frames to the other computer's port. They do not need to funnel everything towards the router – all switch ports are equal.
(This even applies to your router's built-in "LAN" ports. Even though they're physically in the same box as the router, they are almost always wired to a switch chip that works the same way as an external switch, and none of your computer-to-computer Ethernet traffic goes via the router's CPU at all.)
3