-
-
Save thoward/24b0102355331dd6dd3b to your computer and use it in GitHub Desktop.
iptables 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