Docker error: failed to set up container networking: driver failed programming external connectivity on endpoint iptables

Docker error: failed to set up container networking: driver failed programming external connectivity on endpoint iptables

OpenPanel docker container restart failed with error message:

2025 05 27 12 06 1 - Docker error: failed to set up container networking: driver failed programming external connectivity on endpoint iptables

When trying to restart the docker container from terminal, error:

Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint openpanel (e05ef1600f08bc680b77272cdc00104a7d3c51c9cb76e9fd59645197f4fe792b): Unable to enable DNAT rule: (iptables failed: iptables –wait -t nat -A DOCKER -p tcp -d 0/0 –dport 2083 -j DNAT –to-destination 172.18.0.2:2083 ! -i br-e95c0bd51182: iptables: No chain/target/match by that name.

This is a bug in docker engine and docker compose before v2.27 caused by another program such as CSF or Firewalld editing iptables rules before docker.

To resolve, simply restart the service, for CSF:

csf -r

and then restart Docker to add its rules again on iptables:

service docker restart

afterwards starting containers works as usual.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.