Skip to content

Instantly share code, notes, and snippets.

@vancanhuit
Last active April 13, 2024 15:44
Show Gist options
  • Save vancanhuit/18b3626d698cde7533bfc4ff5200998e to your computer and use it in GitHub Desktop.
Save vancanhuit/18b3626d698cde7533bfc4ff5200998e to your computer and use it in GitHub Desktop.
Incus/LXD: cloud-init static ip for containers and VMs
cat cloud-init-static-ip-container.yaml | incus config set <name> cloud-init.network-config -
cat cloud-init-static-ip-vm.yaml | incus config set <name> cloud-init.network-config -
network:
version: 2
ethernets:
eth0:
dhcp4: false
gateway4: 10.187.162.1
addresses:
- 10.187.162.2/24 # Change this
nameservers:
search:
- lab.internal # Change this
addresses:
- 10.187.162.1 # Change this
network:
version: 2
ethernets:
enp5s0:
dhcp4: false
gateway4: 10.187.162.1
addresses:
- 10.187.162.2/24 # Change this
nameservers:
search:
- lab.internal # Change this
addresses:
- 10.187.162.1 # Change this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment