OpenWrt images don't generate ULA prefix

While configuring OpenWrt, I noticed that the ULA prefix is not being auto generated. According to this post [Solved] Auto-generate ULA Prefix on compiled firmware - #5 by jow - For Developers - OpenWrt Forum by Jow, it is generated automatically upon first boot if the network config has ula_prefix set to auto.

I believe all that is needed would be to add the following to the network configuration located at /etc/config/network:

config globals 'globals'
        option ula_prefix 'auto'

Otherwise the generation code could be adapted to set it, that’s here: openwrt/package/base-files/files/etc/uci-defaults/12_network-generate-ula at 17b0d1379a3cd4a2e2dbefa7d0f9bc281269f97e · openwrt/openwrt · GitHub

It looks like it would be an easy change.

Have you tested it yet? How are you launching your VM?

I tested it successfully with the container image.

  1. Create: incus create images:openwrt/23.05 owrt-test
  2. Edit the config: incus file edit owrt-test/etc/config/network, adding the following:
config globals 'globals'
        option ula_prefix 'auto'
  1. Start: incus start owrt-test
  2. Check: incus exec owrt-test cat /etc/config/network, the ula_prefix should change from auto to something like fdb0:b828:a551::/48.
1 Like