Second container has no IPv4 address

In the process of learning to work with Linux Containers I opted to launch a second container to play with. Only problem is it has no assigned IP address.

Please point me to the documentation to set up the IPv4 address for the second container.

Thanks
Walt

Is this lxc or lxd?

I used the command

lxc launch images:debian/11 Bullseye

When I run <lxc list> I got the info like what is in the image in my initial post. It didn’t assign the ipv4 address like it did for Buster when I launched it. I figured additional containers will need the ipv4 address set manually. I’m hoping to be pointed to the proper documentation so I can do this.

Stay warm
Walt

Please show lxc config show <instance> --expanded for both instances, along with ip a and ip r inside both instances and on the LXD host.

Console copy and paste from the commands you stated. I’m not a networking pro, but I am capable of following instructions.

The output from <lxc config show Bullseye>:

architecture: x86_64
config:
  image.architecture: amd64
  image.description: Debian bullseye amd64 (20221119_05:25)
  image.os: Debian
  image.release: bullseye
  image.serial: "20221119_05:25"
  image.type: squashfs
  image.variant: default
  volatile.base_image: f3962cf44f3b105b919d56767bf7b913867c7d182c74d87f45ed9102c456e28e
  volatile.cloud-init.instance-id: c92244fa-6c0a-42f8-beef-6ff8481f96c7
  volatile.eth0.host_name: vethbd90ee9b
  volatile.eth0.hwaddr: 00:16:3e:59:1a:7f
  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: 7ebfa9bd-206b-458a-a90b-d462eb6f7528
devices: {}
ephemeral: false
profiles:
- default
stateful: false
description: ""

The <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
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether d4:5d:64:d6:18:91 brd ff:ff:ff:ff:ff:ff
3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 98:48:27:21:48:61 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.101/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp1s0
       valid_lft 585160sec preferred_lft 585160sec
    inet6 fe80::9a48:27ff:fe21:4861/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
4: lxdbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:73:55:ed brd ff:ff:ff:ff:ff:ff
    inet 10.131.97.1/24 scope global lxdbr0
       valid_lft forever preferred_lft forever
    inet6 fd42:54ed:46b:860::1/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::216:3eff:fe73:55ed/64 scope link 
       valid_lft forever preferred_lft forever
6: vethbd90ee9b@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxdbr0 state UP group default qlen 1000
    link/ether 3a:82:56:32:f7:01 brd ff:ff:ff:ff:ff:ff link-netnsid 0
8: veth3cf2db0c@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxdbr0 state UP group default qlen 1000
    link/ether de:09:8b:d5:cf:5a brd ff:ff:ff:ff:ff:ff link-netnsid 1

The <ip r>:

default via 192.168.0.1 dev wlp1s0 proto dhcp metric 600 
10.131.97.0/24 dev lxdbr0 proto kernel scope link src 10.131.97.1 
192.168.0.0/24 dev wlp1s0 proto kernel scope link src 192.168.0.101 metric 600

Please can you show output of:

lxc exec <container> -- ip a
lxc exec <container> -- ip r
lxc exec <container> -- ps aux

As well as the result of doing;

lxc exec <container> -- dhclient

Thank you again for giving me a hand with this.

Here is the Bullseye – 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
5: eth0@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:59:1a:7f brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fd42:54ed:46b:860:216:3eff:fe59:1a7f/64 scope global dynamic mngtmpaddr 
       valid_lft 3544sec preferred_lft 3544sec
    inet6 fe80::216:3eff:fe59:1a7f/64 scope link 
       valid_lft forever preferred_lft forever

Here is the <lxc exec Bullseye – ip r>
(zilch, nada, no output)

Here is the <lxc exec Bullseye – ps aux>

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0 100948  6980 ?        Ss   15:34   0:00 /sbin/init
root        63  0.0  0.0  64700 13144 ?        Ss   15:34   0:00 /lib/systemd/systemd-journald
root        71  0.0  0.0  22660  3060 ?        Ss   15:34   0:00 /lib/systemd/systemd-udevd
systemd+    72  0.0  0.0  16048  4800 ?        Ss   15:34   0:00 /lib/systemd/systemd-networkd
message+    77  0.0  0.0   8268  2784 ?        Ss   15:34   0:00 /usr/bin/dbus-daemon --system --address
root        79  0.0  0.0  13400  3892 ?        Ss   15:34   0:00 /lib/systemd/systemd-logind
systemd+    80  0.0  0.0  21204  5972 ?        Ss   15:34   0:00 /lib/systemd/systemd-resolved
root        85  0.0  0.0   5476  1172 pts/0    Ss+  15:34   0:00 /sbin/agetty -o -p -- \u --noclear --ke
root       142  0.0  0.0  11620  1972 pts/1    Rs+  20:41   0:00 ps aux

Here is the <lxc exec Bullseye – dhclient>
(zilch, nada, no output)

what is your host OS/version?

What version of LXD are you using? Upgrading from LXD 5.3 to 5.8 appears to have broken networking in my test containers, although probably unrelated, as I’m not using the internal DHCP server.

Debian 10, Buster

What version? 5.8