BlockchainProgrammer
BlockchainProgrammer

Reputation: 2069

Failed to setup IP tables: Unable to enable NAT rule

I am doing this tutorial: https://hyperledger.github.io/composer/latest/installing/development-tools

Now i want to start the hyperledger fabric with ./startFabric.sh but then I get this error:

dany@DESKTOP-IQB2P0B:~/fabric-dev-servers$ ./startFabric.sh
Development only script for Hyperledger Fabric control
Running 'startFabric.sh'
FABRIC_VERSION is set to 'hlfv12'
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Removing network composer_default
WARNING: Network composer_default not found.
Creating network "composer_default" with the default driver
ERROR: Failed to Setup IP tables: Unable to enable NAT rule:  (iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.22.0.0/16 ! -o br-b49f324730b7 -j MASQUERADE: iptables: No chain/target/match by that name.
 (exit status 1))

Before I had this error: https://github.com/docker/compose/issues/4181

But I fixed it and now I have this error...

Upvotes: 7

Views: 12797

Answers (2)

debugger
debugger

Reputation: 444

If you're using a Debian-based distribution, then the problem could be in nftables: https://forums.docker.com/t/failing-to-start-dockerd-failed-to-create-nat-chain-docker/78269/2

The docker installer uses iptables for NAT. Unfortunately Debian uses nftables. You can convert the entries over to nftables or just setup Debian to use the legacy iptables.

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
sudo systemctl restart docker

Upvotes: 0

Israel Perales
Israel Perales

Reputation: 2360

Try:

sudo iptables -t filter -N DOCKER
sudo systemctl restart docker

Check this:

https://github.com/moby/moby/issues/16816#issuecomment-179717327

Upvotes: 15

Related Questions