ubuntu@shenzhen:~ $ lxc init tuna-images:archlinux/current/amd64 archlinux -c security.privileged=true
Creating archlinux
ubuntu@shenzhen:~ $ lxc config set archlinux security.nesting true
ubuntu@shenzhen:~ $ lxc start archlinux
ubuntu@shenzhen:~ $ lxc exec archlinux /bin/bash
[root@archlinux ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
189: eth0@if190: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:4d:ea:c8 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.213.188.135/24 brd 10.213.188.255 scope global dynamic eth0
valid_lft 3589sec preferred_lft 3589sec
inet6 fd42:43d5:b4d4:9bdd:216:3eff:fe4d:eac8/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 3589sec preferred_lft 3589sec
inet6 fe80::216:3eff:fe4d:eac8/64 scope link
valid_lft forever preferred_lft forever
[root@archlinux ~]# exit
ubuntu@shenzhen:~ $ lxc list
+-----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| archlinux | RUNNING | 10.213.188.135 (eth0) | fd42:43d5:b4d4:9bdd:216:3eff:fe4d:eac8 (eth0) | CONTAINER | 0 |
+-----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
LXC/LXD使用Arch Linux并配置ipv4地址
最新推荐文章于 2024-09-15 08:30:00 发布