Skip to content
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

Container can not be accessed by another Docker host #609

Closed
qianzhangxa opened this issue Feb 8, 2017 · 6 comments
Closed

Container can not be accessed by another Docker host #609

qianzhangxa opened this issue Feb 8, 2017 · 6 comments

Comments

@qianzhangxa
Copy link

qianzhangxa commented Feb 8, 2017

Hi,

I have two hosts which have Docker (1.13.0) integrated with Flannel (0.5.5):

host1: eth0/192.168.5.1, flannel0/10.1.89.0, docker0/10.1.89.1
host2: eth0/192.168.5.2, flannel0/10.1.69.0, docker0/10.1.69.1

There is a container running on host1 whose IP is 10.1.89.2, I can ping it from host1, but I can not ping it from host2 or from any containers in host2.

Here is the output of tcpdump in host1 when I ping 10.1.89.2 from host2:

# tcpdump -nni eth0 host 192.168.5.1 and 192.168.5.2
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
22:07:19.207158 IP 192.168.5.2.8285 > 192.168.5.1.8285: UDP, length 84
22:07:20.207372 IP 192.168.5.2.8285 > 192.168.5.1.8285: UDP, length 84
22:07:21.207464 IP 192.168.5.2.8285 > 192.168.5.1.8285: UDP, length 84
...

# tcpdump -nni flannel0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on flannel0, link-type RAW (Raw IP), capture size 262144 bytes
22:09:14.556410 IP 10.1.69.0 > 10.1.89.2: ICMP echo request, id 19788, seq 4, length 64
22:09:15.556218 IP 10.1.69.0 > 10.1.89.2: ICMP echo request, id 19788, seq 5, length 64
22:09:16.556210 IP 10.1.69.0 > 10.1.89.2: ICMP echo request, id 19788, seq 6, length 64

And there is no any output of tcpdump -nni docker0 icmp. So it seems the packets were not delivered from flannel0 to docker0 in host1.

Any ideas about what's wrong in my environment? Thanks!

@adaiguoguo
Copy link

adaiguoguo commented Feb 16, 2017

sudo iptables -P FORWARD ACCEPT fix this.
Docker change log

@qianzhangxa
Copy link
Author

It works, thanks @adaiguoguo !!!

@intsilence
Copy link

Same problem here, worked with @adaiguoguo , thanks very much!

@lklkxcxc
Copy link

我也碰到了原来是这个问题已解决。

@cmingxu
Copy link

cmingxu commented Oct 26, 2017

works for me, should save my hours if saw this earlier, great!

tomdee added a commit to tomdee/flannel that referenced this issue Nov 11, 2017
To work around the Docker change from v1.13 which
changed the default FORWARD policy to DROP.

The change has bitten many many users.

The troubleshooting documentation is also updated talk about the issue.

Replaces PR flannel-io#862
Fixes flannel-io#834
Fixes flannel-io#823
Fixes flannel-io#609
Fixes flannel-io#799
tomdee added a commit to tomdee/flannel that referenced this issue Nov 16, 2017
To work around the Docker change from v1.13 which
changed the default FORWARD policy to DROP.

The change has bitten many many users.

The troubleshooting documentation is also updated talk about the issue.

Replaces PR flannel-io#862
Fixes flannel-io#834
Fixes flannel-io#823
Fixes flannel-io#609
Fixes flannel-io#799
@uplogin
Copy link

uplogin commented Feb 27, 2018

Thank you very much @adaiguoguo
It works

willgorman pushed a commit to willgorman/flannel that referenced this issue Jun 19, 2019
To work around the Docker change from v1.13 which
changed the default FORWARD policy to DROP.

The change has bitten many many users.

The troubleshooting documentation is also updated talk about the issue.

Replaces PR flannel-io#862
Fixes flannel-io#834
Fixes flannel-io#823
Fixes flannel-io#609
Fixes flannel-io#799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants