Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

Raspberry Pi OS • Re: Headless Trixie with static IP set before first boot - here is how

$
0
0
Firstly allow me to retract and appologise for my comments on the quality of your English. I was unaware that it is your second language and would not have made them had I been.

Secondly, I think the core of my issues is your basic assumptions: that everyone has the same network configuration as you do and a similar level of knowledge. That's not likely to be the case and while you didn't post in the Beginners subforum they will come here and try to follow your instructions.

For clarity, I'm going to separate out some things, others I'll respond to in line below.
  1. Your problems with Imager and Windows:
    • Imager can use a saved image. Scroll to the bottom of "Choose operating system" and select "Use custom". Sure, you have to manually download the image but it gets around the caching problem you have.
      It also avoids having to use json.
    • You probably have "Eject media when finished" set in "App options". Unset that and the boot partition will remain mounted in Windows. Or just unplug and replug the drive.
  2. Your problems with hostname resolution on WIndows:
    • I've been using hostname resolution on Windows for over 30 years, since win3.1
    • Your problems are almost certainly due to your use of static IP addresses assigned on each machine and not updating either your DNS server or every other machine's hosts file.
    • mDNS (hostname.local) is relatively recent and there was some lag between it being introduced and it being included in Windows by default.
  1. '"You should not use static IP." (Then why does this option even exist?)': because there are cases where you need to e.g. for your gateway and DNS servers. And for historic reasons.
  2. ""Use DHCP." (I never use DHCP.)" Really? Then you're making things much harder for yourself than they need to be.
  3. ""Log in via hostname." (Not working on Windows.)": Probably because you "never use DHCP". It works just fine for those of us who do or, who add the hostname/IP address pair to our DNS server or the hosts file on each machine. Or use "hostname.local" (mDNS).
  4. "d) You want to be able to move the Pi between different locations where networks are working in the same subnet but you are not allowed to change router settings)" : Umm that's what DHCP is for. And you'd need to be 101% certain that your select IP address is free on both networks.
  5. "here is the solution". Nope it's a solution (and "here" should be capalised).
  6. Where's "[Note #1]"?
  7. What about the other reserved private subnets: 10.0.0.0/8 and 172.16.0.0/12? Not every one is using 192.168.0.0/16.
  8. The gateway isn't always on .1
  9. The netmask should match what your network is using. For example, don't use /24 if your network is using /16.
  10. Unless you've gone out of your way ,for most domestic networks the name server and gateway are the same.
  11. No mention that your chosen static IP address needs to be in the same subnet as your router but outside the DHCP range. Otherwise you will see a confilct.
  12. "And that's it! :-)". Only if you're never going to have more than one machine with a static IP address. If you use the same filos with a different Pi you have two (or more) with the same static IP address. Which, obviously, won't work.
  13. "or you can use 8.8.8.8 or some other DNS server and you can specify more than one DNS server as a list, for example: [8.8.8.8, 8.8.4.4]" you are aware that google's DNS servers cannot resolve hostnames on your internal network? Nor can any other public DNS server.
  14. What if I want a static IP address on my WiFi interface?

And don't get me started on your gripes with imager...

Writing good documentation is hard.

1. Exactly, that's why I wrote how to configure a static IP - in case someone's use case needs it.

My comment was in answer to your question: "Then why does this option even exist?"
2. Affirmative, I really never use DHCP.

Unfortunately most of us do. Not least because most end users know nothing about networking and not least because using static IP addresses for everything quickly become unmanageable.
3. Last time I tried to use hostname was 6-7 years ago and it didn't work out the box even in the environment where DHCP was enabled. It worked after some registry changes and installing Bonjour (if I remember correctly) but I find using static IPs more convenient. Maybe in more recent versions of Windows using hostname works out of the box but I didn't test it since I didn't need it. There are even many tutorials where you can find something like: "If you are on Linux or Mac you can after first boot (to SSH into device) use a hostname and if you are on Windows then...", and then they list various workarounds.

Most do need access by hostname. The method is the same: ask the DNS server, check your hosts file, check mDNS if using .local. As I said above mDNS (avahi/bonjour) may need to be installed depending on the version of Windows in use.
4. Of course the address has to be free. I don't see any problem with that because there are plenty of free IP addresses.

My point wasn't that the address needs to be free but rather that those with limited networking knowledge need to be aware of that and may not be.
5. Correct me if I am wrong because in my language we don't have articles. From what I understand the "the" article is not just for indicating "the one and only", from my understanding (which might not be correct) "the" can (or even must?) be used when reffering to something specific. My reasoning for using "the" in "here is the solution" was because I was reffering to the solution (answer) to the specific question "How to configure a static IP?". I by no means wanted to say that is the only one or the ultimate solution. BTW, in my language we would say "I by no means didn't want to say..." because double negation is obligatory, as opposite to English where I think using double negation must not be used (at least in the same context).

It might sound weird but learning when to use "a" and when to use "the" is for speakers of my language (Croatian) almost impossible. We don't have concept (or a concept?) of articles and for us, it's very difficult to know when to use "a" and when "the". The only case when I know for sure I can't use "a" is when the noun is in plural :-) On the other hand, the structure of our language is such that we never interchange "its" and "it's".

As for the capitalisation of "here", I wrote that as the continuation of: "So if any of these applies here is the solution:". Like when there is something similar to:

And here:

<some image or some list>

we can see the results.

I think it would be odd to capitalise "we" in such a case.

6. I was "a bit" inconsistent with "Note" labels. I used "Note #2" as a "standard" note but using "Note #1" I've made a connection between several parts of the text describing that note. The first occurrence of "Note #1" is as usual - it announces there will later be the explanation. However, since I already wrote that explanation under "4." as "Every time I burned the image using Raspberry Pi Imager the bootfs partition in Windows 10 wasn't visible", I decided to mark that explanation with the same "label". Yes, that really is or can be quite confusing, especially because later down the text I used the same "label" one more time. So, the first and the last occurrences of "Note #1" are as one would expect and the second occurrence of the "Note #1" marks the explanation which should be duplicated at the bottom of the whole text as:

Clarity and consistence are important.
Note 1:
Every time I burned the image using Raspberry Pi Imager the bootfs partition in Windows 10 wasn't visible

For clarity you may want to edit your OP. It's up to you though.
7. I didnt cover all possible cases of subnets, subnet masks, gateways etc. My goal was to save time to someone who would like to configure a static IP address before the first boot and I gave an example from which someone who knows what nubers to enter when using GUI, could derive how that translates to typing the same numbers into network-config file.

8. Same answer as in 7. My goal wasn't to teach someone networking. I saw a lot of people here on the forum were looking for how to configure a static IP and I am sure they know which numbers exactly they would like to use.

We're back to assumptions again. Someone is going to follow your instructions exactly and end up confused when ti doesn't work.
9. True.

10. True as well. However, I gave an example because many are using Pi-Hole and have their nameserver pointing to the IP address of the device running Pi-Hole which is by the way configured with static IP. If someone wants to setup a Pi-Hole and knows how to configure a static IP before the very first boot then doing that might be even simpler than configuring static IP afterwards.

11. True.

As you agree that all those points are "True" should they not be included in your instructions? Not everyone will be aware of them.
12. Why would you have more than one device with the same static IP address? I explicitly said "Edit network-config if necessary.". I have my devices at two locations - more than 10 devices per location. They are Raspberry Pis, Orange Pi PCs, Banana Pis, laptops, televisions, ESP8266s, ESP32s, ESP32-S3s etc. and all of them have static IPs. One of Raspberry Pis is Pi 1 model B:

viewtopic.php?p=1876355#p1876355

My networks at the separate locations are not in the same subnet and when I am writing firmwares for the ESPs I am using compiler directives so I can always compile the firmware for using at "location 1" or at "location 2" and all my laptops have static IPs configured per wifi connection - not per adapter meaning the static IP addresses of my laptops change automatically as soon as I arrive at another location.

My SBCs are running many programs that I wrote (e.g. proxies for accessing microcontrollers from remote location I wrote in node.js) and many programs that I installed directly or in Docker containers and I have never had any problem because I am not using DHCP.

Most of what you're doing is not relevant to a set of instructions aimed at general usage.

You said "Edit network-config if necessary." under "here is how I burn the image and configure static IP in headless mode:" not as part of either set of instructions.
When I said: "And that's it.", I meant: "And the static IP is configured.". (Here is an example where I can not determine if "the" in the last sentence is correct or not :-) I don't have any clue if that "the" should be deleted or there should be "a" instead of the "the")

13. As I said, I am not using hostnames. I believe most Linux images have some kind of DNS resolving mechanism (Avahi? mDNS?) enabled out of the box (or maybe not?). I once had to install Avahi but I don't remember what was the reason as I am sure I was not intereseted in accessing devices via hostname.

Assumptions again. And a misunderstanding. See above.
14. On Raspberry Pi? All my single board computers are connected to router via LAN cables (direclty and via switches) and televisions as well. All my microcontrollers are connected via wifi and have static IPs. And all my laptops are connected via wifi with, as I said earlier, static IPs configured per wifi connection - not per adapter. I am sure static IP for Raspberry Pi's wifi interface can be configured too before the first boot but I didn't test if that works nor checked how that could be done.

Yes, on Raspberry Pi. Some have on board WiFi, all can have it added via USB. And then there's the possibility of more than one ethernet interface, ...
And don't get me started on your gripes with imager...

I just described my own experience.
Writing good documentation is hard.

I didn't complain about Imager's documentation and I didn't try to write the documentation for using cloud-init. I just described how to configure static IP before first boot (or the first boot?) because I spent (too) much time trying to find the solution (or a solution?).

That was a non specific comment intended to soften the edges of my points. Nothing to do with RPL's documentation (some of which I also take issue with).

Statistics: Posted by thagrol — Tue Feb 17, 2026 9:53 am



Viewing all articles
Browse latest Browse all 8082

Trending Articles