Docker Community Forums

Share and learn in the Docker community.

Default gateway to one service of a stack

Hi,

I have a stack of services that all share the same overlay network:

networks:
  default:
    attachable: true
    driver_opts:
      encrypted: "true"
    ipam:
      driver: default
      config:
        - subnet:  10.0.0.0/16

How can I set a different default-gateway to only one of the services from the stack?
Should I define a new overlay network with the new default gateway and add it to the specific service in addition to the above network?
Thanks.