{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/2174","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/2174/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/2174/comments","events_url":"https://api.github.com/repos/docker/docker/issues/2174/events","html_url":"https://github.com/docker/docker/issues/2174","id":20869041,"number":2174,"title":"Port redirecting binding to IPv6 but not IPv4 interfaces.","user":{"login":"marklit","id":359316,"avatar_url":"https://avatars.githubusercontent.com/u/359316?v=3","gravatar_id":"","url":"https://api.github.com/users/marklit","html_url":"https://github.com/marklit","followers_url":"https://api.github.com/users/marklit/followers","following_url":"https://api.github.com/users/marklit/following{/other_user}","gists_url":"https://api.github.com/users/marklit/gists{/gist_id}","starred_url":"https://api.github.com/users/marklit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marklit/subscriptions","organizations_url":"https://api.github.com/users/marklit/orgs","repos_url":"https://api.github.com/users/marklit/repos","events_url":"https://api.github.com/users/marklit/events{/privacy}","received_events_url":"https://api.github.com/users/marklit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/exp/expert","name":"exp/expert","color":"3B8686"},{"url":"https://api.github.com/repos/docker/docker/labels/group/networking","name":"group/networking","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/bug","name":"kind/bug","color":"FF8C94"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":114,"created_at":"2013-10-11T13:40:07Z","updated_at":"2016-06-27T13:33:33Z","closed_at":null,"body":"Is there a way I can tell docker to only bind redirected ports to IPv4 interfaces?\r\n\r\nI have a machine running with IPv6 disabled:\r\n\r\n    # echo '1' > /proc/sys/net/ipv6/conf/lo/disable_ipv6  \r\n    # echo '1' > /proc/sys/net/ipv6/conf/lo/disable_ipv6  \r\n    # echo '1' > /proc/sys/net/ipv6/conf/all/disable_ipv6  \r\n    # echo '1' > /proc/sys/net/ipv6/conf/default/disable_ipv6\r\n    # /etc/init.d/networking restart\r\n\r\n`ifconfig` reports there are no IPv6-enabled interfaces:\r\n\r\n    # ifconfig\r\n    docker0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  \r\n              inet addr:172.17.42.1  Bcast:0.0.0.0  Mask:255.255.0.0\r\n              UP BROADCAST MULTICAST  MTU:1500  Metric:1\r\n              RX packets:1372 errors:0 dropped:0 overruns:0 frame:0\r\n              TX packets:7221 errors:0 dropped:0 overruns:0 carrier:0\r\n              collisions:0 txqueuelen:0 \r\n              RX bytes:88091 (88.0 KB)  TX bytes:10655750 (10.6 MB)\r\n    \r\n    eth0      Link encap:Ethernet  HWaddr 04:01:08:c1:b1:01  \r\n              inet addr:198.XXX.XXX.XXX  Bcast:198.199.90.255  Mask:255.255.255.0\r\n              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n              RX packets:97602 errors:0 dropped:4 overruns:0 frame:0\r\n              TX packets:15362 errors:0 dropped:0 overruns:0 carrier:0\r\n              collisions:0 txqueuelen:1000 \r\n              RX bytes:141867997 (141.8 MB)  TX bytes:1376970 (1.3 MB)\r\n    \r\n    lo        Link encap:Local Loopback  \r\n              inet addr:127.0.0.1  Mask:255.0.0.0\r\n              UP LOOPBACK RUNNING  MTU:65536  Metric:1\r\n              RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r\n              collisions:0 txqueuelen:0 \r\n              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)\r\n    \r\n    lxcbr0    Link encap:Ethernet  HWaddr 9e:51:04:ed:13:d4  \r\n              inet addr:10.0.3.1  Bcast:10.0.3.255  Mask:255.255.255.0\r\n              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n              RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r\n              collisions:0 txqueuelen:0 \r\n              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)\r\n\r\nWhen I launch a new docker container and ask it to port forward 8000 to 8000 in the container it does so only on IPv6 interfaces. Is there a way to make it only bind to IPv4 interfaces?\r\n\r\n    # docker run -p 8000:8000 -i -t colinsurprenant/ubuntu-raring-amd64 /bin/bash\r\n\r\nWhen I check with `lsof` it says that only IPv6-related bindings have been made:\r\n\r\n    # lsof -OnP | grep LISTEN\r\n    sshd      1275             root    3u     IPv4 ... TCP *:22 (LISTEN)\r\n    sshd      1275             root    4u     IPv6 ... TCP *:22 (LISTEN)\r\n    dnsmasq   2975      lxc-dnsmasq    7u     IPv4 ... TCP 10.0.3.1:53 (LISTEN)\r\n    docker    9629             root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n    docker    9629 9630        root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n    docker    9629 9631        root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n    docker    9629 9632        root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n    docker    9629 9633        root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n    docker    9629 9634        root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n    docker    9629 9698        root    7u     IPv6 ... TCP *:8000 (LISTEN)\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/228746406","html_url":"https://github.com/docker/docker/issues/2174#issuecomment-228746406","issue_url":"https://api.github.com/repos/docker/docker/issues/2174","id":228746406,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T13:33:33Z","updated_at":"2016-06-27T13:33:33Z","body":"@denysvitali Docker already adds this rule to the PREROUTING chain:\r\n```\r\nDOCKER     all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL\r\n```"}}
{"actor":{"display_login":"cpuguy83"}}