Skip to content

Instantly share code, notes, and snippets.

@wechain
Forked from bnjdg/setup.sh
Last active September 24, 2021 03:27
Show Gist options
  • Save wechain/f61ce270b3db4872b9610af7ad139993 to your computer and use it in GitHub Desktop.
Save wechain/f61ce270b3db4872b9610af7ad139993 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:20.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