Centos/Fedora LXC doesnt boot with networking applied

yswery

Well-Known Member
May 6, 2018
78
5
48
54
Hi all

I am using the default centos7 or Fedora or even centos LXC templates from the proxmox downloader (nothing custom at all) and when the LXC CT is created and strated for the first time, the container does not have the static IP addresses applied. However if you reboot it AFTER it gets applied correctly:

LXC config of creation:

Code:
pct config 422
arch: amd64
cores: 1
description: {"user_id"%3A2,"service_id"%3A10863}%0A
features: fuse=1,mknod=1,mount=nfs;cifs,nesting=1
hostname: test.test.com
memory: 512
net0: name=eth0,bridge=vmbr0,gw=10.0.0.1,hwaddr=22:64:73:51:9A:55,ip=111.222.111.222/32,type=veth
onboot: 1
ostype: centos
rootfs: SSD_STORAGE_NFS:422/vm-422-disk-0.raw,size=30109M
swap: 0

I am on PVE 7.0-11 and we have legacy cgroups enabled in the grub (as per docs)

How can I debug why on the very first boot there is no IP address applied to the centos LXC container while if I reboot it after it gets applied all fine.


Here is what the `ip a` shows after first time booting the CT:


Code:
eth0@if281: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 22:64:73:51:9a:55 brd ff:ff:ff:ff:ff:ff link-netnsid 0

and after a reboot of the container we can see the networking IP applied correctly:

Code:
eth0@if282: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 22:64:73:51:9a:55 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 111.222.111.222/32 brd 111.222.111.222 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::2064:73ff:fe51:9a55/64 scope link
       valid_lft forever preferred_lft forever
 
Last edited:
Another little point, on the first time the container is booted, ont he PVE host I see the following:

Code:
284: veth422i0@if5: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master vmbr0 state LOWERLAYERDOWN group default qlen 1000

But after I reboot the LXC container I see:

Code:
285: veth422i0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master vmbr0 state UP group default qlen 1000

Which works correctly and all fine, why is this happening? (and specifically with Centos)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!