Last active
April 13, 2024 15:44
-
-
Save vancanhuit/18b3626d698cde7533bfc4ff5200998e to your computer and use it in GitHub Desktop.
Incus/LXD: cloud-init static ip for containers and VMs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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