Skip to content
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

Feature request: specify IP range(s) to use for binding #1620

Closed
DanielDent opened this issue Jan 16, 2016 · 5 comments
Closed

Feature request: specify IP range(s) to use for binding #1620

DanielDent opened this issue Jan 16, 2016 · 5 comments

Comments

@DanielDent
Copy link

-bind - .... "By default, this is "0.0.0.0", meaning Consul will use the first available private IP address."

It would be nice to have an option such as -bind-ranges where users can specify the CIDRs for interfaces which are acceptable to bind to.

With some SDN implementations, it's common to have multiple private IP ranges available on a node. But only some of those interfaces will be on a network which is reachable by all the other nodes in the cluster. Having this configuration option would avoid the need to create a pre-startup script which does introspection of the node to identify an appropriate bind address.

@ryanuber
Copy link
Member

There is a related discussion in Nomad here: hashicorp/nomad#223. The TL;DR is that it may be more consistent to allow binding to a named interface, though we are still thinking about the best solution.

@DanielDent
Copy link
Author

Sorry I missed that issue in my search. I'll jump in on that thread. Thanks.

@DanielDent
Copy link
Author

Oh, that issue was on nomad, that's why I missed it. I guess this issue is equally applicable to both projects.

@yakneens
Copy link

+1 for this.

This was referenced Nov 30, 2016
@sean-
Copy link
Contributor

sean- commented Dec 2, 2016

@DanielDent / @llevar : Please give the latest code in master a twirl. The syntax for supporting IP addresses or getting the first "usable" IP address on an interface is included below and can be passed to any address parameter within Consul (e.g. -bind or bind_addr, or any other *_addr-like parameter):

-bind='{{ GetInterfaceIP "eth0" }}'
-bind='{{ GetAllInterfaces | include "network" "10.0.0.0/8" }}'

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.

@sean- sean- closed this as completed Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants