Bug 1245325
Summary: | Cannot link containers | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Daniel Walsh <dwalsh> | ||||
Component: | docker | Assignee: | Daniel Walsh <dwalsh> | ||||
Status: | CLOSED ERRATA | QA Contact: | atomic-bugs <atomic-bugs> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 7.1 | CC: | adimania, admiller, cevich, dwalsh, extras-qa, ichavero, jcajka, jchaloup, jpopelka, jskladan, kayvansylvan, lmiksik, lsm5, miminar, mjenner, tjay, twoerner, vbatts, yajo.sk8 | ||||
Target Milestone: | rc | Keywords: | Extras | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | docker-1.7.1-105.el7.x86_64 | Doc Type: | Bug Fix | ||||
Doc Text: |
THIS WAS NEVER RELEASED SO WE SHOULD NOT BE IN THE ERRATA
Cause: IPTables rules are being added out of order when Firewalld is running. Additionally, some code is missing to reload IPtable rules when Firewalld reloads.
Consequence: When Firewalld is enabled, contaianers cannot communicate with one another. When firewalld is reloaded, IPTable rules are flushed.
Fix: Adjust ICC rule to 'insert' instead of append. This moves the IPtable rule in the correct order. Missing firewalld functionality needed to be refactored in.
Result: Containers can communicate with one another again. When Firewalld is reloaded, IPtable rules are not flushed.
|
Story Points: | --- | ||||
Clone Of: | 1244124 | Environment: | |||||
Last Closed: | 2016-06-23 16:17:25 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | 1244124 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Daniel Walsh
2015-07-21 18:46:59 UTC
Trevor You suggested adding sudo iptables -t filter -A DOCKER -d 172.17.0.0/16 -i docker0 -j ACCEPT in https://github.com/docker/docker/issues/14396 Do you suggest that we should do this by default, and then remove it when icc=false? Created attachment 1054542 [details]
Well we need this patch back ported from docker-1.8
This will at least init firewalld and get docker talking to it.
With firewalld ENABLED, this is the FORWARD chain in my IP tables: Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 2 120 DOCKER all -- any docker0 anywhere anywhere 0 0 ACCEPT all -- any docker0 anywhere anywhere ctstate RELATED,ESTABLISHED 0 0 ACCEPT all -- docker0 !docker0 anywhere anywhere 0 0 ACCEPT all -- any virbr0 anywhere 192.168.122.0/24 ctstate RELATED,ESTABLISHED 0 0 ACCEPT all -- virbr0 any 192.168.122.0/24 anywhere 0 0 ACCEPT all -- virbr0 virbr0 anywhere anywhere 0 0 REJECT all -- any virbr0 anywhere anywhere reject-with icmp-port-unreachable 0 0 REJECT all -- virbr0 any anywhere anywhere reject-with icmp-port-unreachable 0 0 ACCEPT all -- any any anywhere anywhere ctstate RELATED,ESTABLISHED 0 0 ACCEPT all -- lo any anywhere anywhere 2 120 FORWARD_direct all -- any any anywhere anywhere 2 120 FORWARD_IN_ZONES_SOURCE all -- any any anywhere anywhere 2 120 FORWARD_IN_ZONES all -- any any anywhere anywhere 2 120 FORWARD_OUT_ZONES_SOURCE all -- any any anywhere anywhere 2 120 FORWARD_OUT_ZONES all -- any any anywhere anywhere 0 0 ACCEPT icmp -- any any anywhere anywhere 0 0 DROP all -- any any anywhere anywhere ctstate INVALID 2 120 REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited 0 0 ACCEPT all -- docker0 docker0 anywhere anywhere If I delete the rule to the reject target at the bottom, it seems that I can get containers talking to each-other again. I will take a closer look at this first thing tomorrow morning. (In reply to Daniel Walsh from comment #3) > Trevor You suggested adding > > sudo iptables -t filter -A DOCKER -d 172.17.0.0/16 -i docker0 -j ACCEPT > > in > > https://github.com/docker/docker/issues/14396 > > Do you suggest that we should do this by default, and then remove it when > icc=false? > As much as I'd like to lock docker0 down just a little bit more, I think the right thing to do here is provide the same docker0 behavior with firewalld as vanilla Docker provides without it. Refining your earlier suggestion, I would think adding: sudo iptables -t filter -A DOCKER -i docker0 -o docker0 -j ACCEPT by default and removing it when icc=false is fine. @Alec I don't think that removing the Reject at the end of the forward chain is the right solution. Adding some explicit rules before that to ACCEPT forwarding from/to the docker0 interface seems correct. That's what I did in my workaround. It's certainly a missing set of rules regarding forwarding packets to/from docker0. (In reply to Trevor Jay from comment #6) > sudo iptables -t filter -A DOCKER -i docker0 -o docker0 -j ACCEPT Works for me. In firewalld-0.3.9-12.el7.noarch, docker-1.7.1-105.el7.x86_64 # docker run -it --rm --link db:db postgres:9.2 bash -c 'psql -h $DB_PORT_5432_TCP_ADDR -p $DB_PORT_5432_TCP_PORT -U postgres' Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning. psql (9.2.13) Type "help" for help. postgres=# # iptables-save | grep -i docker :DOCKER - [0:0] -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER -A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER -A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE :DOCKER - [0:0] -A FORWARD -o docker0 -j DOCKER -A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT -A FORWARD -i docker0 ! -o docker0 -j ACCEPT -A FORWARD -i docker0 -o docker0 -j DROP -A DOCKER -s 172.17.0.2/32 -d 172.17.0.1/32 -i docker0 -o docker0 -p tcp -m tcp --dport 5432 -j ACCEPT -A DOCKER -s 172.17.0.1/32 -d 172.17.0.2/32 -i docker0 -o docker0 -p tcp -m tcp --sport 5432 -j ACCEPT So, i'd like to move to verified How do I install a fixed version? $ sudo dnf --enablerepo updates-testing update docker Installing from updates-testing got me this: $ docker -v Docker version 1.7.1.fc22, build b6416b7/1.7.1 And my use cases still fail the same way and start working again when I do this: iptables -A DOCKER --source 0.0.0.0/0 --destination 172.17.0.0/16 \ -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT iptables -A DOCKER --destination 0.0.0.0/0 --source 172.17.0.0/16 -j ACCEPT docker-1.7.1-5.gitc8962ac.fc22 has the fix. It might not have gotten to the mirrors yet. rpm -q docker You can grab the packages directly from here. http://koji.fedoraproject.org/koji/buildinfo?buildID=671790 I just tested on CentOS 7 as well and everything worked as expected. Re-check with docker-1.7.1-107.el7.x86_64, it works fine The latest docker RPMs have problems still. Does not work correctly on Fedora 22. See comments at the end of bug 1244124. Hi Kayvan, let's keep the fedora and rhel bugs separate. Fedora bugs will get updated separately. Gotcha, Lokesh. Thanks. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1274 |