Skip to content

address: support IPv4/IPv6 dual bind.#332

Merged
ggreenway merged 3 commits intoenvoyproxy:masterfrom
htuch:ipv6-only
Dec 7, 2017
Merged

address: support IPv4/IPv6 dual bind.#332
ggreenway merged 3 commits intoenvoyproxy:masterfrom
htuch:ipv6-only

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented Dec 7, 2017

@htuch
Copy link
Copy Markdown
Member Author

htuch commented Dec 7, 2017

@rlazarus @mattklein123 Needed for Google dual stacks environments. If this proposal is agreeable, we can hold off on the merge until I implement the equivalent capability Envoy-side.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup LGTM

// <https://tools.ietf.org/html/rfc3493#page-11>`_. Binding to :: will allow
// both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into IPv6
// space as ::FFFF:<IPv4-address>.
bool ipv4_compat = 6;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to allow binding to multiple addresses, and then explicitly specifying both the ipv4 and ipv6 addresses to bind to. That would also allow binding to multiple ipv4 addresses, for instance.

If we go with this instead, how is this implemented? Is there a socket option that enables this, or is it implemented by binding two sockets (one for each address family)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree multiple addresses are another option. It depends where we want to use this; we have an immediate need in the admin interface, so this would involve adding support for multiple admin addresses. For regular use in listeners, it's already possible to just configure a second listener which is otherwise identical.

For our purposes, the current PR is a small delta that fixes our admin interface problem. If there is broader interest in more flexible admin interface binding from others, I'd be open to doing that instead.

In terms of implementation, this is the IPV6_V6ONLY socket option, described in http://man7.org/linux/man-pages/man7/ipv6.7.html. We already set this, forcing it IPv6-only in https://github.com/envoyproxy/envoy/blob/master/source/common/network/address_impl.cc#L223.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine then. It is the easiest way to listen on any address for both ipv4 and ipv6. We can still add multiple-address listeners later if we want/need to.

@ggreenway ggreenway merged commit 893b970 into envoyproxy:master Dec 7, 2017
@htuch htuch deleted the ipv6-only branch December 13, 2017 05:06
htuch added a commit to envoyproxy/envoy that referenced this pull request Jan 3, 2018
This adds support for listening for both IPv4 and IPv6 when binding to ::.

Risk Level: Low
Testing: Added unit tests for resolver and address implementations. No integration tests yet, need to convert the admin integration test to v2 first to allow for ipv4_compat to be set on the admin bind address.
API Changes: envoyproxy/data-plane-api#332

Signed-off-by: Harvey Tuch <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants