Skip to content

Instantly share code, notes, and snippets.

@Demacr
Created June 28, 2020 12:01
Show Gist options
  • Save Demacr/eeb4beac3c57bc43d77c8b3936ccc6af to your computer and use it in GitHub Desktop.
Save Demacr/eeb4beac3c57bc43d77c8b3936ccc6af to your computer and use it in GitHub Desktop.
Ubuntu conntrack blocks DNS queries, but has ESTABLISHED and RELATED
# Add to raw this block
#
*raw
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -p udp -m udp --dport 53 -j CT --notrack
-A PREROUTING -p udp -m udp --sport 53 -j CT --notrack
-A OUTPUT -p udp -m udp --dport 53 -j CT --notrack
-A OUTPUT -p udp -m udp --sport 53 -j CT --notrack
COMMIT
*filter
:INPUT ACCEPT [18:925]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [105:18837]
#
# Add UNTRACKED state to accept
#
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED,UNTRACKED -j ACCEPT
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment