Trying to set IPv6 token, adding LXC options in container config file

rsolva

New Member
Nov 13, 2022
1
0
1
Norway
Context: I'm using an up-to-date rocky linux 9 container template on Proxmox 7.2-1.

What I'm trying to achieve is to set an IPv6 token for the container. I know this is possible, because if i add IPV6_TOKEN=::[TOKEN] to /etc/sysconfig/network-scripts/ifcfg-eth0 and do a systemctl restart NetworkManager, the container does get an IPv6 address with the correct token. The only problem is that the ifcfg-eth0 file is overwritten (not persistant) between boots.

When I try an ip token set ::[TOKEN] dev eth0 I get «Error: ipv6: Router advertisement is disabled on device.»

To fix this I tried enabling Router Advertisement for IPv6 by adding the following line at the bottom of /etc/pve/lxc/[CIDR].conf (host/proxmox):

Code:
lxc.sys.ipv6.conf.eth0.accept_ra: 1
# I also tried using '=' instead of ':'

But the lines are striped away from the config file when I start/stop the container. The wiki states that «It is possible to add low-level, LXC style configuration directly […]» and gives a few examples, so I guess this should be possible.

Does anyone know of a way to ensure that the IPv6 token is set permanently for the container?
 
Last edited:
Late Reply but one Option might be to mark the File as something that Proxmox VE shouldn't touch.

I do this for /etc/resolv.conf inside a PiHole LXC Container, but I guess with the right Name it would work for anything.

File /etc/.pve-ignore.resolv.conf:
Code:
# https://forum.proxmox.com/threads/how-to-disable-auto-updates-of-etc-hostsname-etc-resolv-conf-maybe-others.76186/
# https://pve.proxmox.com/wiki/Linux_Container#_guest_operating_system_configuration
# DO NOT let Proxmox VE Update /etc/resolv.conf automatically

There is also a newer Discussion around, although not sure how well it works (didn't test it yet):

 
  • Like
Reactions: UdoB