Enhancement Request: Advertising ports in addition to IP addresses
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
This issue has been discussed already in the context of a software or protocol bug. I'm opening this issue to discuss in the context of an enhancement request.
Right now consul cannot properly communicate with peers across a NAT or docker networks where the bind port is not the same port number as the "public port". This is analogous to the "private ip" and the "public ip" for NAT traversal and the advertise_addr options.
I noticed this issue while setting up consul servers in different docker networks on different host machines and using docker port mappings as described below. Both TCP and UDP packets were mapped as needed.
Host 1
------
name: ac6db779e074
public ip address: 34.207.190.35
private ip address (within the aws subnet): 172.31.32.100
port mappings:
-p 115:8300
-p 116:8301
-p 117:8302
Host 2
------
name: 6ec45ab0e5b1
public ip address: 34.201.68.103
private ip address (within the aws subnet): 172.31.32.101
port mappings
-p 415:8300
-p 416:8301
-p 417:8302
The consul logs indicated that both servers were attempting to communicate with the other using their public ip addresses (good), on port 8301 (bad). The ports 116 and 416 are desired.
I am wondering if augmenting the addvertise_addr config option to take both an address and port list would be something that the consul community is open to.
thanks,
Chris
Contributor guide
Research direction
The issue names no files or tests; begin by tracing the existing advertise_addr configuration and the peer communication paths that currently use port 8301. Done means the enhancement has a defined configuration and verified behavior for distinct advertised ports across the described NAT and Docker mappings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker, go
- Domain
- cloud, distributed-systems, infrastructure, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100