LXC/LXD使用Arch Linux并配置ipv4地址

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         |
+-----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值