Skip to content

Instantly share code, notes, and snippets.

@diegobarros0701
Last active September 4, 2019 23:58
Show Gist options
  • Save diegobarros0701/5213980c966f890aae9807a9e57000d4 to your computer and use it in GitHub Desktop.
Save diegobarros0701/5213980c966f890aae9807a9e57000d4 to your computer and use it in GitHub Desktop.
Disable Docker's iptables and use UFW

Disable Docker's iptables

CentOS 7

sudo mkdir /etc/systemd/system/docker.service.d
sudo nano /etc/systemd/system/docker.service.d/iptables-disabled.conf

Put this config on it

ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --iptables=false
sudo systemctl daemon-reload
sudo systemctl restart docker

Ubuntu

sudo nano /etc/default/docker 

And add this line

DOCKER_OPTS="--iptables=false"

Restart

sudo systemctl restart docker

Use ufw

CentOS

sudo yum install -y ufw

Stop and disabled firewalld

sudo systemctl stop firewalld
sudo systemctl disable firewalld

Check it is stopped

sudo firewall-cmd --state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment