moby / moby/libnetwork

[feature request] virtual IP for bridge network

Open
#2,477 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description
I have started multiple copy of apache daemon. Daemons configured to use non local IP address.
Now I want use floating IP feature for daemons redundant.
Say if one demon died, then orchestration daemon assign floating IP to other container.

When I try attach secondary IP to container i get error

$ docker network connect --ip 192.168.54.22 test-net test-pod
Error response from daemon: endpoint with name test-pod already exists in network test-net

Could you allow secondary IP to containers or allow containers have multiple network interfaces to same network.

Steps to reproduce the issue:
Create user defined network

$ docker network create --subnet 192.168.55.0/24 test-net
65ca95fa63cc0e251be4ef74d47c9bddac85cfe588d6233119477fcd4b4e619c

Create new container

$ docker run -d --name test-pod --network test-net alpine:edge sleep 1000000
76435b80c5e7076c1bfb2b57cb72f08619ac7eda373d141ab7ff810c37797005

Check network interfaces in continer

[safarov@safarov-dell kamailio-upstream]$ docker exec test-pod ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:C0:A8:37:02  
          inet addr:192.168.55.2  Bcast:192.168.55.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9781 (9.5 KiB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Try assign secondary IP address

$ docker network connect --ip 192.168.55.22 test-net test-pod
Error response from daemon: endpoint with name test-pod already exists in network test-net

Describe the results you received:
I cannot assign secondary IP address to container network interface.

Describe the results you expected:
I can able assign secondary IP address to container network interface.

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 with the docker network connect behavior demonstrated in the reproduction, including the endpoint-already-exists error when reusing test-net. Trace the networking entry point for connecting a container and define completion as allowing a secondary IP or multiple interfaces on the same network without that error, with coverage for the shown commands.

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.