Jump to content

How to change default Docker bridge allocation?


Recommended Posts

Hi,

 

I changed my question to answer since I figured it out. Might be it will help soneone else down the road.

 

 

By default Docker assigns 172.17/16 subnet to the bridge.

In my case I needed 172.17/16 for macvlan network, so I swapped default allocation to 172.18/16.

 

In order to do this:

1.

# mkdir /etc/docker && cd /etc/docker

2.

# echo > /etc/docker/daemon.json <<EOF
{
  "bip": "172.18.0.1/16",
  "default-address-pools":
  [
    {"base": "172.18.0.0/16", "size": 24}
  ]
}
EOF

3. Restart Docker and enjoy your new bridge allocation.

 

If at any point you need to observe Docker log:

 

# tail -f /var/log/docker.log

 

Thank you.

Edited by xcore
solved
Link to comment
  • xcore changed the title to How to change default Docker bridge allocation?

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...