{"action":"closed","issue":{"url":"https://api.github.com/repos/docker/docker/issues/7807","labels_url":"https://api.github.com/repos/docker/docker/issues/7807/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/7807/comments","events_url":"https://api.github.com/repos/docker/docker/issues/7807/events","html_url":"https://github.com/docker/docker/issues/7807","id":41562517,"number":7807,"title":"Network problem when using a second eth interface that have a bloc IP on it. (config included)","user":{"login":"Xoib","id":511705,"avatar_url":"https://avatars.githubusercontent.com/u/511705?v=3","gravatar_id":"","url":"https://api.github.com/users/Xoib","html_url":"https://github.com/Xoib","followers_url":"https://api.github.com/users/Xoib/followers","following_url":"https://api.github.com/users/Xoib/following{/other_user}","gists_url":"https://api.github.com/users/Xoib/gists{/gist_id}","starred_url":"https://api.github.com/users/Xoib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xoib/subscriptions","organizations_url":"https://api.github.com/users/Xoib/orgs","repos_url":"https://api.github.com/users/Xoib/repos","events_url":"https://api.github.com/users/Xoib/events{/privacy}","received_events_url":"https://api.github.com/users/Xoib/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-08-30T12:40:36Z","updated_at":"2015-02-26T19:26:24Z","closed_at":"2015-02-26T19:26:24Z","body":"Hello,\r\n\r\nOne problem is that containers can't reach each other, when I ping from one to the other via the public ip redirected to them, it doesn't pass (see iptables problem below).\r\n\r\nThe other problem is that every time I docker stop on a container, before I start it again I have to restart the whole docker (the daemon), if not, there is the port already binded error. Even if I lsof, I don't see it bind, but docker think it is...\r\n\r\nAlso if I want to access the container from outside, I have to delete nat rule within DOCKER statement in iptables -L -t nat.\r\n\r\nI have a bloc IP from OVH bind on eth1 of my server. It has been a few weeks I run with that, I guess now I have to share it here so we can find how to solve the problem and stop the workarounds. I only have one container that use the address on eth0, all the others is using an IP of the bloc on eth1.\r\n\r\nKernel:\r\n```\r\nLinux 3.14-0.bpo.1-amd64 #1 SMP Debian 3.14.12-1~bpo70+1 (2014-07-13) x86_64 GNU/Linux\r\n```\r\n\r\nDocker:\r\n```\r\nClient version: 1.1.2\r\nClient API version: 1.13\r\nGo version (client): go1.2.1\r\nGit commit (client): d84a070\r\nServer version: 1.1.2\r\nServer API version: 1.13\r\nGo version (server): go1.2.1\r\nGit commit (server): d84a070\r\n```\r\n\r\nHere is my /etc/network/interfaces :\r\n```\r\nauto lo\r\niface lo inet loopback\r\n\r\nauto eth0\r\niface eth0 inet static\r\n        address 38.58.18.236\r\n        netmask 255.255.255.0\r\n        network 38.58.18.0\r\n        broadcast 38.58.18.255\r\n        gateway 38.58.18.254\r\n\r\niface eth0 inet6 static\r\n        address 2001:41D0:8:65ec::\r\n        netmask 64\r\n        post-up /sbin/ip -f inet6 route add 2001:41D0:8:65ff:ff:ff:ff:ff dev eth0\r\n        post-up /sbin/ip -f inet6 route add default via 2001:41D0:8:65ff:ff:ff:ff:ff\r\n        pre-down /sbin/ip -f inet6 route del default via 2001:41D0:8:65ff:ff:ff:ff:ff\r\n        pre-down /sbin/ip -f inet6 route del 2001:41D0:8:65ff:ff:ff:ff:ff dev eth0\r\n\r\nauto eth1\r\niface eth1 inet static\r\n     address 38.58.252.224\r\n     netmask 255.255.255.224\r\n     post-up /sbin/ip route add default via 38.58.252.254 dev eth1 table 125\r\n     post-up /sbin/ip rule add from 38.58.252.224/27 table 125\r\n     pre-down /sbin/ip rule del from 38.58.252.224/27 table 125\r\n     pre-down /sbin/ip route del default via 38.58.252.254 dev eth1 table 125\r\n     post-up /sbin/ip addr add 38.58.252.225/27 dev eth1\r\n     post-down /sbin/ip addr add 38.58.252.225/27 dev eth1\r\n     post-up /sbin/ip addr add 38.58.252.226/27 dev eth1\r\n     post-down /sbin/ip addr add 38.58.252.226/27 dev eth1\r\n     post-up /sbin/ip addr add 38.58.252.227/27 dev eth1\r\n     post-down /sbin/ip addr add 38.58.252.227/27 dev eth1\r\n     post-up /sbin/ip addr add 38.58.252.228/27 dev eth1\r\n     post-down /sbin/ip addr add 38.58.252.228/27 dev eth1\r\n```\r\n\t \r\nHere is the ip addr:\r\n```\r\n1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN\r\n    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\n    inet 127.0.0.1/8 scope host lo\r\n       valid_lft forever preferred_lft forever\r\n    inet6 ::1/128 scope host\r\n       valid_lft forever preferred_lft forever\r\n2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000\r\n    link/ether 00:25:90:dd:32:0c brd ff:ff:ff:ff:ff:ff\r\n    inet 38.58.18.236/24 brd 38.58.18.255 scope global eth0\r\n       valid_lft forever preferred_lft forever\r\n    inet6 2001:41d0:8:65ec::/64 scope global\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::225:80ff:fedd:320c/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000\r\n    link/ether 00:25:90:dd:32:0d brd ff:ff:ff:ff:ff:ff\r\n    inet 38.58.252.225/27 scope global eth1\r\n       valid_lft forever preferred_lft forever\r\n    inet 38.58.252.226/27 scope global secondary eth1\r\n       valid_lft forever preferred_lft forever\r\n    inet 38.58.252.227/27 scope global secondary eth1\r\n       valid_lft forever preferred_lft forever\r\n    inet 38.58.252.228/27 scope global secondary eth1\r\n       valid_lft forever preferred_lft forever\r\n    inet 38.58.252.224/27 brd 38.58.252.255 scope global secondary eth1\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::225:80ff:fedd:320d/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n267: veth49fb: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether 52:3a:a2:ce:19:06 brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::503a:a2ff:fece:1906/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n277: veth9707: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether 4e:19:2f:c7:26:db brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::4c19:2fff:fec7:26db/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n53: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP\r\n    link/ether 56:84:7a:fe:97:99 brd ff:ff:ff:ff:ff:ff\r\n    inet 172.17.42.1/16 scope global docker0\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::5484:7aff:fefe:9799/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n329: veth66fa: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether d2:06:6c:c8:de:09 brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::d006:6cff:fec8:de09/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n185: veth652d: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether 8a:f9:3a:e4:27:2e brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::88f9:3aff:fee4:272e/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n191: veth3dbb: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether f6:d2:d5:91:b2:d0 brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::f4d2:d5ff:fe91:b2d0/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n193: vethe287: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether fe:42:2b:b5:eb:25 brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::fc42:2bff:feb5:eb25/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n207: veth9f71: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master docker0 state UP qlen 1000\r\n    link/ether de:d5:4b:b9:0a:f1 brd ff:ff:ff:ff:ff:ff\r\n    inet6 fe80::dcd5:4bff:feb9:af1/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n```\r\n\r\niptables -L -t nat :\r\n```\r\nChain PREROUTING (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nDOCKER     all  --  anywhere             anywhere             ADDRTYPE match dst-type LOCAL\r\n\r\nChain INPUT (policy ACCEPT)\r\ntarget     prot opt source               destination\r\n\r\nChain OUTPUT (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nDOCKER     all  --  anywhere            !loopback/8           ADDRTYPE match dst-type LOCAL\r\n\r\nChain POSTROUTING (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nMASQUERADE  all  --  172.17.0.0/16       !172.17.0.0/16\r\n\r\nChain DOCKER (2 references)\r\ntarget     prot opt source               destination\r\nDNAT       tcp  --  anywhere             alpha.xoib.com    tcp dpt:63389 to:172.17.0.60:389\r\n```\r\n\r\nI kept the last one because it is on the adress of eth0, the others for eth1 I had to delete them for the container to be reachable from outside\r\n\r\nI changed all the dns name and adresses to keep the server private.\r\n\r\nThanks,\r\n"}}