0

I found this tutorial to set a static IP address: https://thepihut.com/blogs/raspberry-pi-tutorials/how-to-give-your-raspberry-pi-a-static-ip-address-update

All this is fine! However, what if given IP address will be already in use? Or network has different subnet (say 192.168.1.x or 10.0.0.x)?

Am I able to set a backup IP or skip this to router (let it give RPi any address)?

4
  • 1
    That is a terrible tutorial. It unclear what you are actually trying to do (or even why you think you need a static IP Address). Obviously if the address is in use it won't work and it you use one not supported by the network it won't work either. See How to set up networking/WiFi which shows HOW and better alternatives e.g. request and Fallback profile.
    – Milliways
    Commented Sep 2, 2020 at 7:52
  • Instead of using static IP ise MDNS (Multicast DNS), the raspberry pi is multicasting its name over the local network, so connect to raspberrypi.local Commented Sep 2, 2020 at 12:41
  • 1
    Your tutorial is dated Jul 16, 2014. As a matter of common sense, you know that our systems and software evolve constantly. Six (6) years is a long time! And don't you wonder about the management of a website that doesn't update an article in 6 years? What would your garden look like if you didn't touch it for 6 years? Please excuse the rant, but your question is asked frequently: "I followed tutorial X, but it doesn't work as I wish." There are several recent Q&A related to yours here for the cost of a search on dhcpcd. Read man dhcpcd & man dhcpcd.conf, & edit your question.
    – Seamus
    Commented Sep 2, 2020 at 18:46
  • Sorry, but we cannot give a general tutorial for linux networking: google.com/search?q=linux+networking+basics
    – Ingo
    Commented Sep 5, 2020 at 10:58

1 Answer 1

1

The point of a static pi is that it is static i.e. you do not move it between networks and you have full control of the network. If you think you will be moving the Pi then DO NOT set the address up on the Pi but set it up on the local router or computer the issues IP addresses on the network (DHCP server such as pi-hole)

To stop the allocation of the address to another device you reserve addresses on the router using the MAC address of the device and make sure this is outside the DHCP address range managed by the router.

You can set multiple addresses within dhcpcd.conf by the use of the arping direct BUT this requires you know details of the networks you are going to connect to and in best case the actual MAC details of devices on the network and from your question I do not think you know what network you will be connecting to. Details of this can be seen here

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.