Creation of dummy ipv6 IP address during kickstart

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-connections

for x in 0001 0002
do
nmcli c modify dummy-gateway-multi +ipv6.addresses 2001:0db8:1234:0000:0000:0000:0000:$x/128
done

ls -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-connections

echo “]] <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 ?

First, I have no idea what a “loopback address” is (apart from the localhost.localdomain).

Second, one of the default packages makes NetworkManager to support the RHEL legacy /etc/sysconfig/network-scripts/ifcfg-* format.
As example, an system, where install did not define (and save) connections does autodefine connections for interfaces by default (but does not save). Once you modify such connection, it will be saved as /etc/sysconfig/network-scripts/ifcfg-$devname

nmcli can give multiple options on oneliner:

nmcli c add type dummy ifname gateway-multi  ipv6.method static +ipv6.addresses 2001:0db8:1234:0000:0000:0000:0000:0001/128 ipv6.addr-gen-mode eui64

It makes sense to initialize all values on creation, rather than modify later?

RHEL doc says that you have to set both IPv4 and IPv6: Chapter 24. Creating a dummy interface Red Hat Enterprise Linux 8 | Red Hat Customer Portal
For example:

nmcli c add type dummy ifname gateway-multi  ipv4.method disabled ipv6.method static +ipv6.addresses 2001:0db8:1234:0000:0000:0000:0000:0001/128 ipv6.addr-gen-mode eui64

The net-tools (includes ifconfig) is described obsolete – since iproute2 was introduced couple decades ago.

When you write ‘kickstart’, does that use Red Hat’s ‘Kickstart’?
That kickstart can define/configure connections: Appendix B. Kickstart commands and options reference Red Hat Enterprise Linux 8 | Red Hat Customer Portal
Not sure whether it can create a dummy.

My current procedure is to do only a minimal install and then run Ansible play (in “already built” system) that installs and configures everything, including additional network touches.

Thanks for your feedback but it looks like what we want to achieve is no longer possible during kickstart/anaconda. So we will have to define the network interface after the build is complete.