So my question is, what is the best way to remediate the issue:

Option 1: I could create a new network and assign containers to it thusly.

spoiler
docker network create --subnet=192.168.0.0/24 bridge_2

# Then adjust the compose file to reflect the new network

    restart: always
    networks:
      bridge_2:
        aliases:
          - my_container

networks:
  bridge_2:
    external: true

Option 2: I could modify Docker’s network configuration to increase the address pool for networks thusly:

spoiler
nano /etc/docker/daemon.json

# Then edit thusly

{
  "default-address-pools": [
    {
      "name": "bridge_2",
      "subnet": "10.10.0.0/16",
      "gateway": "10.10.0.1"
    }
  ]
}

Which would be best practice? Which would you choose for your network? Or, is there a better way?

'presh

  • hendu@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    7
    ·
    6 days ago

    Do your existing subnets need to be as big as they are? If not, you could shrink them to fit more subnets in.

  • litchralee@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    6 days ago

    For my own networks, I’ve been using IPv6 subnets for years now, and have NAT64 translation for when they need to access Legacy IP (aka IPv4) resources on the public Internet.

    Between your two options, I’m more inclined to recommend the second solution, because although it requires renumbering existing containers to the new subnet, you would still have one subnet for all your containers, but it’s bigger now. Whereas the first solution would either: A) preclude containers on the first bridge from directly talking to containers on the second bridge, or B) you would have to enable some sort of awful NAT44 translation to make the two work together.

    So if IPv6 and its massive, essentially-unlimited ULA subnets are not an option, then I’d still go with the second solution, which is a bigger-but-still-singular subnet.

    • irmadlad@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      6 days ago

      I know I’ll smoke a turd in hell for this but, I am not very IPv6 knowledgeable. Old head, old school, old ways. I would seem to solve a lot of problems tho. Perhaps I should spool up to 2025. LOL

    • irmadlad@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 days ago

      Not sure why someone downvoted you. I don’t really pay it much attention unless it’s someone I’m replying to. I think if you’re going to downvote somebody, you should at the very least give a plausible reason.