Published on

iptables failed - iptables No chain - target - match by that name

Authors

Last Modified : Tuesday, August 06, 2024

Error

Error response from daemon: driver failed programming external connectivity on endpoint config-api-1 : (iptables failed : iptables -wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8080 -j DNAT -to-destination 178.20.0.89:8080 ! -i br-ada679cb0c64: iptables: No chain/target/match by that name. (exit status 1))

Why did this error occured

You will get this error when your dockerfile or docker-compose file is trying to create iptables rules. The purpose of that is to create network isolation for your docker containers.

Solve 1

Restart docker service file

sudo systemctl restart docker

Solve 2

If restarting docker did not solve the issue then, you can flush iptables

WARNING - You are about to flush your iptable rules, make sure that your know what those are and you can add them back later as well

First, do iptables -L and make a note of all the iptable rules setup

sudo iptables -L

Now we will flush them

sudo iptables -t filter -X
sudo iptables -t filter -F

After flusing the iptables we will restart the docker service file

sudo systemctl restart docker

Solve 3

If both solutions don't work then we can stop the firewall and restart the docker service.

WARNING - You are about to stop a firewall, first make sure that you know your firewall configuration, then only stop it

sudo service firewalld stop
sudo service restart docker

docker

iptables

ipaddress