# Creation of dummy ipv6 IP address during kickstart

**URL:** <https://forums.rockylinux.org/t/creation-of-dummy-ipv6-ip-address-during-kickstart/5060>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 7, 2022, 12:55pm UTC](https://forums.rockylinux.org/t/creation-of-dummy-ipv6-ip-address-during-kickstart/5060 "2022-01-07T12:55:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![S1lv3rW1z4rd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/s1lv3rw1z4rd/32/1586_2.png) [@S1lv3rW1z4rd](https://forums.rockylinux.org/u/S1lv3rW1z4rd)\
**Post date:** [January 7, 2022, 12:55pm UTC](https://forums.rockylinux.org/t/creation-of-dummy-ipv6-ip-address-during-kickstart/5060/1 "2022-01-07T12:55:04Z")

</div>

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;

 ![MicrosoftTeams-image (1)](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/c/c1c7d6ac519b2d7e323ba40ad7e36fd3ce8e5f30.png)

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 ?

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 7, 2022, 1:20pm UTC](https://forums.rockylinux.org/t/creation-of-dummy-ipv6-ip-address-during-kickstart/5060/2 "2022-01-07T13:20:41Z")

</div>

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:

```auto
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&nbsp;24.&nbsp;Creating a dummy interface Red Hat Enterprise Linux 8 | Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/creating-a-dummy-interface_configuring-and-managing-networking)  
For example:

```auto
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&nbsp;B.&nbsp;Kickstart commands and options reference Red Hat Enterprise Linux 8 | Red Hat Customer Portal](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/kickstart-commands-and-options-reference_installing-rhel-as-an-experienced-user#kickstart-commands-for-network-configuration_kickstart-commands-and-options-reference)  
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.

---

<div class="post-metadata">

**Author:** ![S1lv3rW1z4rd](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/s1lv3rw1z4rd/32/1586_2.png) [@S1lv3rW1z4rd](https://forums.rockylinux.org/u/S1lv3rW1z4rd)\
**Post date:** [January 10, 2022, 1:52pm UTC](https://forums.rockylinux.org/t/creation-of-dummy-ipv6-ip-address-during-kickstart/5060/3 "2022-01-10T13:52:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:57am UTC](https://forums.rockylinux.org/t/creation-of-dummy-ipv6-ip-address-during-kickstart/5060/4 "2023-08-25T03:57:48Z")

</div>


