Score:0

configure default static IP address in cloud-init nocloud config (CIDATA) on usb

mm flag

I have built a custom Ubuntu 22.04 install that runs unattended from a USB stick. I am now trying to add a default static IP address that the target will boot with. These systems will be booting in tiny environments that may not have DHCP or other network services, and will be be further customized by a post-install script, but I need them to be network reachable upon first bootup after cloud-init.

I will not know any mac addresses in advance, or even the interface device as this image needs to work across several classes of hardware that may have interface name format variants. Is there a way to make use of cloud-init's ability to identify a "best" physical interface, and set a static ip there? I would also like it to to grab a DHCP address on the same interface if the service is available, but that is not a necessity.

The usb stick I am creating has a vfat formatted CIDATA partition with a user-data file that works as expected. I have read in the docs that user-data cannot be used for network config, and I have tried to create a network-config file in this partition as below, but I think I am heading off down the wrong rabbit hole. Can anyone provide any advice for how to accomplish my goal?

The network-config file I have tried is:

ethernets:
  eno1:
    dhcp4: true
    dhcp6: false
    addresses: [ "192.168.1.13/24" ]```
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.