Container losing network

Hello all,

I’ve seen some similar posts here but they don’t match my setup so here goes …
My lxc container keeps losing its ips and hence its network is dead. Both host and guest are alma 9. Here is how I set it up:

As mentioned in some discussions I found I disabled ipv6 in the container and the host like this:

sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1

also added to /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1

ip a shows that ipv6 is gone. However after approx. 2 days the network vanished again so this solution obviously doesn’t work. I created the container like this:

yum -y install dnsmasq lxc.x86_64 lxc-templates.x86_64
sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
setenforce 0
changed /etc/sysconfig/lxc => USE_LXC_BRIDGE="true"
systemctl start lxc-net.service
lxc-create -P /raid -n container -t download

almalinux
9
amd64

lxc-start -P /raid -n container

Any help would be welcome :slightly_smiling_face: