Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#993232: lxc: Cannot add ipv4 gateway for network device "eth0" when not bringing up the interface.

67 views
Skip to first unread message

John

unread,
Aug 29, 2021, 12:30:03 AM8/29/21
to
Package: lxc
Version: 1:4.0.10-1
Severity: normal
X-Debbugs-Cc: jo...@wonghome.net

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

After upgraded lxc from 4.0.6-2 to 4.0.10-1. lxc container cannot start.
I find the error with "lxc-start -l trace" like below:

network.c:lxc_network_setup_in_child_namespaces_common:3894 - Cannot add ipv4 gateway for network device "eth0" when not bringing up the interface
network.c:lxc_setup_network_in_child_namespaces:4038 - Function not implemented - Failed to setup netdev
conf.c:lxc_setup:4080 - Failed to setup network
start.c:do_start:1291 - Failed to setup container "vbox"

If I rollback to 4.0.6-2, everything work fine as before.
If I remove the line "lxc.net.0.ipv4.gateway = 10.0.3.1" in "/var/lib/lxc/vbox/config" (container config),
the container can start again, but result no network , only loopback interface (lo) in container (no eth0 in container).

Thanks.

* What led up to the situation?
* What exactly did you do (or not do) that was effective (or
ineffective)?
* What was the outcome of this action?
* What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: bookworm/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-8-cloud-amd64 (SMP w/2 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lxc depends on:
ii bridge-utils 1.7-1
ii debconf [debconf-2.0] 1.5.77
ii dnsmasq-base [dnsmasq-base] 2.85-1
ii iproute2 5.13.0-2
ii iptables 1.8.7-1
ii libc6 2.31-17
ii libcap2 1:2.44-1
ii libgcc-s1 11.2.0-3
ii liblxc1 1:4.0.10-1
ii libseccomp2 2.5.1-1
ii libselinux1 3.1-3
ii lsb-base 11.1.0

Versions of packages lxc recommends:
ii apparmor 2.13.6-10
pn debootstrap <none>
pn dirmngr <none>
pn gnupg <none>
pn libpam-cgfs <none>
pn lxc-templates <none>
ii lxcfs 4.0.7-1
ii openssl 1.1.1l-1
pn rsync <none>
pn uidmap <none>
ii wget 1.21-1+b1

Versions of packages lxc suggests:
pn btrfs-progs <none>
pn lvm2 <none>
pn python3-lxc <none>

-- Configuration Files:
/etc/default/lxc-net changed:
USE_LXC_BRIDGE="true"
LXC_BRIDGE="lxcbr0"
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"
LXC_DHCP_CONFILE=""
LXC_DOMAIN=""


-- debconf information:
lxc/auto_update_config:

John Wong

unread,
Aug 29, 2021, 12:50:03 AM8/29/21
to
Attached lxc-net, lxc-config and ifconfig-lxcbr0.txt for reference, thanks.
(let me know, if need any/more information)

Regards,
John.
ifconfig-lxcbr0.txt
lxc-config
lxc-net

Pierre-Elliott Bécue

unread,
Jan 27, 2022, 7:30:03 PM1/27/22
to
Control: tags -1 +moreinfo

Le dimanche 29 août 2021 à 12:23:09+0800, John a écrit :
> Package: lxc
> Version: 1:4.0.10-1
> Severity: normal
> X-Debbugs-Cc: jo...@wonghome.net
>
> Dear Maintainer,
>
> *** Reporter, please consider answering these questions, where appropriate ***
>
> After upgraded lxc from 4.0.6-2 to 4.0.10-1. lxc container cannot start.
> I find the error with "lxc-start -l trace" like below:
>
> network.c:lxc_network_setup_in_child_namespaces_common:3894 - Cannot add ipv4 gateway for network device "eth0" when not bringing up the interface
> network.c:lxc_setup_network_in_child_namespaces:4038 - Function not implemented - Failed to setup netdev
> conf.c:lxc_setup:4080 - Failed to setup network
> start.c:do_start:1291 - Failed to setup container "vbox"
>
> If I rollback to 4.0.6-2, everything work fine as before.
> If I remove the line "lxc.net.0.ipv4.gateway = 10.0.3.1" in "/var/lib/lxc/vbox/config" (container config),
> the container can start again, but result no network , only loopback interface (lo) in container (no eth0 in container).

From where I stand, I'm unable to reproduce:

❯ sudo lxc-create toto -t debian -- -r bullseye
[snip]
❯ sudo service lxc-net start
❯ ip a
[snip]
7: lxcbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 00:16:3e:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 10.0.3.1/24 brd 10.0.3.255 scope global lxcbr0
valid_lft forever preferred_lft forever
❯ sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
toto STOPPED 0 - - - false
❯ sudo vim /var/lib/lxc/toto/config
[adding ip conf]
❯ sudo cat /var/lib/lxc/toto/config
# Template used to create this container: /usr/share/lxc/templates/lxc-debian
# Parameters passed to the template: -r bullseye
# For additional config options, please look at lxc.container.conf(5)

# Uncomment the following line to support nesting containers:
#lxc.include = /usr/share/lxc/config/nesting.conf
# (Be aware this has security implications)

lxc.net.0.type = veth
lxc.net.0.hwaddr = 00:16:3e:cb:a1:76
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.ipv4.address = 10.0.3.3/24
lxc.net.0.ipv4.gateway = 10.0.3.1
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
lxc.rootfs.path = dir:/var/lib/lxc/toto/rootfs

# Common configuration
lxc.include = /usr/share/lxc/config/debian.common.conf

# Container specific configuration
lxc.tty.max = 4
lxc.uts.name = toto
lxc.arch = amd64
lxc.pty.max = 1024
❯ sudo lxc-start toto
❯ sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED
toto RUNNING 0 - 10.0.3.3 - false

Please, try creating a new unprivileged container and make some tests
with it, as for what I see, it doesn't seem like LXC is buggy.

Cheers!

--
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528 F493 0D44 2664 1949 74E2
It's far easier to fight for principles than to live up to them.
signature.asc

John Wong

unread,
Jan 28, 2022, 1:10:03 AM1/28/22
to
Since the bug report is over a half year, and somehow I don't have the problem anymore, so I
will close it first, if anyone has the problem present, please try to create a new bug report,
thanks.

Regards,
John.
0 new messages