moby / moby/libnetwork

[Feature Request] Bind a specific network interface for a particular overlay network

Open
#1,863 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

Hi, I posted this issue in moby/moby but I think this issue relates more to this repo.

I want to bind a specific network interface for my user-defined overlay network. The reason for this is that DigitalOcean (as well as other cloud providers) offer private networking which allows you to communicate to other VMs within the same data center (region) without going over the public internet and being charged.

If I'm correct, the network interface that each overlay network created on a node goes over is specified when you join the swarm with --advertise-addr. Is it possible to somehow use this as a default, but in addition, when we create a new overlay network we can explicitly specify the network interface we want to use?

ie. docker network create -d overlay --iface eth1 myoverlaynetwork or docker network create -d overlay --internal-ip PRIVATE_IP myoverlaynetwork

In my opinion, this is not even an ideal approach to the problem because not every distribution names their network interfaces with ethX, let alone we cannot guarantee that every node will have the private network interface to be eth1. It could be the case that when a VM is started, it creates eth0 and eth1, but the public interface is actually eth1.

Ultimately, I want to define these overlay networks in a service stack config so I can docker stack deploy my services so that they go over the private network instead of the public internet. I have several overlay networks to isolate container communication, some of which goes across different datacenters, and others within the same datacenter. The services that are running in the same region/datacenter, however, should communicate through the private network interface instead of the public network interface which I am trying to do via another overlay network.

I've also looked into other using other drivers (macvlan, bridge, etc), but I'm not entirely sure if it's possible to do what I want to accomplish.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing overlay network creation through docker network create -d overlay and how swarm --advertise-addr selects the interface. Compare the requested per-network interface or private-IP behavior with stack deployment configuration; done means a documented, working way to route selected overlay networks over the desired interface on every node.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.