curl request to IPv6 localhost gets stuck

Clash Royale CLAN TAG#URR8PPP
A docker container of mine exposes a HTTP interface on port 8500, which is
mapped to host port 8500. It is not IPv6 enabled.
This still means, I should be able to access it at
localhost:8500. IPv6 is preferred, so I end up with a request to [::1]:8500. This one
gets stuck, it never returns.
Reproducing this with curl, this command gets stuck:
curl -g -6 "http://[::1]:8500"
curl's --verbose option reveals nothing, neither does --ascii-trace.
At the same time, a request to IPv4's localhost succeeds:
curl http://127.0.0.1:8500
giving me the expected HTML. If I run an IPv4 HTTP server on loopback, using
python -m SimpleHTTPServer 4001
then I get lots of HTML for IPv4's localhost
curl http://127.1:4001
and a proper connection failure for IPv6:
curl -g -6 "http://[::1]:4001"
curl: (7) Failed to connect to ::1 port 4001: Connection refused
Things to note: Docker 1.7.1. IPv6 is not enabled for the container, hence
there are no IPv6 iptable rules. (ip6tables -v -L gives nothing)
My question is: Why does the request get stuck, and doing what?
ipv6 docker ipv4
|
show 3 more comments
A docker container of mine exposes a HTTP interface on port 8500, which is
mapped to host port 8500. It is not IPv6 enabled.
This still means, I should be able to access it at
localhost:8500. IPv6 is preferred, so I end up with a request to [::1]:8500. This one
gets stuck, it never returns.
Reproducing this with curl, this command gets stuck:
curl -g -6 "http://[::1]:8500"
curl's --verbose option reveals nothing, neither does --ascii-trace.
At the same time, a request to IPv4's localhost succeeds:
curl http://127.0.0.1:8500
giving me the expected HTML. If I run an IPv4 HTTP server on loopback, using
python -m SimpleHTTPServer 4001
then I get lots of HTML for IPv4's localhost
curl http://127.1:4001
and a proper connection failure for IPv6:
curl -g -6 "http://[::1]:4001"
curl: (7) Failed to connect to ::1 port 4001: Connection refused
Things to note: Docker 1.7.1. IPv6 is not enabled for the container, hence
there are no IPv6 iptable rules. (ip6tables -v -L gives nothing)
My question is: Why does the request get stuck, and doing what?
ipv6 docker ipv4
1
Would you show us the output of "netstat -6 -an"?
– Rui F Ribeiro
Dec 1 '15 at 11:20
Yep, docker is listening on that port:tcp6 0 0 :::8500 :::* LISTEN 1648/dockerFascinating. Why? And why is it blocking?
– mknecht
Dec 1 '15 at 11:55
Listening and not configured, or IPv6 disabled in sysctl, I guess. nginx, apache, lighthttp, would you append the web server in question to the post, please?
– Rui F Ribeiro
Dec 1 '15 at 13:18
Inside the container, Consul, a key-value store for configuration, is listening. But I don't think it's relevant: the container has not been IPv6-enabled. That request should never reach Consul. I don't get on which layer it gets stuck, though. On the host,/proc/sys/net/ipv6/conf/all/disable_ipv6yields 0, so IPv6 should be enabled.
– mknecht
Dec 1 '15 at 13:39
2
That does not mean much. You can have IPv6 disabled even in sysctl, and in newer kernels, as long as the program binds to an IPv6 socket, the request is honoured. A pain in the ass, as you must go through each daemon that supports IPv6 and disable the IPv6 configuration.
– Rui F Ribeiro
Dec 1 '15 at 14:09
|
show 3 more comments
A docker container of mine exposes a HTTP interface on port 8500, which is
mapped to host port 8500. It is not IPv6 enabled.
This still means, I should be able to access it at
localhost:8500. IPv6 is preferred, so I end up with a request to [::1]:8500. This one
gets stuck, it never returns.
Reproducing this with curl, this command gets stuck:
curl -g -6 "http://[::1]:8500"
curl's --verbose option reveals nothing, neither does --ascii-trace.
At the same time, a request to IPv4's localhost succeeds:
curl http://127.0.0.1:8500
giving me the expected HTML. If I run an IPv4 HTTP server on loopback, using
python -m SimpleHTTPServer 4001
then I get lots of HTML for IPv4's localhost
curl http://127.1:4001
and a proper connection failure for IPv6:
curl -g -6 "http://[::1]:4001"
curl: (7) Failed to connect to ::1 port 4001: Connection refused
Things to note: Docker 1.7.1. IPv6 is not enabled for the container, hence
there are no IPv6 iptable rules. (ip6tables -v -L gives nothing)
My question is: Why does the request get stuck, and doing what?
ipv6 docker ipv4
A docker container of mine exposes a HTTP interface on port 8500, which is
mapped to host port 8500. It is not IPv6 enabled.
This still means, I should be able to access it at
localhost:8500. IPv6 is preferred, so I end up with a request to [::1]:8500. This one
gets stuck, it never returns.
Reproducing this with curl, this command gets stuck:
curl -g -6 "http://[::1]:8500"
curl's --verbose option reveals nothing, neither does --ascii-trace.
At the same time, a request to IPv4's localhost succeeds:
curl http://127.0.0.1:8500
giving me the expected HTML. If I run an IPv4 HTTP server on loopback, using
python -m SimpleHTTPServer 4001
then I get lots of HTML for IPv4's localhost
curl http://127.1:4001
and a proper connection failure for IPv6:
curl -g -6 "http://[::1]:4001"
curl: (7) Failed to connect to ::1 port 4001: Connection refused
Things to note: Docker 1.7.1. IPv6 is not enabled for the container, hence
there are no IPv6 iptable rules. (ip6tables -v -L gives nothing)
My question is: Why does the request get stuck, and doing what?
ipv6 docker ipv4
ipv6 docker ipv4
asked Dec 1 '15 at 9:00
mknechtmknecht
1463
1463
1
Would you show us the output of "netstat -6 -an"?
– Rui F Ribeiro
Dec 1 '15 at 11:20
Yep, docker is listening on that port:tcp6 0 0 :::8500 :::* LISTEN 1648/dockerFascinating. Why? And why is it blocking?
– mknecht
Dec 1 '15 at 11:55
Listening and not configured, or IPv6 disabled in sysctl, I guess. nginx, apache, lighthttp, would you append the web server in question to the post, please?
– Rui F Ribeiro
Dec 1 '15 at 13:18
Inside the container, Consul, a key-value store for configuration, is listening. But I don't think it's relevant: the container has not been IPv6-enabled. That request should never reach Consul. I don't get on which layer it gets stuck, though. On the host,/proc/sys/net/ipv6/conf/all/disable_ipv6yields 0, so IPv6 should be enabled.
– mknecht
Dec 1 '15 at 13:39
2
That does not mean much. You can have IPv6 disabled even in sysctl, and in newer kernels, as long as the program binds to an IPv6 socket, the request is honoured. A pain in the ass, as you must go through each daemon that supports IPv6 and disable the IPv6 configuration.
– Rui F Ribeiro
Dec 1 '15 at 14:09
|
show 3 more comments
1
Would you show us the output of "netstat -6 -an"?
– Rui F Ribeiro
Dec 1 '15 at 11:20
Yep, docker is listening on that port:tcp6 0 0 :::8500 :::* LISTEN 1648/dockerFascinating. Why? And why is it blocking?
– mknecht
Dec 1 '15 at 11:55
Listening and not configured, or IPv6 disabled in sysctl, I guess. nginx, apache, lighthttp, would you append the web server in question to the post, please?
– Rui F Ribeiro
Dec 1 '15 at 13:18
Inside the container, Consul, a key-value store for configuration, is listening. But I don't think it's relevant: the container has not been IPv6-enabled. That request should never reach Consul. I don't get on which layer it gets stuck, though. On the host,/proc/sys/net/ipv6/conf/all/disable_ipv6yields 0, so IPv6 should be enabled.
– mknecht
Dec 1 '15 at 13:39
2
That does not mean much. You can have IPv6 disabled even in sysctl, and in newer kernels, as long as the program binds to an IPv6 socket, the request is honoured. A pain in the ass, as you must go through each daemon that supports IPv6 and disable the IPv6 configuration.
– Rui F Ribeiro
Dec 1 '15 at 14:09
1
1
Would you show us the output of "netstat -6 -an"?
– Rui F Ribeiro
Dec 1 '15 at 11:20
Would you show us the output of "netstat -6 -an"?
– Rui F Ribeiro
Dec 1 '15 at 11:20
Yep, docker is listening on that port:
tcp6 0 0 :::8500 :::* LISTEN 1648/docker Fascinating. Why? And why is it blocking?– mknecht
Dec 1 '15 at 11:55
Yep, docker is listening on that port:
tcp6 0 0 :::8500 :::* LISTEN 1648/docker Fascinating. Why? And why is it blocking?– mknecht
Dec 1 '15 at 11:55
Listening and not configured, or IPv6 disabled in sysctl, I guess. nginx, apache, lighthttp, would you append the web server in question to the post, please?
– Rui F Ribeiro
Dec 1 '15 at 13:18
Listening and not configured, or IPv6 disabled in sysctl, I guess. nginx, apache, lighthttp, would you append the web server in question to the post, please?
– Rui F Ribeiro
Dec 1 '15 at 13:18
Inside the container, Consul, a key-value store for configuration, is listening. But I don't think it's relevant: the container has not been IPv6-enabled. That request should never reach Consul. I don't get on which layer it gets stuck, though. On the host,
/proc/sys/net/ipv6/conf/all/disable_ipv6 yields 0, so IPv6 should be enabled.– mknecht
Dec 1 '15 at 13:39
Inside the container, Consul, a key-value store for configuration, is listening. But I don't think it's relevant: the container has not been IPv6-enabled. That request should never reach Consul. I don't get on which layer it gets stuck, though. On the host,
/proc/sys/net/ipv6/conf/all/disable_ipv6 yields 0, so IPv6 should be enabled.– mknecht
Dec 1 '15 at 13:39
2
2
That does not mean much. You can have IPv6 disabled even in sysctl, and in newer kernels, as long as the program binds to an IPv6 socket, the request is honoured. A pain in the ass, as you must go through each daemon that supports IPv6 and disable the IPv6 configuration.
– Rui F Ribeiro
Dec 1 '15 at 14:09
That does not mean much. You can have IPv6 disabled even in sysctl, and in newer kernels, as long as the program binds to an IPv6 socket, the request is honoured. A pain in the ass, as you must go through each daemon that supports IPv6 and disable the IPv6 configuration.
– Rui F Ribeiro
Dec 1 '15 at 14:09
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f246565%2fcurl-request-to-ipv6-localhost-gets-stuck%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f246565%2fcurl-request-to-ipv6-localhost-gets-stuck%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Would you show us the output of "netstat -6 -an"?
– Rui F Ribeiro
Dec 1 '15 at 11:20
Yep, docker is listening on that port:
tcp6 0 0 :::8500 :::* LISTEN 1648/dockerFascinating. Why? And why is it blocking?– mknecht
Dec 1 '15 at 11:55
Listening and not configured, or IPv6 disabled in sysctl, I guess. nginx, apache, lighthttp, would you append the web server in question to the post, please?
– Rui F Ribeiro
Dec 1 '15 at 13:18
Inside the container, Consul, a key-value store for configuration, is listening. But I don't think it's relevant: the container has not been IPv6-enabled. That request should never reach Consul. I don't get on which layer it gets stuck, though. On the host,
/proc/sys/net/ipv6/conf/all/disable_ipv6yields 0, so IPv6 should be enabled.– mknecht
Dec 1 '15 at 13:39
2
That does not mean much. You can have IPv6 disabled even in sysctl, and in newer kernels, as long as the program binds to an IPv6 socket, the request is honoured. A pain in the ass, as you must go through each daemon that supports IPv6 and disable the IPv6 configuration.
– Rui F Ribeiro
Dec 1 '15 at 14:09