Skip to content

Instantly share code, notes, and snippets.

@fxdave
Created November 28, 2018 11:30
Show Gist options
  • Select an option

  • Save fxdave/895d667be23fd143e6bef896ac626bbc to your computer and use it in GitHub Desktop.

Select an option

Save fxdave/895d667be23fd143e6bef896ac626bbc to your computer and use it in GitHub Desktop.
I got "No route to host" "Bad gateway" errors from the containers. This fixed my issue.

Delete all your rules and reset iptables.
My /etc/iptables/iptables.conf :

*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p icmp -j ACCEPT 
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -i lo -j ACCEPT 
-A INPUT -p tcp -j REJECT --reject-with tcp-reset 
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable 
-A INPUT -j REJECT --reject-with icmp-proto-unreachable 
COMMIT

Purge docker with all configuration files.

sudo rm -rf /var/lib/docker
sudo rm /etc/apparmor.d/docker
sudo groupdel docker
sudo rm -rf /var/run/docker.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment