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

John Wong johnw at wonghome.net
Sun Aug 29 05:31:25 BST 2021


Attached lxc-net, lxc-config and ifconfig-lxcbr0.txt for reference, thanks.
(let me know, if need any/more information)

Regards,
John.

On 8/29/21 12:23 PM, John wrote:
> Package: lxc
> Version: 1:4.0.10-1
> Severity: normal
> X-Debbugs-Cc: johnw at 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:
> 

-------------- next part --------------
lxcbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.0.3.1  netmask 255.255.255.0  broadcast 10.0.3.255
        ether 00:16:3e:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

-------------- next part --------------
# Template used to create this container: /usr/share/lxc/templates/lxc-download
# Parameters passed to the template:
# Template script checksum (SHA-1): 273c51343604eb85f7e294c8da0a5eb769d648f3
# 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)


# Distribution configuration
lxc.include = /usr/share/lxc/config/common.conf
lxc.include = /usr/share/lxc/config/userns.conf
lxc.arch = linux64
lxc.tty.dir =

# Container specific configuration
#lxc.apparmor.profile = lxc-container-default-cgns-local
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 0
lxc.rootfs.path = dir:/var/lib/lxc/vbox/rootfs
lxc.uts.name = vbox

# Container specific configuration
lxc.start.auto = 1
lxc.start.delay = 0
lxc.idmap = u 0 300000 65536
lxc.idmap = g 0 300000 65536
lxc.cap.drop = sys_module mac_admin mac_override sys_time mknod net_raw sys_rawio sys_admin
lxc.no_new_privs = 1

# Network configuration
lxc.net.0.flags = up
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.hwaddr = 00:16:3e:00:00:03
lxc.net.0.ipv4.address = 10.0.3.3/24
lxc.net.0.ipv4.gateway = 10.0.3.1

lxc.cgroup2.memory.max = 800M
lxc.hook.pre-start = /var/lib/lxc/vbox/pre-start.sh

lxc.mount.entry = proc proc proc rw,remount,nodev,nosuid,noexec,relatime,hidepid=2,gid=0 0 0
lxc.mount.entry = tmpfs run tmpfs rw,nosuid,nodev,noexec,relatime,mode=0755,size=100M,create=dir 0 0
lxc.mount.entry = tmpfs run/lock tmpfs rw,nosuid,nodev,noexec,relatime,mode=1777,size=5M,create=dir 0 0
lxc.mount.entry = tmpfs dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,mode=1777,size=384M,create=dir 0 0

-------------- next part --------------
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=""


More information about the Pkg-lxc-devel mailing list