Skip to content

Instantly share code, notes, and snippets.

@Fohlen
Created October 13, 2018 09:04
Show Gist options
  • Save Fohlen/8cefee5d6e537a7b461568e07a13b9df to your computer and use it in GitHub Desktop.
Save Fohlen/8cefee5d6e537a7b461568e07a13b9df to your computer and use it in GitHub Desktop.
Docker+ufw
# Put in /etc/ufw/after.rules
# Put Docker behind UFW
*filter
:DOCKER-USER - [0:0]
:ufw-user-input - [0:0]
-A DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A DOCKER-USER -m conntrack --ctstate INVALID -j DROP
-A DOCKER-USER -i eth0 -j ufw-user-input
-A DOCKER-USER -i eth0 -j DROP
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment