# cloud-init and ipv6



## einsibjani (Oct 4, 2022)

I started a project where I deploy one golden template with cloud-init installed and then clone the template for my VM's. 

It seems the FreeBSD renderer for networking in cloud-init doesn't support IPv6 at all. I've looked at the code, and it just looks for 'static' interfaces, it doesn't deal with 'static6' interfaces at all.
I can patch it and hope it gets accepted upstream, but I'm curious, is this really the state of cloud-init on FreeBSD?


----------



## Ole (Oct 4, 2022)

cloud-init minimally supports FreeBSD. You will also have problems with nameservers(v6), IP aliases and secondary interfaces and so on ;-)
For this reason, in CBSD where FreeBSD cloud images are widely used, I apply some local patches as a workaround to get IPv6 working (but I don't have the strength to fix it in upstream). Maybe this initiative will help: https://scratchpad.pkgbase.live/XZtaQUk-ToSsnaIpnQa6tQ . Also, a *netlink* subsystem has recently been added to FreeBSD. Probably  we will get ip(8) instead of ifconfig(8) soon and will reduce the difference in the cloud-init code between Linux/FreeBSD ;-)


----------



## einsibjani (Oct 4, 2022)

I patched cloud-init and it seems to support what I need. I basically need ip addresses, grow disks and routing. The rest can be done with ansible, either when deploying the template, or after the new VM is booted.

I’ll see if what I have gets merged upstream


----------



## Ole (Oct 5, 2022)

Try contacting Gonéri Le Bouder. This guy has made support for FreeBSD/NetBSD/DragonFlyBSD/OpenBSD in cloud-init, and maybe he can help you add your fixes faster.
​


----------



## Sebastian (Nov 25, 2022)

Ole It seems he already providing images https://bsd-cloud-image.org/

But yes , I would able to do it myself.


----------



## einsibjani (Nov 30, 2022)

Support for static IPv6 addresses was merged in https://github.com/canonical/cloud-init/commit/871edd50fb9da441e4ef2fbebc435dfb8baa4127


----------



## Ole (Dec 20, 2022)

Sebastian said:


> Ole It seems he already providing images https://bsd-cloud-image.org/
> 
> But yes , I would able to do it myself.


Yes, we talked a lot with Gonéri  through Telegram. Not all images from https://bsd-cloud-image.org/ work for me - they are focused on receiving data on the network (OpenStack), while I use *NoCloud* datasource. Also I need 'zfs' and 'ufs' version of FreeBSD cloud images, therefore, I also use my own images generated automatically.


----------



## einsibjani (Dec 20, 2022)

Add support for static IPv6 addresses for FreeBSD (#1839) · canonical/cloud-init@871edd5
					

Currently, FreeBSD ignores IPv6 addresses. This PR adds support for static IPv6 addresses




					github.com
				











						Add support for setting uid when creating users on FreeBSD (#1888) · canonical/cloud-init@aecdcbf
					

* Add support for setting uid when creating users on FreeBSD  * Test if uid in config is used when creating user in FreeBSD  * Merge two branches in if statement.  Unit test uid in pw call fo...




					github.com
				




Support for static IPv6 and setting uid got merged, now just waiting for next release


----------



## Sebastian (Dec 21, 2022)

Can someone share the scripts to build the images . I was pretty sure that they were in Gonéri Le Bouder repo , but can't find them anymore. thanks !


----------

