-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Expose a global switch to disable IPV6 to overcome DualMode socket issues in environments that do not support IPV6 #47583
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBCL and external libraries tend to shift towards dual-stack sockets in their networking code. This conforms to best practices defined in RFC1933, but can lead to issues when connections are established through VPN tunnels which do not support IPv6 and/or dual-stack properly. A custom ConnectCallback can help in HttpClient use cases where users have direct control over their HttpClient instances (#47267), but in cases where the Socket connections are carried out by an external component, users may get blocked (#45462). This cases are rare, but the fix is simple, and easy to communicate (see #45893), therefore we should consider implementing it in .NET 6.
|
Would it make sense to generalize it to global switch to disable either IPv4 or IPv6? |
I doubt it. I haven't heard any issues re IPv4. Even if we wanted to do this, I think it would be a separate switch. |
Triage: We cannot do today IPv6 only, so let's add DisableIPv6 switch. |
Another case in #52287 |
Fixes #47583. Resolves #52287, #54807 and similar issues, without changing customer application code. Introduces an AppContext switch `System.Net.DisableIPv6` and environment variable `DOTNET_SYSTEM_NET_DISABLEIPV6` to emulate the lack of OS-level IPv6 support. This is useful to workaround dual-stack socket issues when the OS reports support of IPv6, but some other underlying infrastructure element (typically VPN) doesn't function well with IPv6 request. For consistency, this switch also impacts NameResolution and Ping, not only Sockets.
BCL as well as external libraries tend to shift towards dual-stack sockets in their networking code. This conforms to best practices defined in RFC1933, but can lead to issues when connections are established through VPN tunnels which do not support IPv6 and/or dual-stack properly.
A custom ConnectCallback can help in HttpClient use cases where users have direct control over their HttpClient instances (#47267), but in cases where the Socket connections are carried out by an external component, users may get blocked (#45462).
This cases are rare, but the fix is simple, and easy to communicate (see #45893), therefore we should consider implementing it in .NET 6.
The text was updated successfully, but these errors were encountered: