Docker network conflicts with local networks

create a specified network to fix the conflicts

Docker Compose Network Conflicts

Compose default network conflicts with the local network

To fix this issue, we should config the specified network by compose file.

Here is a sample.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
services:
# ...
networks:
    net1:
        ipam:
            config:
                # if not set, the default gateway is 172.66.99.1
                -   subnet: 172.66.99.0/24
                # or set a gateway
                # -   subnet: 172.34.0.0/16
                #     gateway: 172.34.0.1
Licensed under CC BY-NC-SA 4.0
Last updated on Aug 14, 2026 00:00 UTC