Menu ▾ ▴

#5472 Applying IPv4 Firewall Settings Breaks Docker IPTables

1.973
open
nobody
5
2021-04-15
2021-04-01
No

Issue

Updating iptables firewall seems to break Docker chains for container networking. Webmin is likely recreating iptables without regard to the additional tables docker creates for networking. Restarting docker fixes the issue (as docker recreates the tables), but these iptables shouldn't be getting cleared/corrupted in the first place.

Steps Taken

  • Bring down and up a Docker service repeadedly successfully
  • Go to Webmin > Network > Firewall
  • Click Apply Configuration
  • Bring service up again. An error occurs:
ERROR: for plex  Cannot start service plex: driver failed programming external connectivity on endpoint plex (272d1d65f9e4215b661ffbed6f8f68e75723b8e186e0228a707feda25ef00399):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 32469 -j DNAT --to-destination 172.22.0.7:32469 ! -i br-f866ac1119f4: iptables: No chain/target/match by that name.
 (exit status 1))

Expected Behavior

Altering, updating, or refreshing the iptables settings provided by Webmin should not affect any other iptable chains created by other linux processes.

Discussion

  • Nicholas J Keane

    Platform: Ubuntu 20.04.2 LTS 5.10.25-rt35-xanmod1

     
  • Jamie Cameron

    Jamie Cameron - 2021-04-03

    Does Docker add IPtables rules that aren't permanently saved in the IPtables config file under /etc ?

     
  • Nicholas J Keane

    In iptables.up.rules? No, doesn't look like it. Only my Webmin-configured rules exist in it.

    The chains do exist in iptables memory (iptables -L): DOCKER, DOCKER-ISOLATION-STAGE-1, DOCKER-ISOLATION-STAGE-2, and DOCKER-USER and nat (iptables -L -t nat): DOCKER

     

    Last edit: Nicholas J Keane 2021-04-04
  • Jamie Cameron

    Jamie Cameron - 2021-04-15

    Hmm ... unclear how Webmin should handle this case. Is there some script that can be run to re-establish the Docker rules?

     
  • Nicholas J Keane

    I don't know, I assume Docker has some kind of logic to recreate these rules. I posted an Issue on moby/moby, maybe they have a solution.

    https://github.com/moby/moby/issues/42298

     

Log in to post a comment.