Menu

#6555 Network gateway not set

closed
nobody
None
2019-03-08
2019-03-07
Anonymous
No

Originally created by: rvernica

Description of the issue

By default docker-compose creates a network which contains:

        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        }

I want to change the subnet due to conflicts, so in my docker-compose.yml I add:

version: '3.7'
...
networks:
  default:
    ipam:
      config:
      - subnet: 192.168.2.0/24

This creates a network with the expected subnet but the gateway entry is lost:

        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "192.168.2.0/24"
                }
            ]
        },

Context information (for bug reports)

Output of docker-compose version

> docker-compose version
docker-compose version 1.23.2, build 1110ad0
docker-py version: 3.7.0
CPython version: 2.7.5
OpenSSL version: OpenSSL 1.0.2k-fips  26 Jan 2017

Output of docker version

> docker version
Client:
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:35:01 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:06:30 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Related

Tickets: #6569

Discussion

  • Anonymous

    Anonymous - 2019-03-08

    Ticket changed by: ijc

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2019-03-08

    Originally posted by: ijc

    I think you need to specify the gateway explicitly if you want one since there is no default (this is the behaviour of the underlying engine too, at least in my experiments with 18.09.1).

    I'll close this issue since it is behaving as I would have expected.

     

Log in to post a comment.