-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows use of broadcast IP as bind address. #1570
Conversation
+1 for this. I have a different use case, but this would help me a lot. I'm currently using consul in a multi-host cluster. in this case, my consul nodes have two private ip addresses: one for my overlay network ( 10.X.X.X) and another for the host bridge network . consul will not start in this case, because there are multiple 'private' ip addresses available. Currently, my only option is to use -advertise or -bind to select the exact ip address. the problem with that, though, is that the ip address is dynamic, so there's no option available. This PR would give me what i need. I want to bind to whatever address i get on the 10.X overlay network, without knowing in advance what exact IP it is. |
@beornf , thank you for this PR. There is work that is landing soon that will address this issue. This issue and the others referenced above are all targets for this pending work. This is a problem we are aware of and will be addressing. |
Cool. I've been following issue #725 about a proposal to bind to a given interface as well as subnet as done in this PR. Looking forward to the work that targets the many use cases. |
This issue is great. Please merge it! |
Please merge |
Any chances for this one to be merged?.. |
+1 please merge, I have multiple VLANs and private IPs and need to be able to specify the correct network to bind to. |
👍 yes please. |
@slackpad What can I do to help push this forward? This would really help me with some overlay/underlay networking stuff. There seems to be a merge conflict now, but the patch looks pretty self contained, so I'd imagine it is easy to resolve. I'd be happy to resolve the conflicts and make a new PR. I suspect there is something more keeping this from getting merged. |
I'll take another look here now that 0.7 is out. We have some other bind address related stuff pending so just need to make sure everything makes sense together. |
Any movement on this? It would be very helpful for us. |
Yeah, we would be happy to have this feature as well! |
@beornf / @dcowden / @nejtr0n / @westsouthnight / @ashald / @kylegato / @raykrueger / @ChrisLundquist / @fhaynes : Please give the latest code in
With the
There is now a configurable template language for examples and docs) behind this that you can use to create a customizable heuristic that should allow you to get whatever it is that you need from your environment when using an immutable image (see hashicorp/go-sockaddr/template and cmd/sockaddr. |
In consul options, a binding address of 0.0.0.0 is used to resolve a nodes private IP. However if there are multiple private IPs this broadcast address is too wide as I found testing in a Docker container.
This allows the use of a given subnet IP e.g. 10.99.0.0 which will return the first matching IP among the network 10.99.0.0/24 such as 10.99.0.5. It also address a couple issues raised #1110 and #1478. Let me know if this solves the use case and follows idiomatic Go.