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

Allow :: as a bind address (binds to first public IPv6 address) #1219

Merged
merged 1 commit into from Mar 19, 2016

Conversation

@42wim
Copy link
Contributor

42wim commented Sep 5, 2015

This patch allows "::" to -bind (as the IPv6 counterpart for the IPv4 0.0.0.0)
The behaviour is opposite of the IPv4 though, it will look for the first public accessible IPv6 address to bind to. (instead of the first private accessible address with IPv4).

As IPv6 does not really have private addresses (not including ULA), if you want to use IPv6 you probably want to bind to the Global Unicast Address.

With these modifications, you can run IPv6-only containers with consul without knowing the IPv6 address beforehand. And thus can setup a complete IPv6-only consul environment.

If you're interested in merging this I'll add tests too.

Impacts #725
Fixes #529 if -bind :: is used

@ryanbreen
Copy link
Contributor

ryanbreen commented Sep 12, 2015

This looks cool. Personally, I don't see any reason not to merge (with tests, though).

@42wim 42wim force-pushed the 42wim:ipv6fixes branch Sep 12, 2015
@42wim
Copy link
Contributor Author

42wim commented Sep 12, 2015

Added tests (based on the ipv4 ones) and rebased

@ryanbreen
Copy link
Contributor

ryanbreen commented Sep 12, 2015

Cool, this LGTM. Only question is whether @armon, @ryanuber, or @slackpad have philosophical objections to "first public IPv6" being a supported config when we've only ever offered first available private IP binding for IPv4.

I know there are systemic differences between IPv6 and IPv4 that make public IPs more appropriate in IPv6, but this is enough of a difference that I'm not comfortable merging without one of the project owners weighing in.

@42wim
Copy link
Contributor Author

42wim commented Sep 12, 2015

Ok, also maybe I should rename it to the "first Global Unicast Address" instead of "first public IPv6" address.

@42wim
Copy link
Contributor Author

42wim commented Nov 9, 2015

ping @armon, @ryanuber, @slackpad
Any comments ?

@slackpad
Copy link
Contributor

slackpad commented Mar 18, 2016

Hi @42wim wow sorry for the delay on this one! I think we can take this if you can to a rebase and use [::] instead of :: so that it doesn't break any port number parsing on this in the future.

@slackpad slackpad removed the thinking label Mar 18, 2016
@42wim 42wim force-pushed the 42wim:ipv6fixes branch to b5d4532 Mar 18, 2016
@42wim
Copy link
Contributor Author

42wim commented Mar 18, 2016

Ok, I changed it to [::] and rebased

if ip.To4() != nil {
continue
}
// do not bind link-local (fe80::/10) / ULA (fc00::/7) / loopback (::1)

This comment has been minimized.

Copy link
@slackpad

slackpad Mar 18, 2016

Contributor

@42wim I had one other question for you - this will catch the cases you care about - will it knock out any useful addresses? It looks like it's blocking a superset of what you want to avoid.

This comment has been minimized.

Copy link
@42wim

42wim Mar 19, 2016

Author Contributor

@slackpad Those FX::/yy ranges are reserved for specials. Never say never, but the chance that a new global unicast address range will be allocated from that range is very slim.

This comment has been minimized.

Copy link
@slackpad

slackpad Mar 19, 2016

Contributor

I noticed Go's net library had support for a couple of these so I tweaked this a little to be more specific.

This comment has been minimized.

Copy link
@42wim

42wim Mar 20, 2016

Author Contributor

Oh nice! That's much better.

@slackpad slackpad merged commit b5d4532 into hashicorp:master Mar 19, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@slackpad
Copy link
Contributor

slackpad commented Mar 19, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.