# Shorewall+Docker: Zwei großartige Geschmäcker, die zusammen großartig schmecken

**URL:** <https://meta.discourse.org/t/shorewall-docker-two-great-tastes-that-taste-great-together/35966>\
**Category:** Blog\
**Created:** [24. November 2015 um 03:22 UTC](https://meta.discourse.org/t/shorewall-docker-two-great-tastes-that-taste-great-together/35966 "2015-11-24T03:22:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![John\_Davidson](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@John\_Davidson](https://meta.discourse.org/u/John_Davidson)\
**Post date:** [21. April 2016 um 13:45 UTC](https://meta.discourse.org/t/shorewall-docker-two-great-tastes-that-taste-great-together/35966/3 "2016-04-21T13:45:48Z")

</div>

Docker has changed their iptables implementation so that the rules captured and replaced are no longer complete.

As a suggestion the revisions posted below should correct the issue and be more tolerant of future changes

`/etc/shorewall/init` and `/etc/shorewall/stop` should become

```
if iptables -t nat -L DOCKER >/dev/null 2>&1; then
    echo '*nat' > /etc/shorewall/docker_rules
    iptables -t nat -S | grep -i docker >> /etc/shorewall/docker_rules
    echo 'COMMIT' >> /etc/shorewall/docker_rules

    echo '*filter' >> /etc/shorewall/docker_rules
    iptables -t filter -S | grep -i docker >> /etc/shorewall/docker_rules
    echo 'COMMIT' >> /etc/shorewall/docker_rules
fi

```

and `/etc/shorewall/start` should be

```
if [-f /etc/shorewall/docker_rules]; then
    iptables-restore -n < /etc/shorewall/docker_rules

    rm -f /etc/shorewall/docker_rules
fi

```

---

_[View the full topic](https://meta.discourse.org/t/shorewall-docker-two-great-tastes-that-taste-great-together/35966)._
