I set-up two raspberry pi's and have been able to connect to them one at a time at my home network by setting-up SSH. What I now want to do is connect them to a desktop switch and connect the desktop switch to my Mac. I would like to be able to thus control both raspberry pis over their connection using the ethernet cables but without having a wireless or internet connection (to a router). I cannot find anywhere how I can make this possible and how I would connect to the raspberry pis. At my home network I simply open-up terminal, type in SSH [email protected] and have access to the RPi, but when my wifi is off and I use the desktop switch I cannot connect.

1 Answer 1


You have to ensure that all the devices on the switch have the same ip address range and netmask.

These particulars are usually handled by a router via DHCP but you are free to set these values manually on each device or run your own DHCP server(never tried that).

Based on the ip for Pi1 you would want an address of 192.168.2.n for Pi2 and another 192.168.2.n address for the Mac. This is achieved with a netmask of



sudo ifconfig eth0 netmask


sudo ifconfig eth0 netmask


ifconfig eth0 netmask

(I do not know if you need sudo on a Mac).

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.