buczoprazy
Posts: 3
Joined: Wed Sep 12, 2018 4:20 pm

No static ip config file before first boot

Wed Sep 12, 2018 4:38 pm

Hi
Is any one know how to setup static ip before first boot please?
I have no access to router and I can not scan network. I have not access to connect raspberry locally using HDMI. I am using windows so I have no access to etc folder on sd card. Only what I can do is change a setting file on boot partition.

Could any one tell me why that is so difficult to set up one of the most important thing please?
I should be able to setup everting from configure file, and after first boot I should be able to connect using ssh.

Please is there any solution please?

jbudd
Posts: 1911
Joined: Mon Dec 16, 2013 10:23 am

Re: No static ip config file before first boot

Wed Sep 12, 2018 11:11 pm

Could any one tell me why that is so difficult to set up one of the most important thing please?
I think most people would be able to scan their network (Angry IP scanner on your PC, Fing on a mobile phone etc.) If for some reason you can't scan the network, how will you choose a static IP address that is not already in use?

But anyway, probably the best way to get access to the ext4 partition from a PC is to boot the PC from a live Linux DVD or USB.

DirkS
Posts: 10685
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: No static ip config file before first boot

Thu Sep 13, 2018 6:57 am

buczoprazy wrote:
Wed Sep 12, 2018 4:38 pm
Please is there any solution please?
Try adding the ip address on the kernel command line. Add it at the end the first line of /boot/cmdline.txt
e.g.

Code: Select all

ip=192.168.1.101
Boot, log in and add make the change permanent and remove the ip from cmdline.txt

Alternatively: don't use static, but use the name: raspberrypi.local
You may have to install Bonjour if you have a windows PC or Avahi on a Linux PC.

buczoprazy
Posts: 3
Joined: Wed Sep 12, 2018 4:20 pm

Re: No static ip config file before first boot

Thu Sep 13, 2018 7:27 am

DirkS wrote:
Thu Sep 13, 2018 6:57 am
buczoprazy wrote:
Wed Sep 12, 2018 4:38 pm
Please is there any solution please?
Try adding the ip address on the kernel command line. Add it at the end the first line of /boot/cmdline.txt
e.g.

Code: Select all

ip=192.168.1.101
Boot, log in and add make the change permanent and remove the ip from cmdline.txt

Alternatively: don't use static, but use the name: raspberrypi.local
You may have to install Bonjour if you have a windows PC or Avahi on a Linux PC.
Thanks for reply, adding ip=10.0.0.1/21 do not work.

I can not use raspberrypi.local, there is no dhcp.
I have ip mask and dns, and I have only access to boot partition. No hdmi device no linux device with sdcard slot.

jbudd
Posts: 1911
Joined: Mon Dec 16, 2013 10:23 am

Re: No static ip config file before first boot

Thu Sep 13, 2018 7:31 am

Boot your pc from a live Linux dvd.

DirkS
Posts: 10685
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: No static ip config file before first boot

Thu Sep 13, 2018 7:57 am

buczoprazy wrote:
Thu Sep 13, 2018 7:27 am
Thanks for reply, adding ip=10.0.0.1/21 do not work.
Wrong format. Leave out the '/21' and try again.
If that does not work then see https://www.kernel.org/doc/Documentatio ... fsroot.txt. Look for 'ip='

Code: Select all

ip=10.0.0.1:::255.255.248.0
Odd address, BTW
I can not use raspberrypi.local, there is no dhcp.
Nothing to do with DHCP. Please search for mDNS, Zeroconf, avahi and / or Bonjour on this forum

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: No static ip config file before first boot

Thu Sep 13, 2018 8:06 am

buczoprazy wrote:
Wed Sep 12, 2018 4:38 pm
Hi
Is any one know how to setup static ip before first boot please?
I have no access to router and I can not scan network. I have not access to connect raspberry locally using HDMI. I am using windows so I have no access to etc folder on sd card. Only what I can do is change a setting file on boot partition.

Could any one tell me why that is so difficult to set up one of the most important thing please?
I should be able to setup everting from configure file, and after first boot I should be able to connect using ssh.

Please is there any solution please?

By default most Routers issue IP Addresses via DHCP, therefore if both your Windows PC and the RPi are connected to Router you only need to follow*:

https://www.raspberrypi.org/documentati ... /README.md

3. Enable SSH on a headless Raspberry Pi (add file to SD card on another machine)


* if you use NoobS to create the SD Card then forget above, I have no idea how NoobS functions !
Take what I advise as advice not the utopian holy grail, and it is gratis !!

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: No static ip config file before first boot

Thu Sep 13, 2018 8:16 am

Please search for mDNS, Zeroconf, avahi and / or Bonjour on this forum
AFAIK using names to find access your pi on a windows network is still broken (very unreliable) following a windows update back in spring so its not an option at the moment

DirkS
Posts: 10685
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: No static ip config file before first boot

Thu Sep 13, 2018 8:21 am

mattmiller wrote:
Thu Sep 13, 2018 8:16 am
Please search for mDNS, Zeroconf, avahi and / or Bonjour on this forum
AFAIK using names to find access your pi on a windows network is still broken (very unreliable) following a windows update back in spring so its not an option at the moment
That's on Win 10 of course.

For me it has always been on and off for years and it's still the same.
On my fully updated Win 10 machine It is certainly not more broken than before.

buczoprazy
Posts: 3
Joined: Wed Sep 12, 2018 4:20 pm

Re: No static ip config file before first boot

Tue Apr 21, 2020 12:37 pm

DirkS wrote:
Thu Sep 13, 2018 7:57 am
buczoprazy wrote:
Thu Sep 13, 2018 7:27 am
Thanks for reply, adding ip=10.0.0.1/21 do not work.
Wrong format. Leave out the '/21' and try again.
If that does not work then see https://www.kernel.org/doc/Documentatio ... fsroot.txt. Look for 'ip='

Code: Select all

ip=10.0.0.1:::255.255.248.0
Odd address, BTW
I can not use raspberrypi.local, there is no dhcp.
Nothing to do with DHCP. Please search for mDNS, Zeroconf, avahi and / or Bonjour on this forum
Your solution work perfect! THANK YOU!

Code: Select all

ip=10.0.0.1:::255.255.248.0

Return to “Beginners”