Now that we have all of the SD Cards prepped, insert the Master SD Card back into the Master Pi, connect it to a router and boot it back up. Then for the remaining Raspberry Pi's, insert SD Cards into all of them, connect them to the same router as your Master Pi, and then boot them all up. None of the secondary Pi's need to have keyboards, mice, or monitors.

Once all of the Pi's are powered on, using our Master Pi, we should be able to get the IP addresses of each Pi on the network. Here's how:

First Install NMAP

sudo apt-get update

sudo apt-get install nmap Then get the current IP for the master Pi

ifconfig Now you can scan your routers subnet for the other Pi IP addresses

sudo nmap -sn 192.168.1.*



Copy down all of the IP addresses that pertain to the other Raspberry Pi's on the network. We will then be able to use those IP's to connect into each of the other Pi's using SSH. What we need to do first is rename each of the secondary Pi's to a unique network name. Right now they're all set to Pi01. Assuming that one of the secondary Pi's IP addresses is 192.168.0.3, here's how you can connect to it and change it's name:

Establish an SSH connection

ssh pi@192.168.0.3 Run raspi-config

sudo raspi-config In the interface, scroll down to the Advanced option, and then choose Hostname. For the hostname, change Pi01 to the next sequential number, which is Pi02. Then exit out of the SSH session

exit

You want to repeat those steps for each of the other Pi's on the network renaming them to Pi03, Pi04, etc.

On your master Pi, you want to create a new textfile called "machinefile"

nano machinefile

And in it, you want to type in each of the Pi's IP addresses (including the Master IP address) on a new line and then save the file.