Problem:
I'm installing Ubuntu on Raspberry Pi for my robots, headless setup, only power and ethernet/wifi.
I'm cycling through images quickly, it's tedious to always be using a DHCP, make first access and change IP from inside the operating system via SSH, then reconnect with the right static IP.
What I tried:
I'm developing on windows, the ethernet configuration files are in a linux partitions that is not seen by windows out of the box.
The boot partition is convenient, and already has several settings I edit before plugging in the card (like GPIOs). I want to be able to setup a static IP by changing a config file on the BOOT partition.
I researched the topic, and no solution worked. e.g. the line on config.txt does nothing
ip=192.168.0.5::192.168.0.1:255.255.255.0:rpi:eth0:off
Question:
Is there a way to setup a static IP on Ubuntu Desktop 22.04.1 LTS on config.txt or another file inside boot?
Can I place a script in BOOT that is executed the first time the Raspberry Pi is booted?
Answer:
cmdline.txt
ip=192.168.0.5::192.168.0.1:255.255.255.0:rpi:eth0:off
As far as I can tell, it works by injecting through the tty serial interface the IP command that is processed and setup the ETH0 interface.