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

Comments

Projects
None yet
4 participants
@DanielDent

-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

This comment has been minimized.

Show comment
Hide comment
@ryanuber

ryanuber Jan 16, 2016

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.

Member

ryanuber commented Jan 16, 2016

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

This comment has been minimized.

Show comment
Hide comment
@DanielDent

DanielDent Jan 16, 2016

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

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

@DanielDent

This comment has been minimized.

Show comment
Hide comment
@DanielDent

DanielDent Jan 16, 2016

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

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

@llevar

This comment has been minimized.

Show comment
Hide comment
@llevar

llevar Feb 15, 2016

+1 for this.

llevar commented Feb 15, 2016

+1 for this.

This was referenced Nov 30, 2016

@sean-

This comment has been minimized.

Show comment
Hide comment
@sean-

sean- Dec 2, 2016

Contributor

@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.

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 Dec 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment