Created
November 25, 2018 17:48
-
-
Save spy86/78498e9717b78ceca1d49c74163991cc to your computer and use it in GitHub Desktop.
iptables settings to block udp other than dns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# allow dns requests to google nameservers | |
iptables -A OUTPUT -p udp --dport 53 -d 8.8.8.8 -j ACCEPT | |
iptables -A OUTPUT -p udp --dport 53 -d 8.8.4.4 -j ACCEPT | |
# block all other udp | |
iptables -A OUTPUT -p udp -j DROP | |
ip6tables -A OUTPUT -p udp -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment