Skip to content

Instantly share code, notes, and snippets.

@bnjdg
Created March 28, 2018 17:20
Show Gist options
  • Save bnjdg/a59db4c04efd6a23fbc84550c931bf5c to your computer and use it in GitHub Desktop.
Save bnjdg/a59db4c04efd6a23fbc84550c931bf5c to your computer and use it in GitHub Desktop.
create lxd ct with static ip
Create the network config
vi network-config.yml
version: 1
config:
- type: physical
name: eth0
subnets:
- type: static
ipv4: true
address: 10.10.10.10
netmask: 255.255.255.0
gateway: 10.10.10.1
control: auto
- type: nameserver
address: 8.8.8.8
Launch the container with the static network config
lxc launch ubuntu:16.04 test3 --config=user.network-config="$(cat network-config.yml)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment