I installed Ubuntu Focal on my Rock Pi 4A board and decided to create a few containers inside. After following all default steps I don’t see my container get an IPV4 assigned. If you can help me to find out what causes a problem…
I don’t think stock image has netplan or systemd-networking
rock@rockpi4a:~$ sudo ps -ef | grep -i net
root 37 2 0 00:18 ? 00:00:00 [netns]
root 403 1 0 00:18 ? 00:00:03 /usr/sbin/NetworkManager --no-daemon
lxd 1794 852 0 00:20 ? 00:00:01 dnsmasq --keep-in-foreground --strict-order --bind-interfaces --except-interface=lo --pid-file= --no-ping --interface=lxdbr0 --quiet-dhcp --quiet-dhcp6 --quiet-ra --listen-address=10.163.223.1 --dhcp-no-override --dhcp-authoritative --dhcp-leasefile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.leases --dhcp-hostsfile=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.hosts --dhcp-range 10.163.223.2,10.163.223.254,1h -s lxd -S /lxd/ --conf-file=/var/snap/lxd/common/lxd/networks/lxdbr0/dnsmasq.raw -u lxd -g lxd
My container:
lxc list
±-----------±--------±-----±-----±----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±-----------±--------±-----±-----±----------±----------+
| postgresql | RUNNING | | | CONTAINER | 0 |
±-----------±--------±-----±-----±----------±----------+
lxc config show postgresql --expanded
architecture: aarch64
config:
image.architecture: arm64
image.description: Alpine 3.10 arm64 (20201118_13:00)
image.os: Alpine
image.release: “3.10”
image.serial: “20201118_13:00”
image.type: squashfs
image.variant: default
user.network-config: |
version: 1
config:
- type: physical
name: eth0
subnets:
- type: dhcp
ipv4: true
volatile.base_image: 03dd52a03cdc01c2c0d61672cc4eb817a982a665cea3d56f88b53bf3e569847b
volatile.eth0.host_name: veth9703bff4
volatile.eth0.hwaddr: 00:16:3e:25:56:ef
volatile.idmap.base: “0”
volatile.idmap.current: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.idmap.next: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.idmap: ‘[{“Isuid”:true,“Isgid”:false,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000},{“Isuid”:false,“Isgid”:true,“Hostid”:1000000,“Nsid”:0,“Maprange”:1000000000}]’
volatile.last_state.power: RUNNING
volatile.uuid: 9653378f-803d-410a-845b-0a855df67871
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: rock_pool
type: disk
ephemeral: false
profiles: - privatenetwork
stateful: false
description: “”
Profile:
lxc profile show privatenetwork
config:
user.network-config: |
version: 1
config:
- type: physical
name: eth0
subnets:
- type: dhcp
ipv4: true
description: Private network LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: rock_pool
type: disk
name: privatenetwork
used_by: - /1.0/instances/postgresql
My assumption that I should get an ipv4 address assigned to my container so I can ping it from my host machine and also my container should be able to access internet via eth0. I have a feeling that lxdbr0 wasn’t created correctly but I am not sure.
ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether ea:68:26:39:e2:7c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
valid_lft 70838sec preferred_lft 70838sec
inet6 fe80::fd8d:3a6f:96dc:37e1/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:c5:6e:59 brd ff:ff:ff:ff:ff:ff
inet 10.163.223.1/24 scope global lxdbr0
valid_lft forever preferred_lft forever
inet6 fe80::6659:1bc7:d27b:4dae/64 scope link
valid_lft forever preferred_lft forever
5: veth9703bff4@if4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxdbr0 state UP group default qlen 1000
link/ether b2:3f:9b:7a:07:3c brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 169.254.123.208/16 brd 169.254.255.255 scope global noprefixroute veth9703bff4
valid_lft forever preferred_lft forever