Hi,
We’re trying to create ipv6 loopback IP addresses in Rocky 8 during the kickstart with a shell script.
The goal would be that these IP’s are available on first boot.
Previously in CentOS 7 we added them to the ifcfg-lo but this doesn’t work any longer.
So we tried the following by executing this script during kickstart installation via Foreman;
#!/bin/sh
#an IPV6 adress for each instance
#The …99 adress will be used for the multi instance when using the apache reverse proxy (in the future)echo “]] <ipv6.sh> Adding IPV6 address to loopback interface for internal use”
nmcli c add type dummy ifname gateway-multi save yes
ls -l /etc/NetworkManager/system-connectionsfor x in 0001 0002
do
nmcli c modify dummy-gateway-multi +ipv6.addresses 2001:0db8:1234:0000:0000:0000:0000:$x/128
donels -l /etc/NetworkManager/system-connections
nmcli c modify dummy-gateway-multi ipv6.addr-gen-mode eui64
nmcli c modify dummy-gateway-multi ipv6.method static
ls -l /etc/NetworkManager/system-connections
nmcli c show dummy-gateway-multi
ls -l /etc/NetworkManager/system-connections
ifconfig
systemctl restart NetworkManager
ls -l /etc/NetworkManager/system-connections
ifconfig
ls -l /etc/NetworkManager/system-connectionsecho “]] <ipv6.sh> Adding IPV6 address done”
Some lines in the shell script have been added for troubleshooting purpose.
Basically it comes down to these commands;
nmcli c add type dummy ifname gateway-multi save yes
nmcli c modify dummy-gateway-multi +ipv6.addresses 2001:0db8:1234:0000:0000:0000:0000:0001/128
nmcli c modify dummy-gateway-multi ipv6.addr-gen-mode eui64
nmcli c modify dummy-gateway-multi ipv6.method static
nmcli c show dummy-gateway-multi
ifconfig
If above commands are executed in an already build vm they are persistent and the IP’s are still present after reboot.
However our executed scripts logs the following;
ls command shows that the file is not actually created in /etc/NetworkManager/system-connections.
And also nmcli command show the ipv6 addresses while ifconfig only shows the interface but the additional ipv6 addresses are not there.
Once booted, interface dummy-gateway-multi is nowhere to be found.
What are we doing wrong ?