hypriot / flash

Command line script to flash SD card images of any kind
MIT License
1.01k stars 175 forks source link

Change DHCP to static IP after first boot #187

Closed Octoate closed 3 years ago

Octoate commented 3 years ago

Hi, I know that there are already some other issues here (e.g. #183), that are similar to my question, but I want to change the IP address from DHCP assigned to static (and vice versa) after the system was configured during the first boot. Normally I would just change the file in /etc/network/interfaces.d called "50-cloud-init.cfg", but it didn't work. Also changing the addresses in /etc/dhcpcd.conf did't work (it also seems that the service isn't running, if I type in "sudo service --status-all") and finally changing "/boot/network-config" also didn't work. So I am a little bit lost here. Does anybody know how to change the IP address on a running system?

I am using Hypriot v1.12.3 and flash v2.7.1.

Octoate commented 3 years ago

Ok, finally got it working. I change the file "/etc/network/interfaces.d/50-cloud-init.cfg" and do a restart afterwards. "sudo service networking restart" was not sufficient. It then works...