Upvotes 0 Share PDF

iptables error when starting container with docker run

When starting a container with docker run, if the firewall service isn't started, you will see the following iptables error:

docker: Error response from daemon: driver failed programming external connectivity on endpoint <name> (979e4123444e276344d23bf41ea1f59ea31c61ff31fe77ce38d16672b1fe2e78):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 32779 -j DNAT --to-destination 172.17.0.2:5000 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)).

Prerequisites

This issue occurs in the following environments:

  • Docker Engine running on:
    • RHEL
    • CentOS
    • Ubuntu

Steps

  • Ensure the firewalld service has been started with:

    sudo systemctl start firewalld.service
    
  • You can verify the service is running with:

    systemctl status firewalld.service