-
-
Save wechain/f61ce270b3db4872b9610af7ad139993 to your computer and use it in GitHub Desktop.
create lxd ct with static ip
This file contains hidden or 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
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