Static IP Adress for WiFi and Cable


#1

Hello dear Team.
I need for Octoprint a Static IP Adress by cable and WiFi.

I have searched all over the internet for a guide to assign a fixed IP address.
I need a short guide to reach my two printers over a fixed IP.
Thanks in advance for your help.

Volker


#2

Can we assume that you have installed OctoPrint on a Raspberry Pi 3B using the OctoPi image? If not, then we would need to know what kind of computer this is running on.

Assuming "yes" to that question...

Raspbian now uses the wpa_supplicant and dhcpcd deamons. More

sudo nano /etc/dhcpcd.conf

For example:

       interface eth0
       static ip_address=10.1.1.30/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1

       interface wlan0
       static ip_address=10.1.1.31/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1

#3

Are you referring to a static IP address you can use within your home network?

Or a static IP you can use to access OctoPrint over the internet from outside your home network?

Regardless of the above scenario, it will also be helpful to know what kind of router/gateway you are using on your home network.

It may be easier to just set up a DHCP reservation in your router rather than having you edit the Debian configuration files. Of course, that's up to you. If you're comfortable editing the configuration file, either method will work to establish a static IP within your local area home network.

IF you are trying to get a static Public IP address, things will be a little different especially if you are using a consumer level ISP (Non Business Class). Most consumer ISP's use DHCP to assign dynamic addresses to their cable modems / DSL modems, etc. If this is what you're wanting to do and you do not have a known static IP block issued by your ISP, youwill need to research something called Dynamic DNS providers. These will allow you to register a hostname with a DDNS provider and the service will update your DNS Host Record entry every time your dynamic IP changes, so all you need to remember is the hostname rather than an IP address. Depending on the type of router you have, this can be set on the router, or if your router doesn't support DDNS synchronization, you can install a service on your Pi that will handle the DDNS synchronization.

Sorry, that was long winded, just want to be clear on your intentions so we can guide you in the right direction!


#4

I use DHCP IP reservation from my router. Is very simple to configure. Just add the MAC Address from your PI, set the IP it has to get when connect to the network and reboot the Pi, so next time it gets an IP, it will get the assigned one.


#5

Hallo David,

thanks for the fast answer.

I need the fixed IP in the local network.
Since I always have problems with a DHCP server in this network segment.

I switched everything to fixed IP. Problem is that in this segment different machines are the cause of these problems.

But that's another long story. :wink:

I had already tried different instructions from the net but nothing brought a solution.
Only a new installation :frowning:

Thanks in advance for your help

Mit freundlichen Grüßen / With best regards

Volker


#6

Hallo Johnnie Walker,

thanks for the fast answer.

I need the fixed IP in the local network.
Since I always have problems with a DHCP server in this network segment.

I switched everything to fixed IP. Problem is that in this segment different machines are the cause of these problems.

But that's another long story. :wink:

I had already tried different instructions from the net but nothing brought a solution.
Only a new installation :frowning:

Thanks in advance for your help

Mit freundlichen Grüßen / With best regards

Volker