Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to make /etc/docker/daemon.json "default-address-pools" persistent across reboots

Featured Replies

My searches on the forum suggest inputting something in the docker.cfg file on the flash drive. I have found the file, but don't understand the format I need to use to make these settings persistent across OS reboots:

{

"default-address-pools": [

{

"base": "172.23.0.0/16",

"size": 24

}

]

}

Thanks for any advice you can offer!

Solved by clnhlzmn

  • 2 months later...
  • Solution

In case you never figured this out, and for the benefit of other people searching for this: you have to put this in /boot/config/go as in add the following (or equivalent) to that file:

mkdir /etc/docker
cat << EOF > /etc/docker/daemon.json
{
  "default-address-pools": [ 
    { "base": "172.23.0.0/16", "size": 24 }
  ]
}
EOF

That will cause the daemon.json file to be created with the given content on every boot.

Edited by clnhlzmn

  • 8 months later...
On 1/12/2026 at 6:49 AM, clnhlzmn said:

In case you never figured this out, and for the benefit of other people searching for this: you have to put this in /boot/config/go as in add the following (or equivalent) to that file:

mkdir /etc/docker
cat << EOF > /etc/docker/daemon.json
{
  "default-address-pools": [ 
    { "base": "172.23.0.0/16", "size": 24 }
  ]
}
EOF

That will cause the daemon.json file to be created with the given content on every boot.

This doesn't work for me, because there is already something writing this file, maybe the nvidia plugin?

root@HTPC:~# cat /etc/docker/daemon.json

{

"runtimes": {

"nvidia": {

"path": "/usr/bin/nvidia-container-runtime",

"runtimeArgs": []

}

}

}

  • Community Expert

I’m curious why this is needed/is an issue?

You should not be using the internal container IPs and there are better ways to address what I suspect you’re trying to do.

15 hours ago, MowMdown said:

I’m curious why this is needed/is an issue?

You should not be using the internal container IPs and there are better ways to address what I suspect you’re trying to do.

I encounter this issue because I end up running out of address pools after creating a certain number of various docker stacks, when in turn make their own network. Seems to be something like 30 networks or something.

  • Community Expert
19 hours ago, Bob Cadenza said:

I encounter this issue because I end up running out of address pools after creating a certain number of various docker stacks, when in turn make their own network. Seems to be something like 30 networks or something.

I dont see how you're running out of 254 addresses on the default network size. Are you running more than 254 separate containers?

furthermore you can create custom docker networks which would then get their own separate entire pool of IPs

for example, look at bridge and proxy-net. these both have 512 addressable IPs per poolimage.png

Edited by MowMdown

  • Author

I too have over 30 stacks with separate networks, and the /16 networks chew up an insane amount of address space. Limiting the networks to /24 or smaller makes the route table much cleaner. Since the configuration to change from /16 to /24 does not survive a reboot, this script is needed.

We aren't running out of addresses in a subnet. We are running out of SUBNETS. The problem with using a 16 bit mask is that chews up 65,536 addresses per subnet. By using 24 bit masks we get 256 subnets in the space of the original 16 bit mask.

https://en.wikipedia.org/wiki/Subnet

Specifically, the section on Subnet host count.

Attached below are just some of the stack networks on my unraid

neworks.jpg

4 minutes ago, matthrolf said:

I too have over 30 stacks with separate networks, and the /16 networks chew up an insane amount of address space. Limiting the networks to /24 or smaller makes the route table much cleaner. Since the configuration to change from /16 to /24 does not survive a reboot, this script is needed.

We aren't running out of addresses in a subnet. We are running out of SUBNETS. The problem with using a 16 bit mask is that chews up 65,536 addresses per subnet. By using 24 bit masks we get 256 subnets in the space of the original 16 bit mask.

https://en.wikipedia.org/wiki/Subnet

Specifically, the section on Subnet host count.

Attached below are just some of the stack networks on my unraid

neworks.jpg

Exactly, what did you end up doing? Adding the /boot/config/go script in the first reply? Do you have nvidia card?

  • Author
Just now, Bob Cadenza said:

Exactly, what did you end up doing? Adding the /boot/config/go script in the first reply? Do you have nvidia card?

I am not the person who has the nvidia card. The advice posted above solved my problem, and the result is the screenshot above.

Below is an example of using the default settings, and this host has run out of subnets:

out of networks.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.