This guide outlines the steps and hardware needed for setting up and using a static IP address on LAN connections when using a Raspberry Pi to control your 3D Printer (Octoprint, Klipper, etc). This is necessary with closed network environments for corporate or educational applications.


IT DEPARTMENTS


Network Hardware(required from the client):

  • network/layer2 switch Port count is N+2 (Switch should have a link light)
  • ethernet cables = N+1
  • private IP range for pre-configuring the printer
  • host computer with dual interface network card

    N=Number of printers


Setting up a static IP address for each Pi running Klipper with a class C network

Example Subnet: 192.168.1.0/24 (Mask: 255.255.255.0)

Example IP: 192.168.1.50 (Mask: 255.255.255.0)

No default


DETAILED SETUP


Setting up a static IP on the Pi


While connected to the Raspberry Pi through SSH (Putty, Mac Terminal), send the following command: 

sudo vi /etc/dhcpcd.conf


The dhcpcd.conf file will open in VI text editor - only the lines below are to be modified.

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1


Using the example network below, uncomment the lines below and insert your information


Example Subnet: 192.168.1.0/24 (Mask: 255.255.255.0)

Example IP: 192.168.1.50 (Mask: 255.255.255.0)

No default


Here is an example based on our configuration

interface eth0
static ip_address=192.168.1.50/24
static routers=192.168.1.1(Default Gateway or router)


Networking information of PI


What Linux is running on the Klipper Raspberry Pi

The version of Linux being run with Mainsail

    

uname -a
Linux Troodon300 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l GNU/Linux

            Troodon300 is default name

 cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"


The version of Linux being run with Fluidd

uname -a

Linux fluiddpi 5.10.17-v7+ #1403 SMP Mon Feb 22 11:29:51 GMT 2021 armv7l GNU/Linux

            fluiddpi is default name

    cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"