Zachi Nachshon
Zachi Nachshon Software Architect and DevOps Engineer. Passionate technologist, OSS enthusiast and Raspberry Pi addict.

Configure Local Network for a Raspberry Pi Cluster

Configure Local Network for a Raspberry Pi Cluster

Best practices for connecting and configuring a Raspberry Pi cluster to a local network.


Static IP

What is a static IP?

An IP address that doesn’t get changed or re-assigned by the network (home router in our case) even after a restart and/or shutdown.

Why does a RPi cluster require a static IP?

When you create a RPi cluster you usually also configure client(s) to communicate with it. Lets look at a few examples of such clients:

  • SSH by node name, using a local machine /etc/hosts file to assign names for every RPi cluster node (e.g. rpi-master, rpi-node)
  • Register one of the RPi nodes as a Kubernetes master node, setting its IP address on a local machine kube config file
  • Register these IP addresses within an Ansible hosts inventory


In this section we’ll learn how to configure a static IP address on a TP-Link: Archer VR600 router.

Retrieve a device network address (from router dashboard)

  1. Open the router Dashboard
  2. Select Advanced tab and afterwards Network from the side menu
  3. Under LAN settings -> Client List retrieve the MAC Address of a client named raspberrypi

Retrieve a device network address (from RPi server directly)

In case there isn’t a MAC Address column on the client list, we’ll retrive its value directly from the RPi server:

  1. Find the IP address of the new RPi device from the router’s Client List as described on the previous section
  2. Open a terminal shell session via SSH to the RPi server

    1
    
    ssh pi@<INSERT-IP-ADDRESS>
    
  3. Run ifconfig and acquire the network physical address (MAC address) by searching for eth0 and copying the HWaddr or ether value

    1
    
    ip addr show eth0 | grep "ether\b" | awk '{print $2}' | cut -d/ -f1
    

Reserve a static IP address

  1. Open the router Dashboard
  2. Select the Advanced tab
  3. Go to Network -> LAN Settings -> Address Reservation
  4. Click add and fill out the following:
    • MAC Address: fill in the HWaddr / ether from the RPi node
    • IP Address: select a higher range IP address e.g. 192.168.1.200 so it won’t get occupied

  5. Go to System Tools -> Reboot

comments powered by Disqus